ia64/xen-unstable

view xen/include/asm-x86/x86_32/bug.h @ 14054:43e9952b07ea

x86: Better BUG() and ASSERT() logging.
Signed-off-by: Keir Fraser <keir@xensource.com>
author kfraser@localhost.localdomain
date Wed Feb 21 14:40:37 2007 +0000 (2007-02-21)
parents 4990b2236f06
children 070cf119a7ec
line source
1 #ifndef __X86_32_BUG_H__
2 #define __X86_32_BUG_H__
4 struct bug_frame_str {
5 unsigned char mov[1];
6 unsigned long str;
7 } __attribute__((packed));
8 #define BUG_MOV_STR "\xbc"
10 #define dump_execution_state() \
11 asm volatile ( \
12 "ud2 ; ret $%c0" \
13 : : "i" (BUGFRAME_dump) )
15 #define BUG() \
16 asm volatile ( \
17 "ud2 ; ret $%c0 ; .byte 0xbc ; .long %c1" \
18 : : "i" (BUGFRAME_bug | (__LINE__<<2)), \
19 "i" (__FILE__) )
21 #define assert_failed(p) \
22 asm volatile ( \
23 "ud2 ; ret $%c0 ; .byte 0xbc ; .long %c1" \
24 " ; .byte 0xbc ; .long %c2" \
25 : : "i" (BUGFRAME_assert | (__LINE__<<2)), \
26 "i" (__FILE__), "i" (#p) )
28 #endif /* __X86_32_BUG_H__ */