diff options
author | kfraser@dhcp93.uk.xensource.com <kfraser@dhcp93.uk.xensource.com> | 2006-06-28 16:15:36 +0100 |
---|---|---|
committer | kfraser@dhcp93.uk.xensource.com <kfraser@dhcp93.uk.xensource.com> | 2006-06-28 16:15:36 +0100 |
commit | 5de50eb18b7db6292daf2aaa6005d11806e1c996 (patch) | |
tree | b7738cd752daebaa4926a5553566cab0acd1b222 /xen/include/xen/lib.h | |
parent | bc6220c19962b7874ab0951572e5af8e82c85156 (diff) | |
download | xen-5de50eb18b7db6292daf2aaa6005d11806e1c996.tar.gz xen-5de50eb18b7db6292daf2aaa6005d11806e1c996.tar.bz2 xen-5de50eb18b7db6292daf2aaa6005d11806e1c996.zip |
[XEN] BUG() places console in sync mode.
Also move the BUG code out of line.
Original patch from Jimi Xenidis.
Signed-off-by: Keir Fraser <keir@xensource.com>
Diffstat (limited to 'xen/include/xen/lib.h')
-rw-r--r-- | xen/include/xen/lib.h | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/xen/include/xen/lib.h b/xen/include/xen/lib.h index 6cfe0dc217..e2c67a1d46 100644 --- a/xen/include/xen/lib.h +++ b/xen/include/xen/lib.h @@ -8,19 +8,23 @@ #include <xen/xmalloc.h> #include <xen/string.h> -#define BUG() do { \ - debugtrace_dump(); \ - printk("BUG at %s:%d\n", __FILE__, __LINE__); \ - FORCE_CRASH(); \ -} while ( 0 ) - +extern void __bug(char *file, int line) __attribute__((noreturn)); +#define BUG() __bug(__FILE__, __LINE__) #define BUG_ON(_p) do { if (_p) BUG(); } while ( 0 ) /* Force a compilation error if condition is true */ #define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2 * !!(condition)])) #ifndef NDEBUG -#define ASSERT(_p) { if ( !(_p) ) { printk("Assertion '%s' failed, line %d, file %s\n", #_p , __LINE__, __FILE__); BUG(); } } +#define ASSERT(_p) \ + do { \ + if ( !(_p) ) \ + { \ + printk("Assertion '%s' failed, line %d, file %s\n", #_p , \ + __LINE__, __FILE__); \ + BUG(); \ + } \ + } while ( 0 ) #else #define ASSERT(_p) ((void)0) #endif |