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 | |
Alan Stern | e041c68 | 2006-03-27 01:16:30 -0800 | [diff] [blame] | 19 | extern int register_die_notifier(struct notifier_block *); |
| 20 | extern int unregister_die_notifier(struct notifier_block *); |
Christoph Hellwig | 9f90b99 | 2007-04-30 11:56:46 +0100 | [diff] [blame^] | 21 | |
| 22 | /* |
| 23 | * These are only here because kprobes.c wants them to implement a |
| 24 | * blatant layering violation. Will hopefully go away soon once all |
| 25 | * architectures are updated. |
| 26 | */ |
| 27 | static inline int register_page_fault_notifier(struct notifier_block *nb) |
| 28 | { |
| 29 | return 0; |
| 30 | } |
| 31 | static inline int unregister_page_fault_notifier(struct notifier_block *nb) |
| 32 | { |
| 33 | return 0; |
| 34 | } |
Alan Stern | e041c68 | 2006-03-27 01:16:30 -0800 | [diff] [blame] | 35 | extern struct atomic_notifier_head powerpc_die_chain; |
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 36 | |
| 37 | /* Grossly misnamed. */ |
| 38 | enum die_val { |
| 39 | DIE_OOPS = 1, |
| 40 | DIE_IABR_MATCH, |
| 41 | DIE_DABR_MATCH, |
| 42 | DIE_BPT, |
| 43 | DIE_SSTEP, |
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 44 | }; |
| 45 | |
| 46 | static inline int notify_die(enum die_val val,char *str,struct pt_regs *regs,long err,int trap, int sig) |
| 47 | { |
| 48 | struct die_args args = { .regs=regs, .str=str, .err=err, .trapnr=trap,.signr=sig }; |
Alan Stern | e041c68 | 2006-03-27 01:16:30 -0800 | [diff] [blame] | 49 | return atomic_notifier_call_chain(&powerpc_die_chain, val, &args); |
Paul Mackerras | 14cf11a | 2005-09-26 16:04:21 +1000 | [diff] [blame] | 50 | } |
| 51 | |
Arnd Bergmann | 88ced03 | 2005-12-16 22:43:46 +0100 | [diff] [blame] | 52 | #endif /* __KERNEL__ */ |
Stephen Rothwell | bbeb3f4 | 2005-09-27 13:51:59 +1000 | [diff] [blame] | 53 | #endif /* _ASM_POWERPC_KDEBUG_H */ |