Merge branch 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus
[sfrench/cifs-2.6.git] / arch / mips / kernel / traps.c
index 7e5e38c24cdc8308a6ea5f1ec72795215de36eeb..8bdd6a663c7fe2284b69bfd4627acdd77364ca63 100644 (file)
@@ -26,6 +26,7 @@
 #include <linux/kgdb.h>
 #include <linux/kdebug.h>
 #include <linux/notifier.h>
+#include <linux/kdb.h>
 
 #include <asm/bootinfo.h>
 #include <asm/branch.h>
@@ -185,6 +186,11 @@ void show_stack(struct task_struct *task, unsigned long *sp)
                        regs.regs[29] = task->thread.reg29;
                        regs.regs[31] = 0;
                        regs.cp0_epc = task->thread.reg31;
+#ifdef CONFIG_KGDB_KDB
+               } else if (atomic_read(&kgdb_active) != -1 &&
+                          kdb_current_regs) {
+                       memcpy(&regs, kdb_current_regs, sizeof(regs));
+#endif /* CONFIG_KGDB_KDB */
                } else {
                        prepare_frametrace(&regs);
                }
@@ -360,6 +366,8 @@ void __noreturn die(const char * str, struct pt_regs * regs)
        unsigned long dvpret = dvpe();
 #endif /* CONFIG_MIPS_MT_SMTC */
 
+       notify_die(DIE_OOPS, str, (struct pt_regs *)regs, SIGSEGV, 0, 0);
+
        console_verbose();
        spin_lock_irq(&die_lock);
        bust_spinlocks(1);
@@ -704,6 +712,11 @@ static void do_trap_or_bp(struct pt_regs *regs, unsigned int code,
        siginfo_t info;
        char b[40];
 
+#ifdef CONFIG_KGDB_LOW_LEVEL_TRAP
+       if (kgdb_ll_trap(DIE_TRAP, str, regs, code, 0, 0) == NOTIFY_STOP)
+               return;
+#endif /* CONFIG_KGDB_LOW_LEVEL_TRAP */
+
        if (notify_die(DIE_TRAP, str, regs, code, 0, 0) == NOTIFY_STOP)
                return;