[ARM] Add panic-on-oops support
authorRussell King <rmk@dyn-67.arm.linux.org.uk>
Sun, 19 Feb 2006 19:53:56 +0000 (19:53 +0000)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Wed, 22 Feb 2006 09:33:22 +0000 (09:33 +0000)
Although you could ask the kernel for panic-on-oops, it remained
non-functional because the architecture specific code fragment had
not been implemented.  Add it, so it works as advertised.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/kernel/traps.c

index 10235b01582eb8fa2653d26e077536d4ffab0a75..03924bcc61293169c70bd65f48325a6a849c2514 100644 (file)
@@ -19,6 +19,7 @@
 #include <linux/personality.h>
 #include <linux/ptrace.h>
 #include <linux/kallsyms.h>
+#include <linux/delay.h>
 #include <linux/init.h>
 
 #include <asm/atomic.h>
@@ -231,6 +232,13 @@ NORET_TYPE void die(const char *str, struct pt_regs *regs, int err)
        __die(str, err, thread, regs);
        bust_spinlocks(0);
        spin_unlock_irq(&die_lock);
+
+       if (panic_on_oops) {
+               printk(KERN_EMERG "Fatal exception: panic in 5 seconds\n");
+               ssleep(5);
+               panic("Fatal exception");
+       }
+
        do_exit(SIGSEGV);
 }