ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-2.6.6.tar.bz2
[linux-2.6.git] / include / asm-i386 / bug.h
1 #ifndef _I386_BUG_H
2 #define _I386_BUG_H
3
4 #include <linux/config.h>
5
6 /*
7  * Tell the user there is some problem.
8  * The offending file and line are encoded after the "officially
9  * undefined" opcode for parsing in the trap handler.
10  */
11
12 #if 1   /* Set to zero for a slightly smaller kernel */
13 #define BUG()                           \
14  __asm__ __volatile__(  "ud2\n"         \
15                         "\t.word %c0\n" \
16                         "\t.long %c1\n" \
17                          : : "i" (__LINE__), "i" (__FILE__))
18 #else
19 #define BUG() __asm__ __volatile__("ud2\n")
20 #endif
21
22 #define BUG_ON(condition) do { if (unlikely((condition)!=0)) BUG(); } while(0)
23
24 #define PAGE_BUG(page) do { \
25         BUG(); \
26 } while (0)
27
28 #define WARN_ON(condition) do { \
29         if (unlikely((condition)!=0)) { \
30                 printk("Badness in %s at %s:%d\n", __FUNCTION__, __FILE__, __LINE__); \
31                 dump_stack(); \
32         } \
33 } while (0)
34
35 #endif