aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/mips/kernel/traps.c16
-rw-r--r--include/asm-mips/system.h16
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
277static DEFINE_SPINLOCK(die_lock); 277static DEFINE_SPINLOCK(die_lock);
278 278
279NORET_TYPE void ATTRIB_NORET __die(const char * str, struct pt_regs * regs, 279NORET_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
296void __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
303extern const struct exception_table_entry __start___dbe_table[]; 291extern const struct exception_table_entry __start___dbe_table[];
304extern const struct exception_table_entry __stop___dbe_table[]; 292extern 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);
434extern void *set_except_vector(int n, void *addr); 434extern void *set_except_vector(int n, void *addr);
435extern void per_cpu_trap_init(void); 435extern void per_cpu_trap_init(void);
436 436
437extern NORET_TYPE void __die(const char *, struct pt_regs *, const char *file, 437extern NORET_TYPE void die(const char *, struct pt_regs *);
438 const char *func, unsigned long line) ATTRIB_NORET; 438
439extern void __die_if_kernel(const char *, struct pt_regs *, const char *file, 439static 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
447extern int stop_a_enabled; 445extern int stop_a_enabled;
448 446