diff --git a/sys/sys/proc.h b/sys/sys/proc.h index f6cf2e4d6658..4ce6f2d54abf 100644 --- a/sys/sys/proc.h +++ b/sys/sys/proc.h @@ -341,9 +341,6 @@ do { \ #define THREAD_LOCKPTR_ASSERT(td, lock) #endif -#define CRITICAL_ASSERT(td) \ - KASSERT((td)->td_critnest >= 1, ("Not in critical section")); - /* * Flags kept in td_flags: * To change these you MUST have the scheduler lock. diff --git a/sys/sys/systm.h b/sys/sys/systm.h index 61b467936ec3..078f3cdc60e3 100644 --- a/sys/sys/systm.h +++ b/sys/sys/systm.h @@ -111,6 +111,12 @@ void kassert_panic(const char *fmt, ...); KASSERT(sizeof(var) == sizeof(void *) && \ ((uintptr_t)&(var) & (sizeof(void *) - 1)) == 0, msg) +/* + * Assert that a thread is in critical(9) section. + */ +#define CRITICAL_ASSERT(td) \ + KASSERT((td)->td_critnest >= 1, ("Not in critical section")); + /* * If we have already panic'd and this is the thread that called * panic(), then don't block on any mutexes but silently succeed.