blob: 2b0c088e29578434530b45290792b7e66f5355a7 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001#ifndef _X86_64_KDEBUG_H
2#define _X86_64_KDEBUG_H 1
3
4#include <linux/notifier.h>
5
6struct pt_regs;
7
Alan Sterne041c682006-03-27 01:16:30 -08008struct die_args {
Linus Torvalds1da177e2005-04-16 15:20:36 -07009 struct pt_regs *regs;
10 const char *str;
Alan Sterne041c682006-03-27 01:16:30 -080011 long err;
Linus Torvalds1da177e2005-04-16 15:20:36 -070012 int trapnr;
13 int signr;
Alan Sterne041c682006-03-27 01:16:30 -080014};
Linus Torvalds1da177e2005-04-16 15:20:36 -070015
Alan Sterne041c682006-03-27 01:16:30 -080016extern int register_die_notifier(struct notifier_block *);
17extern int unregister_die_notifier(struct notifier_block *);
Anil S Keshavamurthy1bd858a2006-06-26 00:25:25 -070018extern int register_page_fault_notifier(struct notifier_block *);
19extern int unregister_page_fault_notifier(struct notifier_block *);
Alan Sterne041c682006-03-27 01:16:30 -080020extern struct atomic_notifier_head die_chain;
21
Linus Torvalds1da177e2005-04-16 15:20:36 -070022/* Grossly misnamed. */
Alan Sterne041c682006-03-27 01:16:30 -080023enum die_val {
Linus Torvalds1da177e2005-04-16 15:20:36 -070024 DIE_OOPS = 1,
25 DIE_INT3,
26 DIE_DEBUG,
Linus Torvalds1da177e2005-04-16 15:20:36 -070027 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 Sterne041c682006-03-27 01:16:30 -080037};
38
Jan Beulich6e3f3612006-01-11 22:42:14 +010039static 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 Sterne041c682006-03-27 01:16:30 -080049 return atomic_notifier_call_chain(&die_chain, val, &args);
Linus Torvalds1da177e2005-04-16 15:20:36 -070050}
51
Ingo Molnar3ac94932006-07-03 00:24:36 -070052extern void printk_address(unsigned long address);
Linus Torvalds1da177e2005-04-16 15:20:36 -070053extern void die(const char *,struct pt_regs *,long);
54extern void __die(const char *,struct pt_regs *,long);
55extern void show_registers(struct pt_regs *regs);
56extern void dump_pagetable(unsigned long);
Jan Beulich12091402005-09-12 18:49:24 +020057extern unsigned long oops_begin(void);
58extern void oops_end(unsigned long);
Linus Torvalds1da177e2005-04-16 15:20:36 -070059
60#endif