aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/include/asm/system_32.h
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2008-09-20 23:00:23 -0400
committerPaul Mundt <lethal@linux-sh.org>2008-09-20 23:00:23 -0400
commit4c59e2942e92d2d776bcd038604a5c3c1d56d3ac (patch)
tree56185c62c51852cf9c065b4d1b0313f69295bf27 /arch/sh/include/asm/system_32.h
parent347cd34f4b32be30d2a6d92fe4d6eac04b00a637 (diff)
sh: Move lookup_exception_vector() out to asm/system_32.h.
There are other places where we want to have access to the trap/exception number, so move out the lookup_exception_vector() helper. While we're at it, refactor it slightly to return the vector instead. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/include/asm/system_32.h')
-rw-r--r--arch/sh/include/asm/system_32.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/arch/sh/include/asm/system_32.h b/arch/sh/include/asm/system_32.h
index f7f105627fd9..a726d5d07277 100644
--- a/arch/sh/include/asm/system_32.h
+++ b/arch/sh/include/asm/system_32.h
@@ -97,6 +97,31 @@ do { \
97 : "=&r" (__dummy)); \ 97 : "=&r" (__dummy)); \
98} while (0) 98} while (0)
99 99
100#ifdef CONFIG_CPU_HAS_SR_RB
101#define lookup_exception_vector() \
102({ \
103 unsigned long _vec; \
104 \
105 __asm__ __volatile__ ( \
106 "stc r2_bank, %0\n\t" \
107 : "=r" (_vec) \
108 ); \
109 \
110 _vec; \
111})
112#else
113#define lookup_exception_vector() \
114({ \
115 unsigned long _vec; \
116 __asm__ __volatile__ ( \
117 "mov r4, %0\n\t" \
118 : "=r" (_vec) \
119 ); \
120 \
121 _vec; \
122})
123#endif
124
100int handle_unaligned_access(opcode_t instruction, struct pt_regs *regs, 125int handle_unaligned_access(opcode_t instruction, struct pt_regs *regs,
101 struct mem_access *ma); 126 struct mem_access *ma);
102 127