traps_32.h 1.3 KB

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