Stephen Rothwell | bbeb3f4 | 2005-09-27 13:51:59 +1000 | [diff] [blame] | 1 | #ifndef _ASM_POWERPC_KDEBUG_H |
| 2 | #define _ASM_POWERPC_KDEBUG_H |
Arnd Bergmann | 88ced03 | 2005-12-16 22:43:46 +0100 | [diff] [blame] | 3 | #ifdef __KERNEL__ |
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 4 | |
| 5 | /* nearly identical to x86_64/i386 code */ |
| 6 | |
| 7 | #include <linux/notifier.h> |
| 8 | |
| 9 | struct pt_regs; |
| 10 | |
| 11 | struct die_args { |
| 12 | struct pt_regs *regs; |
| 13 | const char *str; |
| 14 | long err; |
| 15 | int trapnr; |
| 16 | int signr; |
| 17 | }; |
| 18 | |
| 19 | /* |
| 20 | Note - you should never unregister because that can race with NMIs. |
| 21 | If you really want to do it first unregister - then synchronize_sched - |
| 22 | then free. |
| 23 | */ |
| 24 | int register_die_notifier(struct notifier_block *nb); |
| 25 | extern struct notifier_block *powerpc_die_chain; |
| 26 | |
| 27 | /* Grossly misnamed. */ |
| 28 | enum die_val { |
| 29 | DIE_OOPS = 1, |
| 30 | DIE_IABR_MATCH, |
| 31 | DIE_DABR_MATCH, |
| 32 | DIE_BPT, |
| 33 | DIE_SSTEP, |
| 34 | DIE_PAGE_FAULT, |
| 35 | }; |
| 36 | |
| 37 | static inline int notify_die(enum die_val val,char *str,struct pt_regs *regs,long err,int trap, int sig) |
| 38 | { |
| 39 | struct die_args args = { .regs=regs, .str=str, .err=err, .trapnr=trap,.signr=sig }; |
| 40 | return notifier_call_chain(&powerpc_die_chain, val, &args); |
| 41 | } |
| 42 | |
Arnd Bergmann | 88ced03 | 2005-12-16 22:43:46 +0100 | [diff] [blame] | 43 | #endif /* __KERNEL__ */ |
Stephen Rothwell | bbeb3f4 | 2005-09-27 13:51:59 +1000 | [diff] [blame] | 44 | #endif /* _ASM_POWERPC_KDEBUG_H */ |