Page MenuHomeFreeBSD

D26543.id77471.diff
No OneTemporary

D26543.id77471.diff

Index: sys/sys/systm.h
===================================================================
--- sys/sys/systm.h
+++ sys/sys/systm.h
@@ -47,6 +47,7 @@
#include <sys/queue.h>
#include <sys/stdint.h> /* for people using printf mainly */
+#ifdef _KERNEL
__NULLABILITY_PRAGMA_PUSH
extern int cold; /* nonzero if we are doing a cold boot */
@@ -99,6 +100,7 @@
#define kassert_panic panic
#endif
#endif
+#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
@@ -629,4 +630,5 @@
__NULLABILITY_PRAGMA_POP
+#endif
#endif /* !_SYS_SYSTM_H_ */

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
33212110
Default Alt Text
D26543.id77471.diff (1 KB)

Event Timeline