Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | #ifndef __ASM_X8664_BUG_H |
| 2 | #define __ASM_X8664_BUG_H 1 |
| 3 | |
| 4 | #include <linux/stringify.h> |
| 5 | |
| 6 | /* |
| 7 | * Tell the user there is some problem. The exception handler decodes |
| 8 | * this frame. |
| 9 | */ |
| 10 | struct bug_frame { |
| 11 | unsigned char ud2[2]; |
| 12 | /* should use 32bit offset instead, but the assembler doesn't |
| 13 | like it */ |
| 14 | char *filename; |
| 15 | unsigned short line; |
| 16 | } __attribute__((packed)); |
| 17 | |
Matt Mackall | c8538a7 | 2005-05-01 08:59:01 -0700 | [diff] [blame] | 18 | #ifdef CONFIG_BUG |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 19 | #define HAVE_ARCH_BUG |
| 20 | #define BUG() \ |
| 21 | asm volatile("ud2 ; .quad %c1 ; .short %c0" :: \ |
Andi Kleen | f18de45 | 2005-04-16 15:24:51 -0700 | [diff] [blame] | 22 | "i"(__LINE__), "i" (__stringify(__FILE__))) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 23 | void out_of_line_bug(void); |
Alexander Nyberg | 4f60fdf | 2005-05-25 12:31:28 -0700 | [diff] [blame] | 24 | #else |
| 25 | static inline void out_of_line_bug(void) { } |
Matt Mackall | c8538a7 | 2005-05-01 08:59:01 -0700 | [diff] [blame] | 26 | #endif |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 27 | |
Matt Mackall | c8538a7 | 2005-05-01 08:59:01 -0700 | [diff] [blame] | 28 | #include <asm-generic/bug.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 29 | #endif |