summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorglebius <glebius@FreeBSD.org>2013-04-06 08:23:38 +0000
committerglebius <glebius@FreeBSD.org>2013-04-06 08:23:38 +0000
commit5c569533aa1674bf866556c9dcb9b9ff376d65be (patch)
treed709d04ce0a807a9e75ec34aece1766e78aa4c2b
parente879e2e6e2e89a6d1693873adf8e83051c54a9b1 (diff)
downloadFreeBSD-src-5c569533aa1674bf866556c9dcb9b9ff376d65be.zip
FreeBSD-src-5c569533aa1674bf866556c9dcb9b9ff376d65be.tar.gz
Move CRITICAL_ASSERT() macro to systm.h, where the critical(9)
functions are declared.
-rw-r--r--sys/sys/proc.h3
-rw-r--r--sys/sys/systm.h6
2 files changed, 6 insertions, 3 deletions
diff --git a/sys/sys/proc.h b/sys/sys/proc.h
index f6cf2e4..4ce6f2d 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 61b4679..078f3cd 100644
--- a/sys/sys/systm.h
+++ b/sys/sys/systm.h
@@ -112,6 +112,12 @@ void kassert_panic(const char *fmt, ...);
((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.
* Otherwise, the kernel will deadlock since the scheduler isn't
OpenPOWER on IntegriCloud