Page MenuHomeFreeBSD

D26543.id77485.diff
No OneTemporary

D26543.id77485.diff

Index: sys/sys/systm.h
===================================================================
--- sys/sys/systm.h
+++ sys/sys/systm.h
@@ -49,6 +49,7 @@
__NULLABILITY_PRAGMA_PUSH
+#ifdef _KERNEL
extern int cold; /* nonzero if we are doing a cold boot */
extern int suspend_blocked; /* block suspend due to pending shutdown */
extern int rebooting; /* kern_reboot() has been called. */
@@ -97,8 +98,9 @@
void kassert_panic(const char *fmt, ...) __printflike(1, 2);
#else
#define kassert_panic panic
-#endif
-#endif
+#endif /* KASSERT_PANIC_OPTIONAL */
+#endif /* defined(WITNESS) || defined(INVARIANT_SUPPORT) */
+#endif /* KERNEL */
#ifdef INVARIANTS /* The option is always available */
#define KASSERT(exp,msg) do { \
@@ -135,12 +137,6 @@
#define CTASSERT(x) _Static_assert(x, "compile-time assertion failed")
#endif
-#if defined(_KERNEL)
-#include <sys/param.h> /* MAXCPU */
-#include <sys/pcpu.h> /* curthread */
-#include <sys/kpilite.h>
-#endif
-
/*
* Helpful macros for quickly coming up with assertions with informative
* panic messages.
@@ -151,6 +147,18 @@
#define MPASS4(ex, what, file, line) \
KASSERT((ex), ("Assertion %s failed at %s:%d", what, file, line))
+/*
+ * Align variables.
+ */
+#define __read_mostly __section(".data.read_mostly")
+#define __read_frequently __section(".data.read_frequently")
+#define __exclusive_cache_line __aligned(CACHE_LINE_SIZE) \
+ __section(".data.exclusive_cache_line")
+#ifdef _KERNEL
+#include <sys/param.h> /* MAXCPU */
+#include <sys/pcpu.h> /* curthread */
+#include <sys/kpilite.h>
+
/*
* Assert that a pointer can be loaded from memory atomically.
*
@@ -180,13 +188,6 @@
})
#define SCHEDULER_STOPPED() SCHEDULER_STOPPED_TD(curthread)
-/*
- * Align variables.
- */
-#define __read_mostly __section(".data.read_mostly")
-#define __read_frequently __section(".data.read_frequently")
-#define __exclusive_cache_line __aligned(CACHE_LINE_SIZE) \
- __section(".data.exclusive_cache_line")
/*
* XXX the hints declarations are even more misplaced than most declarations
* in this file, since they are needed in one file (per arch) and only used
@@ -626,6 +627,7 @@
#endif
#define gone_in(major, msg) __gone_ok(major, msg) _gone_in(major, msg)
#define gone_in_dev(dev, major, msg) __gone_ok(major, msg) _gone_in_dev(dev, major, msg)
+#endif /* _KERNEL */
__NULLABILITY_PRAGMA_POP

File Metadata

Mime Type
text/plain
Expires
Sun, May 17, 9:58 PM (18 h, 17 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
33212126
Default Alt Text
D26543.id77485.diff (2 KB)

Event Timeline