diff options
Diffstat (limited to 'include/asm-generic/bug.h')
-rw-r--r-- | include/asm-generic/bug.h | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/include/asm-generic/bug.h b/include/asm-generic/bug.h index 1d9573cf4a0b..a06eecd48292 100644 --- a/include/asm-generic/bug.h +++ b/include/asm-generic/bug.h | |||
@@ -4,6 +4,22 @@ | |||
4 | #include <linux/compiler.h> | 4 | #include <linux/compiler.h> |
5 | 5 | ||
6 | #ifdef CONFIG_BUG | 6 | #ifdef CONFIG_BUG |
7 | |||
8 | #ifdef CONFIG_GENERIC_BUG | ||
9 | #ifndef __ASSEMBLY__ | ||
10 | struct bug_entry { | ||
11 | unsigned long bug_addr; | ||
12 | #ifdef CONFIG_DEBUG_BUGVERBOSE | ||
13 | const char *file; | ||
14 | unsigned short line; | ||
15 | #endif | ||
16 | unsigned short flags; | ||
17 | }; | ||
18 | #endif /* __ASSEMBLY__ */ | ||
19 | |||
20 | #define BUGFLAG_WARNING (1<<0) | ||
21 | #endif /* CONFIG_GENERIC_BUG */ | ||
22 | |||
7 | #ifndef HAVE_ARCH_BUG | 23 | #ifndef HAVE_ARCH_BUG |
8 | #define BUG() do { \ | 24 | #define BUG() do { \ |
9 | printk("BUG: failure at %s:%d/%s()!\n", __FILE__, __LINE__, __FUNCTION__); \ | 25 | printk("BUG: failure at %s:%d/%s()!\n", __FILE__, __LINE__, __FUNCTION__); \ |
@@ -19,7 +35,7 @@ | |||
19 | #define WARN_ON(condition) ({ \ | 35 | #define WARN_ON(condition) ({ \ |
20 | typeof(condition) __ret_warn_on = (condition); \ | 36 | typeof(condition) __ret_warn_on = (condition); \ |
21 | if (unlikely(__ret_warn_on)) { \ | 37 | if (unlikely(__ret_warn_on)) { \ |
22 | printk("BUG: warning at %s:%d/%s()\n", __FILE__, \ | 38 | printk("WARNING at %s:%d %s()\n", __FILE__, \ |
23 | __LINE__, __FUNCTION__); \ | 39 | __LINE__, __FUNCTION__); \ |
24 | dump_stack(); \ | 40 | dump_stack(); \ |
25 | } \ | 41 | } \ |
@@ -37,7 +53,10 @@ | |||
37 | #endif | 53 | #endif |
38 | 54 | ||
39 | #ifndef HAVE_ARCH_WARN_ON | 55 | #ifndef HAVE_ARCH_WARN_ON |
40 | #define WARN_ON(condition) unlikely((condition)) | 56 | #define WARN_ON(condition) ({ \ |
57 | typeof(condition) __ret_warn_on = (condition); \ | ||
58 | unlikely(__ret_warn_on); \ | ||
59 | }) | ||
41 | #endif | 60 | #endif |
42 | #endif | 61 | #endif |
43 | 62 | ||