blob: 493c206297479adb4ffdb7f14457c0e8b8338c13 [file] [log] [blame]
Paul Mundt3a2e1172007-05-01 16:33:10 +09001#ifndef __ASM_SH_KDEBUG_H
2#define __ASM_SH_KDEBUG_H
3
4#include <linux/notifier.h>
Christoph Hellwig1eeb66a2007-05-08 00:27:03 -07005#include <asm-generic/kdebug.h>
Paul Mundt3a2e1172007-05-01 16:33:10 +09006
7struct pt_regs;
8
9struct die_args {
10 struct pt_regs *regs;
11 int trapnr;
12};
13
14int register_die_notifier(struct notifier_block *nb);
15int unregister_die_notifier(struct notifier_block *nb);
16int register_page_fault_notifier(struct notifier_block *nb);
17int unregister_page_fault_notifier(struct notifier_block *nb);
18extern struct atomic_notifier_head shdie_chain;
19
20/* Grossly misnamed. */
21enum die_val {
22 DIE_TRAP,
23 DIE_PAGE_FAULT,
24};
25
26static 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 */