Merge branches 'next/ar7', 'next/ath79', 'next/bcm63xx', 'next/bmips', 'next/cavium...
[deliverable/linux.git] / arch / mips / kernel / traps.c
index 5c8a49d55054dffce696066bad88d1863c5e7f35..48240fd8c29716f1ad3581b46788b3ae762dd15d 100644 (file)
@@ -91,6 +91,7 @@ int (*board_be_handler)(struct pt_regs *regs, int is_fixup);
 void (*board_nmi_handler_setup)(void);
 void (*board_ejtag_handler_setup)(void);
 void (*board_bind_eic_interrupt)(int irq, int regset);
+void (*board_ebase_setup)(void);
 
 
 static void show_raw_backtrace(unsigned long reg29)
@@ -400,7 +401,7 @@ void __noreturn die(const char *str, struct pt_regs *regs)
                panic("Fatal exception in interrupt");
 
        if (panic_on_oops) {
-               printk(KERN_EMERG "Fatal exception: panic in 5 seconds\n");
+               printk(KERN_EMERG "Fatal exception: panic in 5 seconds");
                ssleep(5);
                panic("Fatal exception");
        }
@@ -1150,7 +1151,7 @@ asmlinkage void do_mt(struct pt_regs *regs)
 asmlinkage void do_dsp(struct pt_regs *regs)
 {
        if (cpu_has_dsp)
-               panic("Unexpected DSP exception\n");
+               panic("Unexpected DSP exception");
 
        force_sig(SIGILL, current);
 }
@@ -1339,9 +1340,18 @@ void ejtag_exception_handler(struct pt_regs *regs)
 
 /*
  * NMI exception handler.
+ * No lock; only written during early bootup by CPU 0.
  */
+static RAW_NOTIFIER_HEAD(nmi_chain);
+
+int register_nmi_notifier(struct notifier_block *nb)
+{
+       return raw_notifier_chain_register(&nmi_chain, nb);
+}
+
 NORET_TYPE void ATTRIB_NORET nmi_exception_handler(struct pt_regs *regs)
 {
+       raw_notifier_call_chain(&nmi_chain, 0, regs);
        bust_spinlocks(1);
        printk("NMI taken!!!!\n");
        die("NMI", regs);
@@ -1682,6 +1692,8 @@ void __init trap_init(void)
                        ebase += (read_c0_ebase() & 0x3ffff000);
        }
 
+       if (board_ebase_setup)
+               board_ebase_setup();
        per_cpu_trap_init();
 
        /*
This page took 0.028527 seconds and 5 git commands to generate.