From f7d97ffdc004b5409c93b4e69f83a7dc29a536c8 Mon Sep 17 00:00:00 2001 From: Gleb Smirnoff <glebius@FreeBSD.org> Date: Sat, 6 Apr 2013 08:23:38 +0000 Subject: [PATCH] Move CRITICAL_ASSERT() macro to systm.h, where the critical(9) functions are declared. --- sys/sys/proc.h | 3 --- sys/sys/systm.h | 6 ++++++ 2 files changed, 6 insertions(+), 3 deletions(-) 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.