blob: 6277f75cbb4b3f1a25330cf80280e9118f63f8a3 [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
8struct die_args {
9 struct pt_regs *regs;
10 const char *str;
11 long err;
12 int trapnr;
13 int signr;
14};
15
16/* Note - you should never unregister because that can race with NMIs.
17 If you really want to do it first unregister - then synchronize_kernel - then free.
18 */
19int register_die_notifier(struct notifier_block *nb);
20extern struct notifier_block *die_chain;
21/* Grossly misnamed. */
22enum die_val {
23 DIE_OOPS = 1,
24 DIE_INT3,
25 DIE_DEBUG,
Linus Torvalds1da177e2005-04-16 15:20:36 -070026 DIE_PANIC,
27 DIE_NMI,
28 DIE_DIE,
29 DIE_NMIWATCHDOG,
30 DIE_KERNELDEBUG,
31 DIE_TRAP,
32 DIE_GPF,
33 DIE_CALL,
34 DIE_NMI_IPI,
35 DIE_PAGE_FAULT,
36};
37
38static inline int notify_die(enum die_val val,char *str,struct pt_regs *regs,long err,int trap, int sig)
39{
40 struct die_args args = { .regs=regs, .str=str, .err=err, .trapnr=trap,.signr=sig };
41 return notifier_call_chain(&die_chain, val, &args);
42}
43
44extern int printk_address(unsigned long address);
45extern void die(const char *,struct pt_regs *,long);
46extern void __die(const char *,struct pt_regs *,long);
47extern void show_registers(struct pt_regs *regs);
48extern void dump_pagetable(unsigned long);
49extern void oops_begin(void);
50extern void oops_end(void);
51
52#endif