diff options
author | Keir Fraser <keir@xen.org> | 2013-01-14 16:47:22 +0000 |
---|---|---|
committer | Keir Fraser <keir@xen.org> | 2013-01-14 16:47:22 +0000 |
commit | 836f8188f26db0148e6844d11c15edb66bec7b8f (patch) | |
tree | f584a68544af1198d58a7320fdcf75a38c598ea9 /xen/common/preempt.c | |
parent | bc9ae8b5d1e96ccdcf8d9bc9ed7907e7fafc9fe3 (diff) | |
download | xen-836f8188f26db0148e6844d11c15edb66bec7b8f.tar.gz xen-836f8188f26db0148e6844d11c15edb66bec7b8f.tar.bz2 xen-836f8188f26db0148e6844d11c15edb66bec7b8f.zip |
xen: Introduce ASSERT_NOT_IN_ATOMIC() to give more info on in_atomic() crash.
Signed-off-by: Keir Fraser <keir@xen.org>
Diffstat (limited to 'xen/common/preempt.c')
-rw-r--r-- | xen/common/preempt.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/xen/common/preempt.c b/xen/common/preempt.c index 38f73b023e..ec50dae224 100644 --- a/xen/common/preempt.c +++ b/xen/common/preempt.c @@ -31,8 +31,11 @@ bool_t in_atomic(void) return preempt_count() || in_irq() || !local_irq_is_enabled(); } -/* asm helper */ -void bug_if_in_atomic(void) +#ifndef NDEBUG +void ASSERT_NOT_IN_ATOMIC(void) { - BUG_ON(in_atomic()); + ASSERT(!preempt_count()); + ASSERT(!in_irq()); + ASSERT(local_irq_is_enabled()); } +#endif |