5 * Define an illegal instr to trap on the bug.
6 * We don't use 0 because that marks the end of a function
7 * in the ELF ABI. That's "Boo Boo" in case you wonder...
9 #define BUG_OPCODE .long 0x00b00b00 /* For asm */
10 #define BUG_ILLEGAL_INSTR "0x00b00b00" /* For BUG macro */
15 unsigned long bug_addr;
22 * If this bit is set in the line number it means that the trap
23 * is for WARN_ON rather than BUG or BUG_ON.
25 #define BUG_WARNING_TRAP 0x1000000
28 __asm__ __volatile__( \
30 ".section __bug_table,\"a\"\n\t" \
31 " .llong 1b,%0,%1,%2\n" \
33 : : "i" (__LINE__), "i" (__FILE__), "i" (__FUNCTION__)); \
36 #define BUG_ON(x) do { \
37 __asm__ __volatile__( \
39 ".section __bug_table,\"a\"\n\t" \
40 " .llong 1b,%1,%2,%3\n" \
42 : : "r" (x), "i" (__LINE__), "i" (__FILE__), \
43 "i" (__FUNCTION__)); \
46 #define PAGE_BUG(page) do { BUG(); } while (0)
48 #define WARN_ON(x) do { \
49 __asm__ __volatile__( \
51 ".section __bug_table,\"a\"\n\t" \
52 " .llong 1b,%1,%2,%3\n" \
54 : : "r" (x), "i" (__LINE__ + BUG_WARNING_TRAP), \
55 "i" (__FILE__), "i" (__FUNCTION__)); \