sh: Wire up kdump crash kernel exec in die().
authorPaul Mundt <lethal@linux-sh.org>
Mon, 14 May 2007 23:36:36 +0000 (08:36 +0900)
committerPaul Mundt <lethal@linux-sh.org>
Mon, 21 May 2007 05:34:37 +0000 (14:34 +0900)
Now that we have the basic kdump support in place, add it in to
die() so we can enter the crash kernel automatically.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
arch/sh/kernel/traps.c

index a01e36705c5f7444fa69ebd278f70bb937a9d70a..5b75cb6f8f9baad9aec571397e3cc2dd5d7b1ab0 100644 (file)
@@ -21,6 +21,7 @@
 #include <linux/bug.h>
 #include <linux/debug_locks.h>
 #include <linux/kdebug.h>
+#include <linux/kexec.h>
 #include <linux/limits.h>
 #include <asm/system.h>
 #include <asm/uaccess.h>
@@ -101,6 +102,16 @@ void die(const char * str, struct pt_regs * regs, long err)
 
        bust_spinlocks(0);
        spin_unlock_irq(&die_lock);
+
+       if (kexec_should_crash(current))
+               crash_kexec(regs);
+
+       if (in_interrupt())
+               panic("Fatal exception in interrupt");
+
+       if (panic_on_oops)
+               panic("Fatal exception");
+
        do_exit(SIGSEGV);
 }