Move CRITICAL_ASSERT() macro to systm.h, where the critical(9)

functions are declared.
This commit is contained in:
Gleb Smirnoff 2013-04-06 08:23:38 +00:00
parent bae7bccf39
commit f7d97ffdc0
2 changed files with 6 additions and 3 deletions

View File

@ -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.

View File

@ -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.