Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 284756
b: refs/heads/master
c: 34bd92e
h: refs/heads/master
v: v3
  • Loading branch information
Kevin Cernekee authored and Ralf Baechle committed Dec 7, 2011
1 parent fd80995 commit f120d6d
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 18a1eef92dcd6b8ec30fcbe6e074e5d33ef31c02
refs/heads/master: 34bd92e27becdc2c8b50d200a329da5e9b8174d9
12 changes: 12 additions & 0 deletions trunk/arch/mips/include/asm/traps.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,16 @@ extern void (*board_nmi_handler_setup)(void);
extern void (*board_ejtag_handler_setup)(void);
extern void (*board_bind_eic_interrupt)(int irq, int regset);

extern int register_nmi_notifier(struct notifier_block *nb);

#define nmi_notifier(fn, pri) \
({ \
static struct notifier_block fn##_nb = { \
.notifier_call = fn, \
.priority = pri \
}; \
\
register_nmi_notifier(&fn##_nb); \
})

#endif /* _ASM_TRAPS_H */
9 changes: 9 additions & 0 deletions trunk/arch/mips/kernel/traps.c
Original file line number Diff line number Diff line change
Expand Up @@ -1339,9 +1339,18 @@ void ejtag_exception_handler(struct pt_regs *regs)

/*
* NMI exception handler.
* No lock; only written during early bootup by CPU 0.
*/
static RAW_NOTIFIER_HEAD(nmi_chain);

int register_nmi_notifier(struct notifier_block *nb)
{
return raw_notifier_chain_register(&nmi_chain, nb);
}

NORET_TYPE void ATTRIB_NORET nmi_exception_handler(struct pt_regs *regs)
{
raw_notifier_call_chain(&nmi_chain, 0, regs);
bust_spinlocks(1);
printk("NMI taken!!!!\n");
die("NMI", regs);
Expand Down

0 comments on commit f120d6d

Please sign in to comment.