bug.c (bf61c8840efe60fd8f91446860b63338fb424158) bug.c (c56ba70331d9f3c1ea77f8053095fb05fe773f50)
1/*
2 Generic support for BUG()
3
4 This respects the following config options:
5
6 CONFIG_BUG - emit BUG traps. Nothing happens without this.
7 CONFIG_GENERIC_BUG - enable this code.
8 CONFIG_GENERIC_BUG_RELATIVE_POINTERS - use 32-bit pointers relative to

--- 23 unchanged lines hidden (view full) ---

32 - report_bug() will return whether it was a false alarm, a warning,
33 or an actual bug.
34 - You must implement the is_valid_bugaddr(bugaddr) callback which
35 returns true if the eip is a real kernel address, and it points
36 to the expected BUG trap instruction.
37
38 Jeremy Fitzhardinge <jeremy@goop.org> 2006
39 */
1/*
2 Generic support for BUG()
3
4 This respects the following config options:
5
6 CONFIG_BUG - emit BUG traps. Nothing happens without this.
7 CONFIG_GENERIC_BUG - enable this code.
8 CONFIG_GENERIC_BUG_RELATIVE_POINTERS - use 32-bit pointers relative to

--- 23 unchanged lines hidden (view full) ---

32 - report_bug() will return whether it was a false alarm, a warning,
33 or an actual bug.
34 - You must implement the is_valid_bugaddr(bugaddr) callback which
35 returns true if the eip is a real kernel address, and it points
36 to the expected BUG trap instruction.
37
38 Jeremy Fitzhardinge <jeremy@goop.org> 2006
39 */
40
41#define pr_fmt(fmt) fmt
42
40#include <linux/list.h>
41#include <linux/module.h>
42#include <linux/kernel.h>
43#include <linux/bug.h>
44#include <linux/sched.h>
45
46extern const struct bug_entry __start___bug_table[], __stop___bug_table[];
47

--- 100 unchanged lines hidden (view full) ---

148#endif
149 line = bug->line;
150#endif
151 warning = (bug->flags & BUGFLAG_WARNING) != 0;
152 }
153
154 if (warning) {
155 /* this is a WARN_ON rather than BUG/BUG_ON */
43#include <linux/list.h>
44#include <linux/module.h>
45#include <linux/kernel.h>
46#include <linux/bug.h>
47#include <linux/sched.h>
48
49extern const struct bug_entry __start___bug_table[], __stop___bug_table[];
50

--- 100 unchanged lines hidden (view full) ---

151#endif
152 line = bug->line;
153#endif
154 warning = (bug->flags & BUGFLAG_WARNING) != 0;
155 }
156
157 if (warning) {
158 /* this is a WARN_ON rather than BUG/BUG_ON */
156 printk(KERN_WARNING "------------[ cut here ]------------\n");
159 pr_warn("------------[ cut here ]------------\n");
157
158 if (file)
160
161 if (file)
159 printk(KERN_WARNING "WARNING: at %s:%u\n",
160 file, line);
162 pr_warn("WARNING: at %s:%u\n", file, line);
161 else
163 else
162 printk(KERN_WARNING "WARNING: at %p "
163 "[verbose debug info unavailable]\n",
164 (void *)bugaddr);
164 pr_warn("WARNING: at %p [verbose debug info unavailable]\n",
165 (void *)bugaddr);
165
166 print_modules();
167 show_regs(regs);
168 print_oops_end_marker();
169 /* Just a warning, don't kill lockdep. */
170 add_taint(BUG_GET_TAINT(bug), LOCKDEP_STILL_OK);
171 return BUG_TRAP_TYPE_WARN;
172 }
173
174 printk(KERN_DEFAULT "------------[ cut here ]------------\n");
175
176 if (file)
166
167 print_modules();
168 show_regs(regs);
169 print_oops_end_marker();
170 /* Just a warning, don't kill lockdep. */
171 add_taint(BUG_GET_TAINT(bug), LOCKDEP_STILL_OK);
172 return BUG_TRAP_TYPE_WARN;
173 }
174
175 printk(KERN_DEFAULT "------------[ cut here ]------------\n");
176
177 if (file)
177 printk(KERN_CRIT "kernel BUG at %s:%u!\n",
178 file, line);
178 pr_crit("kernel BUG at %s:%u!\n", file, line);
179 else
179 else
180 printk(KERN_CRIT "Kernel BUG at %p "
181 "[verbose debug info unavailable]\n",
182 (void *)bugaddr);
180 pr_crit("Kernel BUG at %p [verbose debug info unavailable]\n",
181 (void *)bugaddr);
183
184 return BUG_TRAP_TYPE_BUG;
185}
182
183 return BUG_TRAP_TYPE_BUG;
184}