diff options
-rw-r--r-- | arch/mips/kernel/traps.c | 16 | ||||
-rw-r--r-- | include/asm-mips/system.h | 16 |
2 files changed, 9 insertions, 23 deletions
diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c index eccae8191602..a3c005126969 100644 --- a/arch/mips/kernel/traps.c +++ b/arch/mips/kernel/traps.c | |||
@@ -276,30 +276,18 @@ void show_registers(struct pt_regs *regs) | |||
276 | 276 | ||
277 | static DEFINE_SPINLOCK(die_lock); | 277 | static DEFINE_SPINLOCK(die_lock); |
278 | 278 | ||
279 | NORET_TYPE void ATTRIB_NORET __die(const char * str, struct pt_regs * regs, | 279 | NORET_TYPE void ATTRIB_NORET die(const char * str, struct pt_regs * regs) |
280 | const char * file, const char * func, | ||
281 | unsigned long line) | ||
282 | { | 280 | { |
283 | static int die_counter; | 281 | static int die_counter; |
284 | 282 | ||
285 | console_verbose(); | 283 | console_verbose(); |
286 | spin_lock_irq(&die_lock); | 284 | spin_lock_irq(&die_lock); |
287 | printk("%s", str); | 285 | printk("%s[#%d]:\n", str, ++die_counter); |
288 | if (file && func) | ||
289 | printk(" in %s:%s, line %ld", file, func, line); | ||
290 | printk("[#%d]:\n", ++die_counter); | ||
291 | show_registers(regs); | 286 | show_registers(regs); |
292 | spin_unlock_irq(&die_lock); | 287 | spin_unlock_irq(&die_lock); |
293 | do_exit(SIGSEGV); | 288 | do_exit(SIGSEGV); |
294 | } | 289 | } |
295 | 290 | ||
296 | void __die_if_kernel(const char * str, struct pt_regs * regs, | ||
297 | const char * file, const char * func, unsigned long line) | ||
298 | { | ||
299 | if (!user_mode(regs)) | ||
300 | __die(str, regs, file, func, line); | ||
301 | } | ||
302 | |||
303 | extern const struct exception_table_entry __start___dbe_table[]; | 291 | extern const struct exception_table_entry __start___dbe_table[]; |
304 | extern const struct exception_table_entry __stop___dbe_table[]; | 292 | extern const struct exception_table_entry __stop___dbe_table[]; |
305 | 293 | ||
diff --git a/include/asm-mips/system.h b/include/asm-mips/system.h index b126545e96ed..330c4e497af3 100644 --- a/include/asm-mips/system.h +++ b/include/asm-mips/system.h | |||
@@ -434,15 +434,13 @@ extern void *set_vi_srs_handler (int n, void *addr, int regset); | |||
434 | extern void *set_except_vector(int n, void *addr); | 434 | extern void *set_except_vector(int n, void *addr); |
435 | extern void per_cpu_trap_init(void); | 435 | extern void per_cpu_trap_init(void); |
436 | 436 | ||
437 | extern NORET_TYPE void __die(const char *, struct pt_regs *, const char *file, | 437 | extern NORET_TYPE void die(const char *, struct pt_regs *); |
438 | const char *func, unsigned long line) ATTRIB_NORET; | 438 | |
439 | extern void __die_if_kernel(const char *, struct pt_regs *, const char *file, | 439 | static inline void die_if_kernel(const char *str, struct pt_regs *regs) |
440 | const char *func, unsigned long line); | 440 | { |
441 | 441 | if (unlikely(!user_mode(regs))) | |
442 | #define die(msg, regs) \ | 442 | die(str, regs); |
443 | __die(msg, regs, __FILE__ ":", __FUNCTION__, __LINE__) | 443 | } |
444 | #define die_if_kernel(msg, regs) \ | ||
445 | __die_if_kernel(msg, regs, __FILE__ ":", __FUNCTION__, __LINE__) | ||
446 | 444 | ||
447 | extern int stop_a_enabled; | 445 | extern int stop_a_enabled; |
448 | 446 | ||