/*********************************************************
- * Copyright (C) 2008-2018 VMware, Inc. All rights reserved.
+ * Copyright (C) 2008-2018, 2023 VMware, Inc. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published
} DynXdrData;
/*
- * FreeBSD < 5.0 and Solaris do not declare some parameters as "const".
+ * Solaris does not declare some parameters as "const".
*/
-#if defined(sun) || (defined(__FreeBSD__) && __FreeBSD_version < 500000)
+#if defined(sun)
# define DYNXDR_CONST
#else
# define DYNXDR_CONST const
/*********************************************************
- * Copyright (C) 2006-2021 VMware, Inc. All rights reserved.
+ * Copyright (C) 2006-2021, 2023 VMware, Inc. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published
#if defined(__FreeBSD__)
/*
* FreeBSD: All supported versions have timestamps with nanosecond
- * resolution. FreeBSD 5+ has also file creation time.
+ * resolution.
*/
-# if defined(__FreeBSD_version) && __FreeBSD_version >= 500043
*createTime = TimeUtil_UnixTimeToNtTime(statBuf.st_birthtimespec);
-# endif
*accessTime = TimeUtil_UnixTimeToNtTime(statBuf.st_atimespec);
*writeTime = TimeUtil_UnixTimeToNtTime(statBuf.st_mtimespec);
*attrChangeTime = TimeUtil_UnixTimeToNtTime(statBuf.st_ctimespec);
/*********************************************************
- * Copyright (C) 1998-2021 VMware, Inc. All rights reserved.
+ * Copyright (C) 1998-2023 VMware, Inc. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published
#endif
-#if defined(sun) || defined(__linux__) || \
- (defined(__FreeBSD_version) && __FreeBSD_version < 490000)
+#if defined(sun) || defined(__linux__)
/*
- * Implements futimes(), which was introduced in glibc 2.3.3. FreeBSD 3.2
- * doesn't have it, but 4.9 does. Unfortunately, these early FreeBSD versions
- * don't have /proc/self, so futimes() will simply fail. For now the only
- * caller to futimes() is HgfsServerSetattr which doesn't get invoked at all
- * in the HGFS server which runs in the Tools, so it's OK.
+ * Implements futimes(), which was introduced in glibc 2.3.3.
+ * For now the only caller to futimes() is HgfsServerSetattr which doesn't get
+ * invoked at all in the HGFS server which runs in the Tools.
*/
#define PROC_SELF_FD "/proc/self/fd/"
#define STRLEN_OF_MAXINT_AS_STRING 10
{
uint64 creationTime;
/*
- * Linux and FreeBSD before v5 doesn't know about creation time; we just use the time
+ * Linux doesn't know about creation time; we just use the time
* of last data modification for the creation time.
- * FreeBSD 5+ supprots file creation time.
+ * FreeBSD 5+ supports file creation time.
*
* Using mtime when creation time is unavailable to be consistent with SAMBA.
*/
#ifdef __FreeBSD__
/*
- * FreeBSD: All supported versions have timestamps with nanosecond resolution.
- * FreeBSD 5+ has also file creation time.
+ * FreeBSD: All supported versions have timestamps with nanosecond resolution
+ * and have file creation time.
*/
-# if __IS_FREEBSD_VER__(500043)
creationTime = HgfsConvertTimeSpecToNtTime(&stats->st_birthtimespec);
-# else
- creationTime = HgfsConvertTimeSpecToNtTime(&stats->st_mtimespec);
-# endif
#elif defined(__linux__)
/*
* Linux: Glibc 2.3+ has st_Xtim. Glibc 2.1/2.2 has st_Xtime/__unusedX on
#ifdef __FreeBSD__
/*
- * FreeBSD: All supported versions have timestamps with nanosecond resolution.
- * FreeBSD 5+ has also file creation time.
+ * FreeBSD: All supported versions have timestamps with nanosecond resolution
+ * and have file creation time.
*/
attr->accessTime = HgfsConvertTimeSpecToNtTime(&stats->st_atimespec);
attr->writeTime = HgfsConvertTimeSpecToNtTime(&stats->st_mtimespec);
attr->specialPerms, attr->ownerPerms, attr->groupPerms,
attr->otherPerms, attr->size);
#ifdef __FreeBSD__
-# if !defined(VM_X86_64) && !defined(VM_ARM_64) && __FreeBSD_version >= 500043
+# if !defined(VM_X86_64) && !defined(VM_ARM_64)
# define FMTTIMET ""
# else
# define FMTTIMET "l"
/*********************************************************
- * Copyright (C) 2003-2022 VMware, Inc. All rights reserved.
+ * Copyright (C) 2003-2023 VMware, Inc. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published
#include "includeCheck.h"
#include "vm_basic_types.h" // For INLINE.
-/* Checks for FreeBSD, filtering out VMKERNEL. */
-#if !defined(VMKERNEL) && defined(__FreeBSD__)
-#define __IS_FREEBSD__ 1
-#else
-#define __IS_FREEBSD__ 0
-#endif
-#define __IS_FREEBSD_VER__(ver) (__IS_FREEBSD__ && __FreeBSD_version >= (ver))
-
/*
* <stddef.h> provides definitions for:
* NULL, offsetof
/*********************************************************
- * Copyright (C) 1998-2022 VMware, Inc. All rights reserved.
+ * Copyright (C) 1998-2023 VMware, Inc. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published
#if !defined(USING_AUTOCONF)
# if defined(__FreeBSD__) || defined(sun)
# ifndef KLD_MODULE
-# if __FreeBSD_version >= 500043
+# if defined(__FreeBSD__)
# if !defined(VMKERNEL)
# include <inttypes.h>
# endif
-# else
+# else /* sun */
# include <sys/inttypes.h>
# endif
# endif
/*********************************************************
- * Copyright (C) 1998-2022 VMware, Inc. All rights reserved.
+ * Copyright (C) 1998-2023 VMware, Inc. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published
uid_t euid, // IN: new effective uid
uid_t suid) // IN: new saved uid
{
-#if (defined(__FreeBSD__) && __FreeBSD_version >= 500043)
+#if defined(__FreeBSD__)
return setresuid(uid, euid, suid);
#elif defined(__linux__)
if (uid32) {
gid_t egid, // IN: new effective gid
gid_t sgid) // IN: new saved gid
{
-#if (defined(__FreeBSD__) && __FreeBSD_version >= 500043)
+#if defined(__FreeBSD__)
return setresgid(gid, egid, sgid);
#elif defined(__linux__)
if (uid32) {
/*********************************************************
- * Copyright (C) 1998-2019, 2021 VMware, Inc. All rights reserved.
+ * Copyright (C) 1998-2019, 2021-2023 VMware, Inc. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published
return (strcmp(path1, path2) == 0);
#elif defined(_WIN32)
return (_stricmp(path1, path2) == 0);
-#elif defined(__APPLE__)
+#elif defined(__APPLE__) || defined(__FreeBSD__)
return (strcasecmp(path1, path2) == 0);
#else
NOT_IMPLEMENTED();
/*********************************************************
- * Copyright (C) 1998-2018 VMware, Inc. All rights reserved.
+ * Copyright (C) 1998-2018, 2023 VMware, Inc. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published
* glibc >= 2.2. I.e., even though they should be able to work on
* FreeBSD 5.0+ and Solaris 8+, they aren't made available there.
*/
-# if !(defined(__linux__) || \
- (defined(__FreeBSD__) && (__FreeBSD_version >= 500000)) || \
- defined(sun))
+# if !(defined(__linux__) || defined(__FreeBSD__) || defined(sun))
extern int vswprintf(wchar_t *wcs, size_t maxlen, const wchar_t *format, va_list args);
# endif
#endif // _WIN32
/*********************************************************
- * Copyright (C) 2006-2021 VMware, Inc. All rights reserved.
+ * Copyright (C) 2006-2021, 2023 VMware, Inc. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published
#else
do {
int signals[] = {
+#if defined(__FreeBSD__)
+ SIGBUS,
+#endif
SIGILL,
SIGSEGV,
};
/*********************************************************
- * Copyright (C) 2004-2019, 2021 VMware, Inc. All rights reserved.
+ * Copyright (C) 2004-2019, 2021-2023 VMware, Inc. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published
# include <sys/ucred.h>
# include <sys/mount.h>
# include <fstab.h>
-# if defined(__FreeBSD_version) && __FreeBSD_version >= 500000
-# include <libgen.h>
-# endif /* __FreeBSD_version >= 500000 */
+#endif
+#if defined(__FreeBSD__)
+#include <libgen.h>
#endif
#include <unistd.h>
* function, as a whole, does not even apply to OS X, so this caveat is
* only minor.
*/
-#if __FreeBSD_version < 500000
- /*
- * Before FreeBSD 5, device nodes had static major/minor numbers.
- * (FreeBSD 5 included devfs which got rid of this concept.) So
- * we'll stat(2) the mount source and test its major numbers
- * against the values lifted from
- * http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/i386/conf/Attic/majors.i386 (rev 1.65)
- *
- * Devnode Type Description Major
- * ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- * block "Winchester" (IDE, ATA, /dev/wd*) 0
- * character " 3
- * block SCSI "direct access" (/dev/da*) 4
- * character " 13
- */
- int maj = major(s->st_rdev);
- if ((S_ISBLK(s->st_mode) && ((maj == 0) || (maj == 4))) ||
- (S_ISCHR(s->st_mode) && ((maj == 3) || (maj == 13)))) {
- retval = TRUE;
- }
-#else
/*
* Begin by testing whether file system source is really a character
* device node. (FreeBSD dropped support for block devices long ago.)
}
#undef MASK_ATA_DISK
#undef MASK_SCSI_DISK
-#endif /* __FreeBSD_version */
return retval;
}
/*********************************************************
- * Copyright (C) 2008 VMware, Inc. All rights reserved.
+ * Copyright (C) 2008, 2023 VMware, Inc. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* FreeBSD version 8 and above uses the kproc API instead of the kthread API in its
* kernel.
*/
-#if __FreeBSD_version > 800001
#define compat_kthread_create kproc_create
#define compat_kthread_exit kproc_exit
-#else
-#define compat_kthread_create kthread_create
-#define compat_kthread_exit kthread_exit
-#endif
#endif // __COMPAT_FREEBSD_H__
/*********************************************************
- * Copyright (C) 2009 VMware, Inc. All rights reserved.
+ * Copyright (C) 2009, 2023 VMware, Inc. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
#ifndef __COMPAT_MOUNT_H__
# define __COMPAT_MOUNT_H__ 1
-#if __FreeBSD_version >= 800011
#define COMPAT_VFS_STATFS(mp, sbp, threadvar) VFS_STATFS((mp), (sbp))
#define compat_td curthread
-#else
-#define COMPAT_VFS_STATFS(mp, sbp, threadvar) VFS_STATFS((mp), (sbp), (threadvar))
-#define compat_td td
-#endif
#endif
/*********************************************************
- * Copyright (C) 2009 VMware, Inc. All rights reserved.
+ * Copyright (C) 2009, 2023 VMware, Inc. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
#ifndef __COMPAT_PRIV_H__
# define __COMPAT_PRIV_H__ 1
-#if __FreeBSD_version >= 800011
#define compat_priv_check(td, priv) priv_check((td), (priv))
-#else
-#define compat_priv_check(td, priv) suser(td)
-#endif
#endif
/*********************************************************
- * Copyright (C) 2008, 2020 VMware, Inc. All rights reserved.
+ * Copyright (C) 2008, 2020, 2023 VMware, Inc. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
#ifndef __COMPAT_VOP_H__
# define __COMPAT_VOP_H__ 1
-#if __FreeBSD_version >= 800011
#define COMPAT_THREAD_VAR(varname, varval)
#define COMPAT_VOP_LOCK(vop, flags, threadvar) VOP_LOCK((vop), (flags))
#if __FreeBSD_version >= 1300074
#define compat_vn_lock(vp, flags, threadval) vn_lock((vp), (flags))
#define compat_accmode_t accmode_t
#define compat_a_accmode a_accmode
-#else
-#define COMPAT_THREAD_VAR(varname, varval) struct thread *varname = varval
-#define COMPAT_VOP_LOCK(vop, flags, threadvar) VOP_LOCK((vop), (flags), (threadvar))
-#define COMPAT_VOP_UNLOCK(vop, flags, threadvar) VOP_UNLOCK((vop), (flags), (threadvar))
-#define compat_lockstatus(lock, threadvar) lockstatus((lock), (threadvar))
-#define compat_vn_lock(vp, flags, threadval) vn_lock((vp), (flags), (threadval))
-#define compat_lockmgr(lock, flags, randompointerparam, threadval) lockmgr((lock), (flags), (randompointerparam), (threadval))
-#define compat_accmode_t mode_t
-#define compat_a_accmode a_mode
-#endif
/*
* We use defines rather than typedefs here to avoid causing problems for files that
* don't have a vnode_if.h available.
*/
-#if __FreeBSD_version >= 700055
-# define compat_vop_lock_t vop_lock1_t
-# define compat_vop_lock_args struct vop_lock1_args
-# define COMPAT_VOP_LOCK_OP_ELEMENT vop_lock1
-#else
-# define compat_vop_lock_t vop_lock_t
-# define compat_vop_lock_args struct vop_lock_args
-# define COMPAT_VOP_LOCK_OP_ELEMENT vop_lock
-#endif
+#define compat_vop_lock_t vop_lock1_t
+#define compat_vop_lock_args struct vop_lock1_args
+#define COMPAT_VOP_LOCK_OP_ELEMENT vop_lock1
#endif
#!/usr/bin/make -f
##########################################################
-# Copyright (C) 2006-2018 VMware, Inc. All rights reserved.
+# Copyright (C) 2006-2018, 2023 VMware, Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
KMOD = vmblock
PROG = ../$(KMOD).ko
-NOMAN = t
-NO_MAN = t
+MK_MAN = no
KLDMOD = t
VMBLOCK := $(MAINSRCROOT)/modules/vmblock
/* **********************************************************
- * Copyright 2007-2014 VMware, Inc. All rights reserved.
+ * Copyright 2007-2014, 2023 VMware, Inc. All rights reserved.
* **********************************************************/
/*
*-----------------------------------------------------------------------------
*/
-#if __FreeBSD_version >= 700055
static void
VMBlockInsMntQueDtr(struct vnode *vp, // IN: node to cleanup
void *xp) // IN: FS private data
vgone(vp);
vput(vp);
}
-#endif
/*
panic("VMBlockNodeGet: Passed a NULL vnlock.\n");
}
- /* Before FreeBSD 7, insmntque was called by getnewvnode. */
-#if __FreeBSD_version >= 700055
+#if __FreeBSD_version >= 1400051
+ error = insmntque1(vp, mp);
+ if (error != 0) {
+ VMBlockInsMntQueDtr(vp, xp);
+ return error;
+ }
+#else
error = insmntque1(vp, mp, VMBlockInsMntQueDtr, xp);
if (error != 0) {
return error;
/* **********************************************************
- * Copyright 2007-2014 VMware, Inc. All rights reserved.
+ * Copyright 2007-2014, 2023 VMware, Inc. All rights reserved.
* **********************************************************/
/*
*/
static int
-#if __FreeBSD_version >= 800011
VMBlockVFSMount(struct mount *mp) // IN: mount(2) parameters
-#else
-VMBlockVFSMount(struct mount *mp, // IN: mount(2) parameters
- struct thread *td) // IN: caller's thread context
-#endif
{
struct VMBlockMount *xmp;
struct nameidata nd, *ndp = &nd;
* Find lower node and lock if not already locked.
*/
+#if __FreeBSD_version >= 1400043
+ NDINIT(ndp, LOOKUP, FOLLOW|LOCKLEAF, UIO_SYSSPACE, target);
+#else
NDINIT(ndp, LOOKUP, FOLLOW|LOCKLEAF, UIO_SYSSPACE, target, compat_td);
+#endif
error = namei(ndp);
if (error) {
NDFREE(ndp, 0);
uma_zfree(VMBlockPathnameZone, pathname);
return error;
}
+#ifdef NDF_ONLY_PNBUF
NDFREE(ndp, NDF_ONLY_PNBUF);
+#else
+ NDFREE_PNBUF(ndp);
+#endif
/*
* Check multi VMBlock mount to avoid `lock against myself' panic.
*/
MNT_ILOCK(mp);
mp->mnt_flag |= lowerrootvp->v_mount->mnt_flag & MNT_LOCAL;
-#if __FreeBSD_version >= 600000 && __FreeBSD_version < 1000000
- mp->mnt_kern_flag |= lowerrootvp->v_mount->mnt_kern_flag & MNTK_MPSAFE;
-#endif
MNT_IUNLOCK(mp);
mp->mnt_data = (qaddr_t) xmp;
*/
static int
-#if __FreeBSD_version >= 800011
VMBlockVFSUnmount(struct mount *mp, // IN: filesystem to unmount
int mntflags) // IN: unmount(2) flags (ex: MNT_FORCE)
-#else
-VMBlockVFSUnmount(struct mount *mp, // IN: filesystem to unmount
- int mntflags, // IN: unmount(2) flags (ex: MNT_FORCE)
- struct thread *td) // IN: caller's kernel thread context
-#endif
{
struct VMBlockMount *xmp;
struct vnode *vp;
*/
static int
-#if __FreeBSD_version >= 800011
VMBlockVFSRoot(struct mount *mp, // IN: vmblock file system
int flags, // IN: lockmgr(9) flags
struct vnode **vpp) // OUT: root vnode
-#else
-VMBlockVFSRoot(struct mount *mp, // IN: vmblock file system
- int flags, // IN: lockmgr(9) flags
- struct vnode **vpp, // OUT: root vnode
- struct thread *td) // IN: caller's thread context
-#endif
{
struct vnode *vp;
*/
static int
-#if __FreeBSD_version >= 800011
VMBlockVFSStatFS(struct mount *mp, // IN: vmblock file system
struct statfs *sbp) // OUT: statfs(2) arg container
-#else
-VMBlockVFSStatFS(struct mount *mp, // IN: vmblock file system
- struct statfs *sbp, // OUT: statfs(2) arg container
- struct thread *td) // IN: caller's thread context
-#endif
{
int error;
struct statfs mstat;
*/
static int
-#if __FreeBSD_version >= 800011
VMBlockVFSSync(struct mount *mp, // Ignored
int waitfor) // Ignored
-#else
-VMBlockVFSSync(struct mount *mp, // Ignored
- int waitfor, // Ignored
- struct thread *td) // Ignored
-#endif
{
return 0;
}
/* **********************************************************
- * Copyright 2007-2014, 2020 VMware, Inc. All rights reserved.
+ * Copyright 2007-2014, 2020, 2023 VMware, Inc. All rights reserved.
* **********************************************************/
/*
#include <sys/filedesc.h>
#include <sys/kdb.h>
#include "compat_freebsd.h"
-#if __FreeBSD_version >= 700055
#include <sys/priv.h>
-#endif
#include "vmblock_k.h"
#include "vmblock.h"
struct vop_vector VMBlockVnodeOps = {
.vop_bypass = VMBlockVopBypass,
.vop_access = VMBlockVopAccess,
-#if __FreeBSD_version >= 900013
.vop_advlockpurge = vop_stdadvlockpurge,
-#endif
.vop_bmap = VOP_EOPNOTSUPP,
.vop_getattr = VMBlockVopGetAttr,
.vop_getwritemount = VMBlockVopGetWriteMount,
* because none of the existing privs seemed to match very well.
*/
if ((retval = compat_priv_check(ap->a_td, PRIV_DRIVER)) == 0) {
-#if __FreeBSD_version >= 700055
fp = ap->a_fp;
-#else
- fp = ap->a_td->td_proc->p_fd->fd_ofiles[ap->a_fdidx];
-#endif
fp->f_ops = &VMBlockFileOps;
}
} else {
*/
{
struct vnode *vp = ap->a_vp;
-#if __FreeBSD_version < 1000000
- struct thread *td = ap->a_td;
-#endif
vp->v_object = NULL;
* If this is the last reference, then free up the vnode so as not to
* tie up the lower vnode.
*/
-#if __FreeBSD_version < 1000000
- vrecycle(vp, td);
-#else
vrecycle(vp);
-#endif
return 0;
}
#!/usr/bin/make -f
##########################################################
-# Copyright (C) 2007-2018, 2021 VMware, Inc. All rights reserved.
+# Copyright (C) 2007-2018, 2021, 2023 VMware, Inc. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
.endif
KMOD = vmmemctl
PROG = ../$(KMOD).ko
-NOMAN = t
-NO_MAN = t
+MK_MAN = no
KLDMOD = t
# Don't print a warning that the object dir wasn't specified
/*********************************************************
- * Copyright (C) 2000,2014,2018-2021 VMware, Inc. All rights reserved.
+ * Copyright (C) 2000,2014,2018-2021,2023 VMware, Inc. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
MALLOC_DEFINE(M_VMMEMCTL, BALLOON_NAME, "vmmemctl metadata");
/*
- * FreeBSD version specific MACROS
+ * FreeBSD specific MACROS
*/
-#if __FreeBSD_version >= 900000
- #define VM_PAGE_LOCK(page) vm_page_lock(page);
- #define VM_PAGE_UNLOCK(page) vm_page_unlock(page)
-#else
- #define VM_PAGE_LOCK(page) vm_page_lock_queues()
- #define VM_PAGE_UNLOCK(page) vm_page_unlock_queues()
-#endif
+#define VM_PAGE_LOCK(page) vm_page_lock(page);
+#define VM_PAGE_UNLOCK(page) vm_page_unlock(page)
-#if __FreeBSD_version > 1000029
- #define VM_OBJ_LOCK(object) VM_OBJECT_WLOCK(object)
- #define VM_OBJ_UNLOCK(object) VM_OBJECT_WUNLOCK(object);
-#else
- #define VM_OBJ_LOCK(object) VM_OBJECT_LOCK(object);
- #define VM_OBJ_UNLOCK(object) VM_OBJECT_UNLOCK(object);
-#endif
+#define VM_OBJ_LOCK(object) VM_OBJECT_WLOCK(object)
+#define VM_OBJ_UNLOCK(object) VM_OBJECT_WUNLOCK(object);
-#if __FreeBSD_version < 1100015
- #define VM_SYS_PAGES cnt.v_page_count
-#else
- #define VM_SYS_PAGES vm_cnt.v_page_count
-#endif
+#define VM_SYS_PAGES vm_cnt.v_page_count
-/*
- * The kmem_malloc() and kmem_free() APIs changed at different times during
- * the FreeBSD 12.0 ALPHA snapshot releases. The difference in the
- * __FreeBSD_version values for FreeBSD 12.0 in the following macros are
- * consistent with when each API was changed.
- */
-#if __FreeBSD_version < 1000000
- #define KVA_ALLOC(size) kmem_alloc_nofault(kernel_map, size)
- #define KVA_FREE(offset, size) kmem_free(kernel_map, offset, size)
-#else
- #define KVA_ALLOC(size) kva_alloc(size);
- #define KVA_FREE(offset, size) kva_free(offset, size)
-#endif
+#define KVA_ALLOC(size) kva_alloc(size);
+#define KVA_FREE(offset, size) kva_free(offset, size)
-#if __FreeBSD_version < 1000000
- #define KMEM_ALLOC(size) kmem_alloc(kernel_map, size)
-#elif __FreeBSD_version < 1200080
- #define KMEM_ALLOC(size) kmem_malloc(kernel_arena, size, M_WAITOK | M_ZERO)
-#else
- #define KMEM_ALLOC(size) kmem_malloc(size, M_WAITOK | M_ZERO)
-#endif
-
-#if __FreeBSD_version < 1000000
- #define KMEM_FREE(offset, size) kmem_free(kernel_map, offset, size)
-#elif __FreeBSD_version < 1200083
- #define KMEM_FREE(offset, size) kmem_free(kernel_arena, offset, size)
-#else
- #define KMEM_FREE(offset, size) kmem_free(offset, size)
-#endif
+#define KMEM_ALLOC(size) kmem_malloc(size, M_WAITOK | M_ZERO)
+#define KMEM_FREE(offset, size) kmem_free(offset, size)
/*
* Globals