debuggers.hg

view xen/include/asm-x86/x86_64/bug.h @ 0:7d21f7218375

Exact replica of unstable on 051908 + README-this
author Mukesh Rathor
date Mon May 19 15:34:57 2008 -0700 (2008-05-19)
parents
children dec845b4d9c3
line source
1 #ifndef __X86_64_BUG_H__
2 #define __X86_64_BUG_H__
4 struct bug_frame_str {
5 unsigned char mov[2];
6 unsigned long str;
7 } __attribute__((packed));
8 #define BUG_MOV_STR "\x48\xbc"
10 #define dump_execution_state() \
11 asm volatile ( \
12 "ud2 ; ret $%c0" \
13 : : "i" (BUGFRAME_dump) )
15 #define WARN() \
16 asm volatile ( \
17 "ud2 ; ret $%c0 ; .byte 0x48,0xbc ; .quad %c1" \
18 : : "i" (BUGFRAME_warn | (__LINE__<<2)), \
19 "i" (__FILE__) )
21 #define BUG() \
22 asm volatile ( \
23 "ud2 ; ret $%c0 ; .byte 0x48,0xbc ; .quad %c1" \
24 : : "i" (BUGFRAME_bug | (__LINE__<<2)), \
25 "i" (__FILE__) )
27 #define assert_failed(p) \
28 asm volatile ( \
29 "ud2 ; ret $%c0 ; .byte 0x48,0xbc ; .quad %c1" \
30 " ; .byte 0x48,0xbc ; .quad %c2" \
31 : : "i" (BUGFRAME_assert | (__LINE__<<2)), \
32 "i" (__FILE__), "i" (#p) )
34 #endif /* __X86_64_BUG_H__ */