summaryrefslogtreecommitdiff
path: root/include/os/freebsd/spl/sys/sysmacros.h
diff options
context:
space:
mode:
authorMatt Macy <mmacy@FreeBSD.org>2020-10-17 00:05:34 +0000
committerMatt Macy <mmacy@FreeBSD.org>2020-10-17 00:05:34 +0000
commit0be360124f8f108f73365e31448e7550f877f3ac (patch)
tree78557e980720fdcfd76497e6630c29ce1688559c /include/os/freebsd/spl/sys/sysmacros.h
parente2228bd99047bb6a0cef0da931147b1f28f155c2 (diff)
Notes
Diffstat (limited to 'include/os/freebsd/spl/sys/sysmacros.h')
-rw-r--r--include/os/freebsd/spl/sys/sysmacros.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/include/os/freebsd/spl/sys/sysmacros.h b/include/os/freebsd/spl/sys/sysmacros.h
index 5afca10447e7..2d0164cb129f 100644
--- a/include/os/freebsd/spl/sys/sysmacros.h
+++ b/include/os/freebsd/spl/sys/sysmacros.h
@@ -31,6 +31,7 @@
#define _SYS_SYSMACROS_H
#include <sys/param.h>
+#include <sys/systm.h>
#include <sys/isa_defs.h>
#include <sys/libkern.h>
#include <sys/zone.h>
@@ -71,7 +72,11 @@ extern "C" {
#define DIV_ROUND_UP(n, d) (((n) + (d) - 1) / (d))
#endif
+#ifdef _STANDALONE
+#define boot_ncpus 1
+#else /* _STANDALONE */
#define boot_ncpus mp_ncpus
+#endif /* _STANDALONE */
#define kpreempt_disable() critical_enter()
#define kpreempt_enable() critical_exit()
#define CPU_SEQID curcpu
@@ -319,7 +324,7 @@ extern unsigned char bcd_to_byte[256];
/* avoid any possibility of clashing with <stddef.h> version */
-#define offsetof(s, m) ((size_t)(&(((s *)0)->m)))
+#define offsetof(type, field) __offsetof(type, field)
#endif
/*