aboutsummaryrefslogtreecommitdiff
path: root/lib/libspl/include/os/freebsd
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libspl/include/os/freebsd')
-rw-r--r--lib/libspl/include/os/freebsd/fcntl.h34
-rw-r--r--lib/libspl/include/os/freebsd/sys/byteorder.h207
-rw-r--r--lib/libspl/include/os/freebsd/sys/fcntl.h39
-rw-r--r--lib/libspl/include/os/freebsd/sys/file.h35
-rw-r--r--lib/libspl/include/os/freebsd/sys/ia32/asm_linkage.h185
-rw-r--r--lib/libspl/include/os/freebsd/sys/mnttab.h86
-rw-r--r--lib/libspl/include/os/freebsd/sys/mount.h105
-rw-r--r--lib/libspl/include/os/freebsd/sys/param.h65
-rw-r--r--lib/libspl/include/os/freebsd/sys/stat.h90
-rw-r--r--lib/libspl/include/os/freebsd/sys/sysmacros.h1
-rw-r--r--lib/libspl/include/os/freebsd/sys/vfs.h38
-rw-r--r--lib/libspl/include/os/freebsd/sys/zfs_context_os.h35
12 files changed, 0 insertions, 920 deletions
diff --git a/lib/libspl/include/os/freebsd/fcntl.h b/lib/libspl/include/os/freebsd/fcntl.h
deleted file mode 100644
index 1222b3d7a6b5..000000000000
--- a/lib/libspl/include/os/freebsd/fcntl.h
+++ /dev/null
@@ -1,34 +0,0 @@
-// SPDX-License-Identifier: BSD-2-Clause
-/*
- * Copyright (c) 2021 iXsystems, Inc.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifndef _LIBSPL_FCNTL_H_
-#define _LIBSPL_FCNTL_H_
-
-#include_next <fcntl.h>
-
-#include <sys/fcntl.h>
-
-#endif /* _LIBSPL_FCNTL_H_ */
diff --git a/lib/libspl/include/os/freebsd/sys/byteorder.h b/lib/libspl/include/os/freebsd/sys/byteorder.h
deleted file mode 100644
index 116ce991b89b..000000000000
--- a/lib/libspl/include/os/freebsd/sys/byteorder.h
+++ /dev/null
@@ -1,207 +0,0 @@
-// SPDX-License-Identifier: CDDL-1.0
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or https://opensource.org/licenses/CDDL-1.0.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
- */
-
-/* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
-/* All Rights Reserved */
-
-/*
- * University Copyright- Copyright (c) 1982, 1986, 1988
- * The Regents of the University of California
- * All Rights Reserved
- *
- * University Acknowledgment- Portions of this document are derived from
- * software developed by the University of California, Berkeley, and its
- * contributors.
- */
-
-#ifndef _SYS_BYTEORDER_H
-#define _SYS_BYTEORDER_H
-
-#include <sys/endian.h>
-#include <netinet/in.h>
-#include <sys/isa_defs.h>
-#include <inttypes.h>
-
-#if defined(__GNUC__) && defined(_ASM_INLINES) && \
- (defined(__i386) || defined(__amd64))
-#include <asm/byteorder.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * macros for conversion between host and (internet) network byte order
- */
-#if !defined(_XPG4_2) || defined(__EXTENSIONS__)
-
-#ifdef __COVERITY__
-/*
- * Coverity's taint warnings from byteswapping are false positives for us.
- * Suppress them by hiding byteswapping from Coverity.
- */
-#define BSWAP_8(x) ((x) & 0xff)
-#define BSWAP_16(x) ((x) & 0xffff)
-#define BSWAP_32(x) ((x) & 0xffffffff)
-#define BSWAP_64(x) (x)
-
-#else /* __COVERITY__ */
-
-/*
- * Macros to reverse byte order
- */
-#define BSWAP_8(x) ((x) & 0xff)
-#define BSWAP_16(x) ((BSWAP_8(x) << 8) | BSWAP_8((x) >> 8))
-#define BSWAP_32(x) ((BSWAP_16(x) << 16) | BSWAP_16((x) >> 16))
-#define BSWAP_64(x) ((BSWAP_32(x) << 32) | BSWAP_32((x) >> 32))
-
-#endif /* __COVERITY__ */
-
-#define BMASK_8(x) ((x) & 0xff)
-#define BMASK_16(x) ((x) & 0xffff)
-#define BMASK_32(x) ((x) & 0xffffffff)
-#define BMASK_64(x) (x)
-
-/*
- * Macros to convert from a specific byte order to/from native byte order
- */
-#ifdef _ZFS_BIG_ENDIAN
-#define BE_8(x) BMASK_8(x)
-#define BE_16(x) BMASK_16(x)
-#define BE_32(x) BMASK_32(x)
-#define BE_64(x) BMASK_64(x)
-#define LE_8(x) BSWAP_8(x)
-#define LE_16(x) BSWAP_16(x)
-#define LE_32(x) BSWAP_32(x)
-#define LE_64(x) BSWAP_64(x)
-#else
-#define LE_8(x) BMASK_8(x)
-#define LE_16(x) BMASK_16(x)
-#define LE_32(x) BMASK_32(x)
-#define LE_64(x) BMASK_64(x)
-#define BE_8(x) BSWAP_8(x)
-#define BE_16(x) BSWAP_16(x)
-#define BE_32(x) BSWAP_32(x)
-#define BE_64(x) BSWAP_64(x)
-#endif
-
-#ifdef _ZFS_BIG_ENDIAN
-static __inline__ uint64_t
-htonll(uint64_t n)
-{
- return (n);
-}
-
-static __inline__ uint64_t
-ntohll(uint64_t n)
-{
- return (n);
-}
-#else
-static __inline__ uint64_t
-htonll(uint64_t n)
-{
- return ((((uint64_t)htonl(n)) << 32) + htonl(n >> 32));
-}
-
-static __inline__ uint64_t
-ntohll(uint64_t n)
-{
- return ((((uint64_t)ntohl(n)) << 32) + ntohl(n >> 32));
-}
-#endif
-
-/*
- * Macros to read unaligned values from a specific byte order to
- * native byte order
- */
-
-#define BE_IN8(xa) \
- *((uint8_t *)(xa))
-
-#define BE_IN16(xa) \
- (((uint16_t)BE_IN8(xa) << 8) | BE_IN8((uint8_t *)(xa)+1))
-
-#define BE_IN32(xa) \
- (((uint32_t)BE_IN16(xa) << 16) | BE_IN16((uint8_t *)(xa)+2))
-
-#define BE_IN64(xa) \
- (((uint64_t)BE_IN32(xa) << 32) | BE_IN32((uint8_t *)(xa)+4))
-
-#define LE_IN8(xa) \
- *((uint8_t *)(xa))
-
-#define LE_IN16(xa) \
- (((uint16_t)LE_IN8((uint8_t *)(xa) + 1) << 8) | LE_IN8(xa))
-
-#define LE_IN32(xa) \
- (((uint32_t)LE_IN16((uint8_t *)(xa) + 2) << 16) | LE_IN16(xa))
-
-#define LE_IN64(xa) \
- (((uint64_t)LE_IN32((uint8_t *)(xa) + 4) << 32) | LE_IN32(xa))
-
-/*
- * Macros to write unaligned values from native byte order to a specific byte
- * order.
- */
-
-#define BE_OUT8(xa, yv) *((uint8_t *)(xa)) = (uint8_t)(yv);
-
-#define BE_OUT16(xa, yv) \
- BE_OUT8((uint8_t *)(xa) + 1, yv); \
- BE_OUT8((uint8_t *)(xa), (yv) >> 8);
-
-#define BE_OUT32(xa, yv) \
- BE_OUT16((uint8_t *)(xa) + 2, yv); \
- BE_OUT16((uint8_t *)(xa), (yv) >> 16);
-
-#define BE_OUT64(xa, yv) \
- BE_OUT32((uint8_t *)(xa) + 4, yv); \
- BE_OUT32((uint8_t *)(xa), (yv) >> 32);
-
-#define LE_OUT8(xa, yv) *((uint8_t *)(xa)) = (uint8_t)(yv);
-
-#define LE_OUT16(xa, yv) \
- LE_OUT8((uint8_t *)(xa), yv); \
- LE_OUT8((uint8_t *)(xa) + 1, (yv) >> 8);
-
-#define LE_OUT32(xa, yv) \
- LE_OUT16((uint8_t *)(xa), yv); \
- LE_OUT16((uint8_t *)(xa) + 2, (yv) >> 16);
-
-#define LE_OUT64(xa, yv) \
- LE_OUT32((uint8_t *)(xa), yv); \
- LE_OUT32((uint8_t *)(xa) + 4, (yv) >> 32);
-
-#endif /* !defined(_XPG4_2) || defined(__EXTENSIONS__) */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _SYS_BYTEORDER_H */
diff --git a/lib/libspl/include/os/freebsd/sys/fcntl.h b/lib/libspl/include/os/freebsd/sys/fcntl.h
deleted file mode 100644
index 64dd4d7ebe45..000000000000
--- a/lib/libspl/include/os/freebsd/sys/fcntl.h
+++ /dev/null
@@ -1,39 +0,0 @@
-// SPDX-License-Identifier: BSD-2-Clause
-/*
- * Copyright (c) 2021 iXsystems, Inc.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifndef _LIBSPL_SYS_FCNTL_H_
-#define _LIBSPL_SYS_FCNTL_H_
-
-#include_next <sys/fcntl.h>
-
-#define O_LARGEFILE 0
-#define O_RSYNC 0
-
-#ifndef O_DSYNC
-#define O_DSYNC 0
-#endif
-
-#endif /* _LIBSPL_SYS_FCNTL_H_ */
diff --git a/lib/libspl/include/os/freebsd/sys/file.h b/lib/libspl/include/os/freebsd/sys/file.h
deleted file mode 100644
index 75c3b23860bb..000000000000
--- a/lib/libspl/include/os/freebsd/sys/file.h
+++ /dev/null
@@ -1,35 +0,0 @@
-// SPDX-License-Identifier: CDDL-1.0
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or https://opensource.org/licenses/CDDL-1.0.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
- */
-
-#ifndef _LIBSPL_SYS_FILE_H
-#define _LIBSPL_SYS_FILE_H
-
-#include_next <sys/file.h>
-
-#define FIGNORECASE 0x80000 /* request case-insensitive lookups */
-
-#endif
diff --git a/lib/libspl/include/os/freebsd/sys/ia32/asm_linkage.h b/lib/libspl/include/os/freebsd/sys/ia32/asm_linkage.h
deleted file mode 100644
index f9c34d282d46..000000000000
--- a/lib/libspl/include/os/freebsd/sys/ia32/asm_linkage.h
+++ /dev/null
@@ -1,185 +0,0 @@
-// SPDX-License-Identifier: CDDL-1.0
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or https://opensource.org/licenses/CDDL-1.0.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
- */
-
-#ifndef _IA32_SYS_ASM_LINKAGE_H
-#define _IA32_SYS_ASM_LINKAGE_H
-
-#if defined(__linux__) && defined(CONFIG_SLS)
-#define RET ret; int3
-#else
-#define RET ret
-#endif
-
-/* Tell compiler to call assembler like Unix */
-#undef ASMABI
-#define ASMABI __attribute__((sysv_abi))
-
-#define ENDBR
-
-#define SECTION_TEXT .text
-#define SECTION_STATIC .section .rodata
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef _ASM /* The remainder of this file is only for assembly files */
-
-/*
- * make annoying differences in assembler syntax go away
- */
-
-/*
- * D16 and A16 are used to insert instructions prefixes; the
- * macros help the assembler code be slightly more portable.
- */
-#if !defined(__GNUC_AS__)
-/*
- * /usr/ccs/bin/as prefixes are parsed as separate instructions
- */
-#define D16 data16;
-#define A16 addr16;
-
-/*
- * (There are some weird constructs in constant expressions)
- */
-#define _CONST(const) [const]
-#define _BITNOT(const) -1!_CONST(const)
-#define _MUL(a, b) _CONST(a \* b)
-
-#else
-/*
- * Why not use the 'data16' and 'addr16' prefixes .. well, the
- * assembler doesn't quite believe in real mode, and thus argues with
- * us about what we're trying to do.
- */
-#define D16 .byte 0x66;
-#define A16 .byte 0x67;
-
-#define _CONST(const) (const)
-#define _BITNOT(const) ~_CONST(const)
-#define _MUL(a, b) _CONST(a * b)
-
-#endif
-
-/*
- * C pointers are different sizes between i386 and amd64.
- * These constants can be used to compute offsets into pointer arrays.
- */
-#if defined(__amd64)
-#define CLONGSHIFT 3
-#define CLONGSIZE 8
-#define CLONGMASK 7
-#elif defined(__i386)
-#define CLONGSHIFT 2
-#define CLONGSIZE 4
-#define CLONGMASK 3
-#endif
-
-/*
- * Since we know we're either ILP32 or LP64 ..
- */
-#define CPTRSHIFT CLONGSHIFT
-#define CPTRSIZE CLONGSIZE
-#define CPTRMASK CLONGMASK
-
-#if CPTRSIZE != (1 << CPTRSHIFT) || CLONGSIZE != (1 << CLONGSHIFT)
-#error "inconsistent shift constants"
-#endif
-
-#if CPTRMASK != (CPTRSIZE - 1) || CLONGMASK != (CLONGSIZE - 1)
-#error "inconsistent mask constants"
-#endif
-
-#define ASM_ENTRY_ALIGN 16
-
-/*
- * SSE register alignment and save areas
- */
-
-#define XMM_SIZE 16
-#define XMM_ALIGN 16
-
-/*
- * ENTRY provides the standard procedure entry code and an easy way to
- * insert the calls to mcount for profiling. ENTRY_NP is identical, but
- * never calls mcount.
- */
-#define ENTRY(x) \
- .text; \
- .balign ASM_ENTRY_ALIGN; \
- .globl x; \
-x: MCOUNT(x)
-
-#define ENTRY_NP(x) \
- .text; \
- .balign ASM_ENTRY_ALIGN; \
- .globl x; \
-x:
-
-#define ENTRY_ALIGN(x, a) \
- .text; \
- .balign a; \
- .globl x; \
-x:
-
-#define FUNCTION(x) \
- .type x, @function; \
-x:
-
-/*
- * ENTRY2 is identical to ENTRY but provides two labels for the entry point.
- */
-#define ENTRY2(x, y) \
- .text; \
- .balign ASM_ENTRY_ALIGN; \
- .globl x, y; \
-x:; \
-y: MCOUNT(x)
-
-#define ENTRY_NP2(x, y) \
- .text; \
- .balign ASM_ENTRY_ALIGN; \
- .globl x, y; \
-x:; \
-y:
-
-
-/*
- * SET_SIZE trails a function and set the size for the ELF symbol table.
- */
-#define SET_SIZE(x)
-
-#define SET_OBJ(x)
-
-#endif /* _ASM */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _IA32_SYS_ASM_LINKAGE_H */
diff --git a/lib/libspl/include/os/freebsd/sys/mnttab.h b/lib/libspl/include/os/freebsd/sys/mnttab.h
deleted file mode 100644
index e520bf5ef3bb..000000000000
--- a/lib/libspl/include/os/freebsd/sys/mnttab.h
+++ /dev/null
@@ -1,86 +0,0 @@
-// SPDX-License-Identifier: CDDL-1.0
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or https://opensource.org/licenses/CDDL-1.0.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
-/* All Rights Reserved */
-/*
- * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
- */
-/* Copyright 2006 Ricardo Correia */
-
-#ifndef _SYS_MNTTAB_H
-#define _SYS_MNTTAB_H
-
-#include <stdio.h>
-#include <sys/types.h>
-
-#ifdef MNTTAB
-#undef MNTTAB
-#endif /* MNTTAB */
-
-#include <paths.h>
-#include <sys/mount.h>
-#define MNTTAB _PATH_DEVZERO
-#define MS_NOMNTTAB 0x0
-#define MS_RDONLY 0x1
-#define umount2(p, f) unmount(p, f)
-#define MNT_LINE_MAX 4108
-
-#define MNT_TOOLONG 1 /* entry exceeds MNT_LINE_MAX */
-#define MNT_TOOMANY 2 /* too many fields in line */
-#define MNT_TOOFEW 3 /* too few fields in line */
-
-struct mnttab {
- char *mnt_special;
- char *mnt_mountp;
- char *mnt_fstype;
- char *mnt_mntopts;
-};
-
-/*
- * NOTE: fields in extmnttab should match struct mnttab till new fields
- * are encountered, this allows hasmntopt to work properly when its arg is
- * a pointer to an extmnttab struct cast to a mnttab struct pointer.
- */
-
-struct extmnttab {
- char *mnt_special;
- char *mnt_mountp;
- char *mnt_fstype;
- char *mnt_mntopts;
- uint_t mnt_major;
- uint_t mnt_minor;
-};
-
-struct stat64;
-struct statfs;
-
-extern int getmntany(FILE *fp, struct mnttab *mp, struct mnttab *mpref);
-extern int _sol_getmntent(FILE *fp, struct mnttab *mp);
-extern int getextmntent(const char *path, struct extmnttab *entry,
- struct stat64 *statbuf);
-extern void statfs2mnttab(struct statfs *sfs, struct mnttab *mp);
-extern char *hasmntopt(struct mnttab *mnt, const char *opt);
-extern int getmntent(FILE *fp, struct mnttab *mp);
-
-#endif
diff --git a/lib/libspl/include/os/freebsd/sys/mount.h b/lib/libspl/include/os/freebsd/sys/mount.h
deleted file mode 100644
index 231c250d3410..000000000000
--- a/lib/libspl/include/os/freebsd/sys/mount.h
+++ /dev/null
@@ -1,105 +0,0 @@
-// SPDX-License-Identifier: CDDL-1.0
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or https://opensource.org/licenses/CDDL-1.0.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
- */
-
-
-#ifndef _LIBSPL_SYS_MOUNT_H
-#define _LIBSPL_SYS_MOUNT_H
-
-#undef _SYS_MOUNT_H_
-#include_next <sys/mount.h>
-
-#include <assert.h>
-#include <string.h>
-#include <stdlib.h>
-
-#if !defined(BLKGETSIZE64)
-#define BLKGETSIZE64 DIOCGMEDIASIZE
-#endif
-
-/*
- * Some old glibc headers don't correctly define MS_DIRSYNC and
- * instead use the enum name S_WRITE. When using these older
- * headers define MS_DIRSYNC to be S_WRITE.
- */
-#if !defined(MS_DIRSYNC)
-#define MS_DIRSYNC S_WRITE
-#endif
-
-/*
- * Some old glibc headers don't correctly define MS_POSIXACL and
- * instead leave it undefined. When using these older headers define
- * MS_POSIXACL to the reserved value of (1<<16).
- */
-#if !defined(MS_POSIXACL)
-#define MS_POSIXACL (1<<16)
-#endif
-
-#define MS_NOSUID MNT_NOSUID
-#define MS_NOEXEC MNT_NOEXEC
-#define MS_NODEV 0
-#define S_WRITE 0
-#define MS_BIND 0
-#define MS_REMOUNT 0
-#define MS_SYNCHRONOUS MNT_SYNCHRONOUS
-
-#define MS_USERS (MS_NOEXEC|MS_NOSUID|MS_NODEV)
-#define MS_OWNER (MS_NOSUID|MS_NODEV)
-#define MS_GROUP (MS_NOSUID|MS_NODEV)
-#define MS_COMMENT 0
-
-/*
- * Older glibc <sys/mount.h> headers did not define all the available
- * umount2(2) flags. Both MNT_FORCE and MNT_DETACH are supported in the
- * kernel back to 2.4.11 so we define them correctly if they are missing.
- */
-#ifdef MNT_FORCE
-#define MS_FORCE MNT_FORCE
-#else
-#define MS_FORCE 0x00000001
-#endif /* MNT_FORCE */
-
-#ifdef MNT_DETACH
-#define MS_DETACH MNT_DETACH
-#else
-#define MS_DETACH 0x00000002
-#endif /* MNT_DETACH */
-
-/*
- * Overlay mount is default in Linux, but for solaris/zfs
- * compatibility, MS_OVERLAY is defined to explicitly have the user
- * provide a flag (-O) to mount over a non empty directory.
- */
-#define MS_OVERLAY 0x00000004
-
-/*
- * MS_CRYPT indicates that encryption keys should be loaded if they are not
- * already available. This is not defined in glibc, but it is never seen by
- * the kernel so it will not cause any problems.
- */
-#define MS_CRYPT 0x00000008
-
-#endif /* _LIBSPL_SYS_MOUNT_H */
diff --git a/lib/libspl/include/os/freebsd/sys/param.h b/lib/libspl/include/os/freebsd/sys/param.h
deleted file mode 100644
index 55fa1de0e8ff..000000000000
--- a/lib/libspl/include/os/freebsd/sys/param.h
+++ /dev/null
@@ -1,65 +0,0 @@
-// SPDX-License-Identifier: CDDL-1.0
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or https://opensource.org/licenses/CDDL-1.0.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
- */
-
-#ifndef _LIBSPL_SYS_PARAM_H
-#define _LIBSPL_SYS_PARAM_H
-
-#include_next <sys/param.h>
-#include <unistd.h>
-
-/*
- * File system parameters and macros.
- *
- * The file system is made out of blocks of at most MAXBSIZE units,
- * with smaller units (fragments) only in the last direct block.
- * MAXBSIZE primarily determines the size of buffers in the buffer
- * pool. It may be made larger without any effect on existing
- * file systems; however making it smaller may make some file
- * systems unmountable.
- *
- * Note that the blocked devices are assumed to have DEV_BSIZE
- * "sectors" and that fragments must be some multiple of this size.
- */
-#define MAXNAMELEN 256
-
-#define UID_NOACCESS 60002 /* user ID no access */
-
-#define MAXUID UINT32_MAX /* max user id */
-#define MAXPROJID MAXUID /* max project id */
-
-#ifdef PAGESIZE
-#undef PAGESIZE
-#endif /* PAGESIZE */
-
-extern size_t spl_pagesize(void);
-#define PAGESIZE (spl_pagesize())
-
-#ifndef HAVE_EXECVPE
-extern int execvpe(const char *name, char * const argv[], char * const envp[]);
-#endif
-
-#endif
diff --git a/lib/libspl/include/os/freebsd/sys/stat.h b/lib/libspl/include/os/freebsd/sys/stat.h
deleted file mode 100644
index 666f2ec6d760..000000000000
--- a/lib/libspl/include/os/freebsd/sys/stat.h
+++ /dev/null
@@ -1,90 +0,0 @@
-// SPDX-License-Identifier: CDDL-1.0
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or https://opensource.org/licenses/CDDL-1.0.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
- */
-
-#ifndef _LIBSPL_SYS_STAT_H
-#define _LIBSPL_SYS_STAT_H
-
-#include_next <sys/stat.h>
-
-/* Note: this file can be used on linux/macOS when bootstrapping tools. */
-
-#if defined(__FreeBSD__)
-#include <sys/mount.h> /* for BLKGETSIZE64 */
-
-#define stat64 stat
-
-#define MAXOFFSET_T OFF_MAX
-
-#ifndef _KERNEL
-#include <sys/disk.h>
-
-static __inline int
-fstat64(int fd, struct stat *sb)
-{
- int ret;
-
- ret = fstat(fd, sb);
- if (ret == 0) {
- if (S_ISCHR(sb->st_mode))
- (void) ioctl(fd, DIOCGMEDIASIZE, &sb->st_size);
- }
- return (ret);
-}
-#endif
-
-/*
- * Emulate Solaris' behavior of returning the block device size in fstat64().
- */
-static inline int
-fstat64_blk(int fd, struct stat64 *st)
-{
- if (fstat64(fd, st) == -1)
- return (-1);
-
- /* In Linux we need to use an ioctl to get the size of a block device */
- if (S_ISBLK(st->st_mode)) {
- if (ioctl(fd, BLKGETSIZE64, &st->st_size) != 0)
- return (-1);
- }
-
- return (0);
-}
-#endif /* defined(__FreeBSD__) */
-
-/*
- * Only Intel-based Macs have a separate stat64; Arm-based Macs are like
- * FreeBSD and have a full 64-bit stat from the start.
- *
- * On Linux, musl libc is full 64-bit too and has deprecated its own version
- * of these defines since version 1.2.4.
- */
-#if (defined(__APPLE__) && !(defined(__i386__) || defined(__x86_64__))) || \
- (defined(__linux__) && !defined(__GLIBC__))
-#define stat64 stat
-#define fstat64 fstat
-#endif
-
-#endif /* _LIBSPL_SYS_STAT_H */
diff --git a/lib/libspl/include/os/freebsd/sys/sysmacros.h b/lib/libspl/include/os/freebsd/sys/sysmacros.h
deleted file mode 100644
index d9639d27b60e..000000000000
--- a/lib/libspl/include/os/freebsd/sys/sysmacros.h
+++ /dev/null
@@ -1 +0,0 @@
-/* keep me */
diff --git a/lib/libspl/include/os/freebsd/sys/vfs.h b/lib/libspl/include/os/freebsd/sys/vfs.h
deleted file mode 100644
index 228ec5905240..000000000000
--- a/lib/libspl/include/os/freebsd/sys/vfs.h
+++ /dev/null
@@ -1,38 +0,0 @@
-// SPDX-License-Identifier: BSD-2-Clause
-/*
- * Copyright (c) 2020 iXsystems, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $FreeBSD$
- */
-
-#ifndef ZFS_SYS_VFS_H_
-#define ZFS_SYS_VFS_H_
-
-#include_next <sys/statvfs.h>
-
-int fsshare(const char *, const char *, const char *);
-int fsunshare(const char *, const char *);
-
-#endif /* !ZFS_SYS_VFS_H_ */
diff --git a/lib/libspl/include/os/freebsd/sys/zfs_context_os.h b/lib/libspl/include/os/freebsd/sys/zfs_context_os.h
deleted file mode 100644
index 1dd036d02ac6..000000000000
--- a/lib/libspl/include/os/freebsd/sys/zfs_context_os.h
+++ /dev/null
@@ -1,35 +0,0 @@
-// SPDX-License-Identifier: BSD-2-Clause
-/*
- * Copyright (c) 2020 iXsystems, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $FreeBSD$
- */
-
-#ifndef ZFS_CONTEXT_OS_H_
-#define ZFS_CONTEXT_OS_H_
-
-#define HAVE_LARGE_STACKS 1
-
-#endif