Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | #ifndef _X86_64_KDEBUG_H |
| 2 | #define _X86_64_KDEBUG_H 1 |
| 3 | |
| 4 | #include <linux/notifier.h> |
| 5 | |
| 6 | struct pt_regs; |
| 7 | |
Alan Stern | e041c68 | 2006-03-27 01:16:30 -0800 | [diff] [blame] | 8 | struct die_args { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 9 | struct pt_regs *regs; |
| 10 | const char *str; |
Alan Stern | e041c68 | 2006-03-27 01:16:30 -0800 | [diff] [blame] | 11 | long err; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 12 | int trapnr; |
| 13 | int signr; |
Alan Stern | e041c68 | 2006-03-27 01:16:30 -0800 | [diff] [blame] | 14 | }; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 15 | |
Alan Stern | e041c68 | 2006-03-27 01:16:30 -0800 | [diff] [blame] | 16 | extern int register_die_notifier(struct notifier_block *); |
| 17 | extern int unregister_die_notifier(struct notifier_block *); |
Anil S Keshavamurthy | 1bd858a | 2006-06-26 00:25:25 -0700 | [diff] [blame] | 18 | extern int register_page_fault_notifier(struct notifier_block *); |
| 19 | extern int unregister_page_fault_notifier(struct notifier_block *); |
Alan Stern | e041c68 | 2006-03-27 01:16:30 -0800 | [diff] [blame] | 20 | extern struct atomic_notifier_head die_chain; |
| 21 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 22 | /* Grossly misnamed. */ |
Alan Stern | e041c68 | 2006-03-27 01:16:30 -0800 | [diff] [blame] | 23 | enum die_val { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 24 | DIE_OOPS = 1, |
| 25 | DIE_INT3, |
| 26 | DIE_DEBUG, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 27 | DIE_PANIC, |
| 28 | DIE_NMI, |
| 29 | DIE_DIE, |
| 30 | DIE_NMIWATCHDOG, |
| 31 | DIE_KERNELDEBUG, |
| 32 | DIE_TRAP, |
| 33 | DIE_GPF, |
| 34 | DIE_CALL, |
| 35 | DIE_NMI_IPI, |
| 36 | DIE_PAGE_FAULT, |
Alan Stern | e041c68 | 2006-03-27 01:16:30 -0800 | [diff] [blame] | 37 | }; |
| 38 | |
Jan Beulich | 6e3f361 | 2006-01-11 22:42:14 +0100 | [diff] [blame] | 39 | static inline int notify_die(enum die_val val, const char *str, |
| 40 | struct pt_regs *regs, long err, int trap, int sig) |
| 41 | { |
| 42 | struct die_args args = { |
| 43 | .regs = regs, |
| 44 | .str = str, |
| 45 | .err = err, |
| 46 | .trapnr = trap, |
| 47 | .signr = sig |
| 48 | }; |
Alan Stern | e041c68 | 2006-03-27 01:16:30 -0800 | [diff] [blame] | 49 | return atomic_notifier_call_chain(&die_chain, val, &args); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 50 | } |
| 51 | |
Ingo Molnar | 3ac9493 | 2006-07-03 00:24:36 -0700 | [diff] [blame] | 52 | extern void printk_address(unsigned long address); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 53 | extern void die(const char *,struct pt_regs *,long); |
| 54 | extern void __die(const char *,struct pt_regs *,long); |
| 55 | extern void show_registers(struct pt_regs *regs); |
| 56 | extern void dump_pagetable(unsigned long); |
Jan Beulich | 1209140 | 2005-09-12 18:49:24 +0200 | [diff] [blame] | 57 | extern unsigned long oops_begin(void); |
| 58 | extern void oops_end(unsigned long); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 59 | |
| 60 | #endif |