sh: nmi_debug support.
This implements support for NMI debugging that was shamelessly copied from the avr32 port. A bit of special magic is needed in the interrupt exception path given that the NMI exception handler is stubbed in to the regular exception handling table despite being reported in INTEVT. So we mangle the lookup and kick off an EXPEVT-style exception dispatch from the INTEVT path for exceptions that do_IRQ() has no chance of handling. As a result, we also drop the evt2irq() conversion from the do_IRQ() path and just do it in assembly. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
#include <linux/signal.h>
|
||||
#include <linux/sched.h>
|
||||
#include <linux/uaccess.h>
|
||||
#include <linux/hardirq.h>
|
||||
#include <asm/unwinder.h>
|
||||
#include <asm/system.h>
|
||||
|
||||
@@ -91,3 +92,23 @@ BUILD_TRAP_HANDLER(bug)
|
||||
|
||||
force_sig(SIGTRAP, current);
|
||||
}
|
||||
|
||||
BUILD_TRAP_HANDLER(nmi)
|
||||
{
|
||||
TRAP_HANDLER_DECL;
|
||||
|
||||
nmi_enter();
|
||||
|
||||
switch (notify_die(DIE_NMI, "NMI", regs, 0, vec & 0xff, SIGINT)) {
|
||||
case NOTIFY_OK:
|
||||
case NOTIFY_STOP:
|
||||
break;
|
||||
case NOTIFY_BAD:
|
||||
die("Fatal Non-Maskable Interrupt", regs, SIGINT);
|
||||
default:
|
||||
printk(KERN_ALERT "Got NMI, but nobody cared. Ignoring...\n");
|
||||
break;
|
||||
}
|
||||
|
||||
nmi_exit();
|
||||
}
|
||||
|
Reference in New Issue
Block a user