aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorPaul Mundt2007-11-20 18:08:06 +0900
committerPaul Mundt2008-01-28 13:18:50 +0900
commit5a4f7c66be981c6b5f44a4d66a14ea6ac9b7b6b0 (patch)
treea605424a32ce11d189a1aa1385c3fc22f972449f /include
parent811d50cb43eb730cc325df0c6913556e25739797 (diff)
sh: Share bug/debug traps across _32 and _64.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'include')
-rw-r--r--include/asm-sh/ptrace.h2
-rw-r--r--include/asm-sh/system.h25
-rw-r--r--include/asm-sh/types.h6
3 files changed, 26 insertions, 7 deletions
diff --git a/include/asm-sh/ptrace.h b/include/asm-sh/ptrace.h
index a83a7b45ba6f..8d6c92b3e770 100644
--- a/include/asm-sh/ptrace.h
+++ b/include/asm-sh/ptrace.h
@@ -95,7 +95,7 @@ struct pt_dspregs {
#include <asm/addrspace.h>
#define user_mode(regs) (((regs)->sr & 0x40000000)==0)
-#define instruction_pointer(regs) ((regs)->pc)
+#define instruction_pointer(regs) ((unsigned long)(regs)->pc)
extern void show_regs(struct pt_regs *);
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)
diff --git a/include/asm-sh/types.h b/include/asm-sh/types.h
index 7ba69d9707ef..a6e1d4126e67 100644
--- a/include/asm-sh/types.h
+++ b/include/asm-sh/types.h
@@ -52,6 +52,12 @@ typedef unsigned long long u64;
typedef u32 dma_addr_t;
+#ifdef CONFIG_SUPERH32
+typedef u16 opcode_t;
+#else
+typedef u32 opcode_t;
+#endif
+
#endif /* __ASSEMBLY__ */
#endif /* __KERNEL__ */