summaryrefslogtreecommitdiff
path: root/include/asm-sh/system.h
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2007-11-20 18:08:06 +0900
committerPaul Mundt <lethal@linux-sh.org>2008-01-28 13:18:50 +0900
commit5a4f7c66be981c6b5f44a4d66a14ea6ac9b7b6b0 (patch)
treea605424a32ce11d189a1aa1385c3fc22f972449f /include/asm-sh/system.h
parent811d50cb43eb730cc325df0c6913556e25739797 (diff)
downloadlwn-5a4f7c66be981c6b5f44a4d66a14ea6ac9b7b6b0.tar.gz
lwn-5a4f7c66be981c6b5f44a4d66a14ea6ac9b7b6b0.zip
sh: Share bug/debug traps across _32 and _64.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'include/asm-sh/system.h')
-rw-r--r--include/asm-sh/system.h25
1 files changed, 19 insertions, 6 deletions
diff --git a/include/asm-sh/system.h b/include/asm-sh/system.h
index 0cfa96aa5844..6b02dfd587ea 100644
--- a/include/asm-sh/system.h
+++ b/include/asm-sh/system.h
@@ -185,12 +185,25 @@ void default_idle(void);
void per_cpu_trap_init(void);
asmlinkage void break_point_trap(void);
-asmlinkage void debug_trap_handler(unsigned long r4, unsigned long r5,
- unsigned long r6, unsigned long r7,
- struct pt_regs __regs);
-asmlinkage void bug_trap_handler(unsigned long r4, unsigned long r5,
- unsigned long r6, unsigned long r7,
- struct pt_regs __regs);
+
+#ifdef CONFIG_SUPERH32
+#define BUILD_TRAP_HANDLER(name) \
+asmlinkage void name##_trap_handler(unsigned long r4, unsigned long r5, \
+ unsigned long r6, unsigned long r7, \
+ struct pt_regs __regs)
+
+#define TRAP_HANDLER_DECL \
+ struct pt_regs *regs = RELOC_HIDE(&__regs, 0); \
+ unsigned int vec = regs->tra;
+#else
+#define BUILD_TRAP_HANDLER(name) \
+asmlinkage void name##_trap_handler(unsigned int vec, struct pt_regs *regs)
+#define TRAP_HANDLER_DECL
+#endif
+
+BUILD_TRAP_HANDLER(address_error);
+BUILD_TRAP_HANDLER(debug);
+BUILD_TRAP_HANDLER(bug);
#define arch_align_stack(x) (x)