diff options
author | Paul Mundt <lethal@linux-sh.org> | 2009-09-01 04:38:32 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2009-09-01 04:38:32 -0400 |
commit | 1e1030dccb1084c8a38976d3656aab1d50d762da (patch) | |
tree | 18c62bd2a12dbb8e8aae56d771f0561784af186b /arch/sh/kernel/traps.c | |
parent | ac6a0cf6716bb46813d0161024c66c2af66e53d1 (diff) |
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>
Diffstat (limited to 'arch/sh/kernel/traps.c')
-rw-r--r-- | arch/sh/kernel/traps.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/arch/sh/kernel/traps.c b/arch/sh/kernel/traps.c index f69bd968fcca..a8396f36bd14 100644 --- a/arch/sh/kernel/traps.c +++ b/arch/sh/kernel/traps.c | |||
@@ -5,6 +5,7 @@ | |||
5 | #include <linux/signal.h> | 5 | #include <linux/signal.h> |
6 | #include <linux/sched.h> | 6 | #include <linux/sched.h> |
7 | #include <linux/uaccess.h> | 7 | #include <linux/uaccess.h> |
8 | #include <linux/hardirq.h> | ||
8 | #include <asm/unwinder.h> | 9 | #include <asm/unwinder.h> |
9 | #include <asm/system.h> | 10 | #include <asm/system.h> |
10 | 11 | ||
@@ -91,3 +92,23 @@ BUILD_TRAP_HANDLER(bug) | |||
91 | 92 | ||
92 | force_sig(SIGTRAP, current); | 93 | force_sig(SIGTRAP, current); |
93 | } | 94 | } |
95 | |||
96 | BUILD_TRAP_HANDLER(nmi) | ||
97 | { | ||
98 | TRAP_HANDLER_DECL; | ||
99 | |||
100 | nmi_enter(); | ||
101 | |||
102 | switch (notify_die(DIE_NMI, "NMI", regs, 0, vec & 0xff, SIGINT)) { | ||
103 | case NOTIFY_OK: | ||
104 | case NOTIFY_STOP: | ||
105 | break; | ||
106 | case NOTIFY_BAD: | ||
107 | die("Fatal Non-Maskable Interrupt", regs, SIGINT); | ||
108 | default: | ||
109 | printk(KERN_ALERT "Got NMI, but nobody cared. Ignoring...\n"); | ||
110 | break; | ||
111 | } | ||
112 | |||
113 | nmi_exit(); | ||
114 | } | ||