Merge master.kernel.org:/pub/scm/linux/kernel/git/dtor/input
[sfrench/cifs-2.6.git] / include / asm-sh / kdebug.h
1 #ifndef __ASM_SH_KDEBUG_H
2 #define __ASM_SH_KDEBUG_H
3
4 #include <linux/notifier.h>
5 #include <asm-generic/kdebug.h>
6
7 struct pt_regs;
8
9 struct die_args {
10         struct pt_regs *regs;
11         int trapnr;
12 };
13
14 int register_die_notifier(struct notifier_block *nb);
15 int unregister_die_notifier(struct notifier_block *nb);
16 int register_page_fault_notifier(struct notifier_block *nb);
17 int unregister_page_fault_notifier(struct notifier_block *nb);
18 extern struct atomic_notifier_head shdie_chain;
19
20 /* Grossly misnamed. */
21 enum die_val {
22         DIE_TRAP,
23         DIE_PAGE_FAULT,
24 };
25
26 static inline int notify_die(enum die_val val, struct pt_regs *regs,
27                              int trap, int sig)
28 {
29         struct die_args args = {
30                 .regs = regs,
31                 .trapnr = trap,
32         };
33
34         return atomic_notifier_call_chain(&shdie_chain, val, &args);
35 }
36 #endif /* __ASM_SH_KDEBUG_H */