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 | |
Matt Mackall | c8538a7 | 2005-05-01 08:59:01 -0700 | [diff] [blame] | 4 | #ifdef CONFIG_BUG |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 5 | #define HAVE_ARCH_BUG |
Jeremy Fitzhardinge | c31a0bf | 2006-12-08 02:36:22 -0800 | [diff] [blame^] | 6 | |
| 7 | #ifdef CONFIG_DEBUG_BUGVERBOSE |
| 8 | #define BUG() \ |
| 9 | do { \ |
| 10 | asm volatile("1:\tud2\n" \ |
| 11 | ".pushsection __bug_table,\"a\"\n" \ |
| 12 | "2:\t.quad 1b, %c0\n" \ |
| 13 | "\t.word %c1, 0\n" \ |
| 14 | "\t.org 2b+%c2\n" \ |
| 15 | ".popsection" \ |
| 16 | : : "i" (__FILE__), "i" (__LINE__), \ |
| 17 | "i" (sizeof(struct bug_entry))); \ |
| 18 | for(;;) ; \ |
| 19 | } while(0) |
| 20 | #else |
| 21 | #define BUG() \ |
| 22 | do { \ |
| 23 | asm volatile("ud2"); \ |
| 24 | for(;;) ; \ |
| 25 | } while(0) |
| 26 | #endif |
| 27 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 28 | void out_of_line_bug(void); |
Alexander Nyberg | 4f60fdf | 2005-05-25 12:31:28 -0700 | [diff] [blame] | 29 | #else |
| 30 | static inline void out_of_line_bug(void) { } |
Matt Mackall | c8538a7 | 2005-05-01 08:59:01 -0700 | [diff] [blame] | 31 | #endif |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 32 | |
Matt Mackall | c8538a7 | 2005-05-01 08:59:01 -0700 | [diff] [blame] | 33 | #include <asm-generic/bug.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 34 | #endif |