Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | #ifndef _I386_KDEBUG_H |
| 2 | #define _I386_KDEBUG_H 1 |
| 3 | |
| 4 | /* |
| 5 | * Aug-05 2004 Ported by Prasanna S Panchamukhi <prasanna@in.ibm.com> |
| 6 | * from x86_64 architecture. |
| 7 | */ |
| 8 | #include <linux/notifier.h> |
| 9 | |
| 10 | struct pt_regs; |
| 11 | |
| 12 | struct die_args { |
| 13 | struct pt_regs *regs; |
| 14 | const char *str; |
| 15 | long err; |
| 16 | int trapnr; |
| 17 | int signr; |
| 18 | }; |
| 19 | |
Alan Stern | e041c68 | 2006-03-27 01:16:30 -0800 | [diff] [blame] | 20 | extern int register_die_notifier(struct notifier_block *); |
| 21 | extern int unregister_die_notifier(struct notifier_block *); |
Anil S Keshavamurthy | b71b5b6 | 2006-06-26 00:25:25 -0700 | [diff] [blame^] | 22 | extern int register_page_fault_notifier(struct notifier_block *); |
| 23 | extern int unregister_page_fault_notifier(struct notifier_block *); |
Alan Stern | e041c68 | 2006-03-27 01:16:30 -0800 | [diff] [blame] | 24 | extern struct atomic_notifier_head i386die_chain; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 25 | |
| 26 | |
| 27 | /* Grossly misnamed. */ |
| 28 | enum die_val { |
| 29 | DIE_OOPS = 1, |
| 30 | DIE_INT3, |
| 31 | DIE_DEBUG, |
| 32 | DIE_PANIC, |
| 33 | DIE_NMI, |
| 34 | DIE_DIE, |
| 35 | DIE_NMIWATCHDOG, |
| 36 | DIE_KERNELDEBUG, |
| 37 | DIE_TRAP, |
| 38 | DIE_GPF, |
| 39 | DIE_CALL, |
| 40 | DIE_NMI_IPI, |
| 41 | DIE_PAGE_FAULT, |
| 42 | }; |
| 43 | |
George Anzinger | 748f2ed | 2005-09-03 15:56:48 -0700 | [diff] [blame] | 44 | static inline int notify_die(enum die_val val, const char *str, |
| 45 | struct pt_regs *regs, long err, int trap, int sig) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 46 | { |
George Anzinger | 748f2ed | 2005-09-03 15:56:48 -0700 | [diff] [blame] | 47 | struct die_args args = { |
| 48 | .regs = regs, |
| 49 | .str = str, |
| 50 | .err = err, |
| 51 | .trapnr = trap, |
| 52 | .signr = sig |
| 53 | }; |
Alan Stern | e041c68 | 2006-03-27 01:16:30 -0800 | [diff] [blame] | 54 | return atomic_notifier_call_chain(&i386die_chain, val, &args); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 55 | } |
| 56 | |
| 57 | #endif |