blob: cf795631d9b4ba52eda595ce1411af08f8908f83 [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 *);
18extern struct atomic_notifier_head die_chain;
19
Linus Torvalds1da177e2005-04-16 15:20:36 -070020/* Grossly misnamed. */
Alan Sterne041c682006-03-27 01:16:30 -080021enum die_val {
Linus Torvalds1da177e2005-04-16 15:20:36 -070022 DIE_OOPS = 1,
23 DIE_INT3,
24 DIE_DEBUG,
Linus Torvalds1da177e2005-04-16 15:20:36 -070025 DIE_PANIC,
26 DIE_NMI,
27 DIE_DIE,
28 DIE_NMIWATCHDOG,
29 DIE_KERNELDEBUG,
30 DIE_TRAP,
31 DIE_GPF,
32 DIE_CALL,
33 DIE_NMI_IPI,
34 DIE_PAGE_FAULT,
Alan Sterne041c682006-03-27 01:16:30 -080035};
36
Jan Beulich6e3f3612006-01-11 22:42:14 +010037static inline int notify_die(enum die_val val, const char *str,
38 struct pt_regs *regs, long err, int trap, int sig)
39{
40 struct die_args args = {
41 .regs = regs,
42 .str = str,
43 .err = err,
44 .trapnr = trap,
45 .signr = sig
46 };
Alan Sterne041c682006-03-27 01:16:30 -080047 return atomic_notifier_call_chain(&die_chain, val, &args);
Linus Torvalds1da177e2005-04-16 15:20:36 -070048}
49
50extern int printk_address(unsigned long address);
51extern void die(const char *,struct pt_regs *,long);
52extern void __die(const char *,struct pt_regs *,long);
53extern void show_registers(struct pt_regs *regs);
54extern void dump_pagetable(unsigned long);
Jan Beulich12091402005-09-12 18:49:24 +020055extern unsigned long oops_begin(void);
56extern void oops_end(unsigned long);
Linus Torvalds1da177e2005-04-16 15:20:36 -070057
58#endif