blob: 17e129fe459c61bd30b417df5864fe88bb5972c8 [file] [log] [blame]
David Howellse839ca52012-03-28 18:30:03 +01001#ifndef __ASM_SH_TRAPS_32_H
2#define __ASM_SH_TRAPS_32_H
3
4#include <linux/types.h>
5#include <asm/mmu.h>
6
7#ifdef CONFIG_CPU_HAS_SR_RB
8#define lookup_exception_vector() \
9({ \
10 unsigned long _vec; \
11 \
12 __asm__ __volatile__ ( \
13 "stc r2_bank, %0\n\t" \
14 : "=r" (_vec) \
15 ); \
16 \
17 _vec; \
18})
19#else
20#define lookup_exception_vector() \
21({ \
22 unsigned long _vec; \
23 __asm__ __volatile__ ( \
24 "mov r4, %0\n\t" \
25 : "=r" (_vec) \
26 ); \
27 \
28 _vec; \
29})
30#endif
31
32static inline void trigger_address_error(void)
33{
34 __asm__ __volatile__ (
35 "ldc %0, sr\n\t"
36 "mov.l @%1, %0"
37 :
38 : "r" (0x10000000), "r" (0x80000001)
39 );
40}
41
42asmlinkage void do_address_error(struct pt_regs *regs,
43 unsigned long writeaccess,
44 unsigned long address);
Bobby Binghama3c19512014-04-03 14:46:41 -070045asmlinkage void do_divide_error(unsigned long r4);
46asmlinkage void do_reserved_inst(void);
47asmlinkage void do_illegal_slot_inst(void);
48asmlinkage void do_exception_error(void);
David Howellse839ca52012-03-28 18:30:03 +010049
50#define BUILD_TRAP_HANDLER(name) \
51asmlinkage void name##_trap_handler(unsigned long r4, unsigned long r5, \
52 unsigned long r6, unsigned long r7, \
53 struct pt_regs __regs)
54
55#define TRAP_HANDLER_DECL \
56 struct pt_regs *regs = RELOC_HIDE(&__regs, 0); \
57 unsigned int vec = regs->tra; \
58 (void)vec;
59
60#endif /* __ASM_SH_TRAPS_32_H */