Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | #ifndef _SPARC64_KDEBUG_H |
| 2 | #define _SPARC64_KDEBUG_H |
| 3 | |
| 4 | /* Nearly identical to x86_64/i386 code. */ |
| 5 | |
| 6 | #include <linux/notifier.h> |
| 7 | |
| 8 | struct pt_regs; |
| 9 | |
| 10 | struct die_args { |
| 11 | struct pt_regs *regs; |
| 12 | const char *str; |
| 13 | long err; |
| 14 | int trapnr; |
| 15 | int signr; |
| 16 | }; |
| 17 | |
Alan Stern | e041c68 | 2006-03-27 01:16:30 -0800 | [diff] [blame] | 18 | extern int register_die_notifier(struct notifier_block *); |
| 19 | extern int unregister_die_notifier(struct notifier_block *); |
Anil S Keshavamurthy | d98f8f0 | 2006-06-26 00:25:27 -0700 | [diff] [blame] | 20 | extern int register_page_fault_notifier(struct notifier_block *); |
| 21 | extern int unregister_page_fault_notifier(struct notifier_block *); |
Alan Stern | e041c68 | 2006-03-27 01:16:30 -0800 | [diff] [blame] | 22 | extern struct atomic_notifier_head sparc64die_chain; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 23 | |
| 24 | extern void bad_trap(struct pt_regs *, long); |
| 25 | |
| 26 | /* Grossly misnamed. */ |
| 27 | enum die_val { |
| 28 | DIE_OOPS = 1, |
| 29 | DIE_DEBUG, /* ta 0x70 */ |
| 30 | DIE_DEBUG_2, /* ta 0x71 */ |
| 31 | DIE_DIE, |
| 32 | DIE_TRAP, |
| 33 | DIE_TRAP_TL1, |
| 34 | DIE_GPF, |
| 35 | DIE_CALL, |
| 36 | DIE_PAGE_FAULT, |
| 37 | }; |
| 38 | |
| 39 | static inline int notify_die(enum die_val val,char *str, struct pt_regs *regs, |
| 40 | long err, int trap, int sig) |
| 41 | { |
| 42 | struct die_args args = { .regs = regs, |
| 43 | .str = str, |
| 44 | .err = err, |
| 45 | .trapnr = trap, |
| 46 | .signr = sig }; |
| 47 | |
Alan Stern | e041c68 | 2006-03-27 01:16:30 -0800 | [diff] [blame] | 48 | return atomic_notifier_call_chain(&sparc64die_chain, val, &args); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 49 | } |
| 50 | |
| 51 | #endif |