diff options
author | Paul Mundt <lethal@linux-sh.org> | 2008-09-21 12:00:23 +0900 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2008-09-21 12:00:23 +0900 |
commit | 4c59e2942e92d2d776bcd038604a5c3c1d56d3ac (patch) | |
tree | 56185c62c51852cf9c065b4d1b0313f69295bf27 /arch/sh/include | |
parent | 347cd34f4b32be30d2a6d92fe4d6eac04b00a637 (diff) | |
download | linux-4c59e2942e92d2d776bcd038604a5c3c1d56d3ac.tar.bz2 |
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')
-rw-r--r-- | arch/sh/include/asm/system_32.h | 25 |
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 { \ : "=&r" (__dummy)); \ } while (0) +#ifdef CONFIG_CPU_HAS_SR_RB +#define lookup_exception_vector() \ +({ \ + unsigned long _vec; \ + \ + __asm__ __volatile__ ( \ + "stc r2_bank, %0\n\t" \ + : "=r" (_vec) \ + ); \ + \ + _vec; \ +}) +#else +#define lookup_exception_vector() \ +({ \ + unsigned long _vec; \ + __asm__ __volatile__ ( \ + "mov r4, %0\n\t" \ + : "=r" (_vec) \ + ); \ + \ + _vec; \ +}) +#endif + int handle_unaligned_access(opcode_t instruction, struct pt_regs *regs, struct mem_access *ma); |