diff options
author | Paul Mundt <lethal@linux-sh.org> | 2007-05-01 03:33:10 -0400 |
---|---|---|
committer | Paul Mundt <lethal@hera.kernel.org> | 2007-05-06 22:11:57 -0400 |
commit | 3a2e117e220f000f95187ea1e1bbe83b0ed5fdfb (patch) | |
tree | 57fab5755138283793647b5d0d2a2c872f00a430 /include/asm-sh | |
parent | 3dde7a3c74bcc25c6fc31b836fec8c91fb0b2b8f (diff) |
sh: Add die chain notifiers.
Add the atomic die chains in, kprobes needs these.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'include/asm-sh')
-rw-r--r-- | include/asm-sh/kdebug.h | 35 | ||||
-rw-r--r-- | include/asm-sh/system.h | 3 |
2 files changed, 38 insertions, 0 deletions
diff --git a/include/asm-sh/kdebug.h b/include/asm-sh/kdebug.h new file mode 100644 index 000000000000..ef009baf5a11 --- /dev/null +++ b/include/asm-sh/kdebug.h | |||
@@ -0,0 +1,35 @@ | |||
1 | #ifndef __ASM_SH_KDEBUG_H | ||
2 | #define __ASM_SH_KDEBUG_H | ||
3 | |||
4 | #include <linux/notifier.h> | ||
5 | |||
6 | struct pt_regs; | ||
7 | |||
8 | struct die_args { | ||
9 | struct pt_regs *regs; | ||
10 | int trapnr; | ||
11 | }; | ||
12 | |||
13 | int register_die_notifier(struct notifier_block *nb); | ||
14 | int unregister_die_notifier(struct notifier_block *nb); | ||
15 | int register_page_fault_notifier(struct notifier_block *nb); | ||
16 | int unregister_page_fault_notifier(struct notifier_block *nb); | ||
17 | extern struct atomic_notifier_head shdie_chain; | ||
18 | |||
19 | /* Grossly misnamed. */ | ||
20 | enum die_val { | ||
21 | DIE_TRAP, | ||
22 | DIE_PAGE_FAULT, | ||
23 | }; | ||
24 | |||
25 | static inline int notify_die(enum die_val val, struct pt_regs *regs, | ||
26 | int trap, int sig) | ||
27 | { | ||
28 | struct die_args args = { | ||
29 | .regs = regs, | ||
30 | .trapnr = trap, | ||
31 | }; | ||
32 | |||
33 | return atomic_notifier_call_chain(&shdie_chain, val, &args); | ||
34 | } | ||
35 | #endif /* __ASM_SH_KDEBUG_H */ | ||
diff --git a/include/asm-sh/system.h b/include/asm-sh/system.h index 4a6a19f4f8a4..127af304865f 100644 --- a/include/asm-sh/system.h +++ b/include/asm-sh/system.h | |||
@@ -9,6 +9,7 @@ | |||
9 | #include <linux/irqflags.h> | 9 | #include <linux/irqflags.h> |
10 | #include <linux/compiler.h> | 10 | #include <linux/compiler.h> |
11 | #include <asm/types.h> | 11 | #include <asm/types.h> |
12 | #include <asm/ptrace.h> | ||
12 | 13 | ||
13 | /* | 14 | /* |
14 | * switch_to() should switch tasks to task nr n, first | 15 | * switch_to() should switch tasks to task nr n, first |
@@ -255,6 +256,8 @@ static inline unsigned long __cmpxchg(volatile void * ptr, unsigned long old, | |||
255 | (unsigned long)_n_, sizeof(*(ptr))); \ | 256 | (unsigned long)_n_, sizeof(*(ptr))); \ |
256 | }) | 257 | }) |
257 | 258 | ||
259 | extern void die(const char *str, struct pt_regs *regs, long err) __attribute__ ((noreturn)); | ||
260 | |||
258 | extern void *set_exception_table_vec(unsigned int vec, void *handler); | 261 | extern void *set_exception_table_vec(unsigned int vec, void *handler); |
259 | 262 | ||
260 | static inline void *set_exception_table_evt(unsigned int evt, void *handler) | 263 | static inline void *set_exception_table_evt(unsigned int evt, void *handler) |