Paul Mundt | 3a2e117 | 2007-05-01 16:33:10 +0900 | [diff] [blame^] | 1 | #ifndef __ASM_SH_KDEBUG_H |
| 2 | #define __ASM_SH_KDEBUG_H |
| 3 | |
| 4 | #include <linux/notifier.h> |
| 5 | |
| 6 | struct pt_regs; |
| 7 | |
| 8 | struct die_args { |
| 9 | struct pt_regs *regs; |
| 10 | int trapnr; |
| 11 | }; |
| 12 | |
| 13 | int register_die_notifier(struct notifier_block *nb); |
| 14 | int unregister_die_notifier(struct notifier_block *nb); |
| 15 | int register_page_fault_notifier(struct notifier_block *nb); |
| 16 | int unregister_page_fault_notifier(struct notifier_block *nb); |
| 17 | extern struct atomic_notifier_head shdie_chain; |
| 18 | |
| 19 | /* Grossly misnamed. */ |
| 20 | enum die_val { |
| 21 | DIE_TRAP, |
| 22 | DIE_PAGE_FAULT, |
| 23 | }; |
| 24 | |
| 25 | static inline int notify_die(enum die_val val, struct pt_regs *regs, |
| 26 | int trap, int sig) |
| 27 | { |
| 28 | struct die_args args = { |
| 29 | .regs = regs, |
| 30 | .trapnr = trap, |
| 31 | }; |
| 32 | |
| 33 | return atomic_notifier_call_chain(&shdie_chain, val, &args); |
| 34 | } |
| 35 | #endif /* __ASM_SH_KDEBUG_H */ |