intv.S 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. /*
  2. * arch/v850/kernel/intv.S -- Interrupt vectors
  3. *
  4. * Copyright (C) 2001,02,03 NEC Electronics Corporation
  5. * Copyright (C) 2001,02,03 Miles Bader <miles@gnu.org>
  6. *
  7. * This file is subject to the terms and conditions of the GNU General
  8. * Public License. See the file COPYING in the main directory of this
  9. * archive for more details.
  10. *
  11. * Written by Miles Bader <miles@gnu.org>
  12. */
  13. #include <asm/clinkage.h>
  14. #include <asm/irq.h>
  15. #include <asm/machdep.h>
  16. #include <asm/entry.h>
  17. #ifdef CONFIG_V850E_HIGHRES_TIMER
  18. #include <asm/highres_timer.h>
  19. #endif
  20. /* Jump to an interrupt/trap handler. These handlers (defined in entry.S)
  21. expect the stack-pointer to be saved in ENTRY_SP, so we use sp to do an
  22. indirect jump (which avoids problems when the handler is more than a signed
  23. 22-bit offset away). */
  24. #define JUMP_TO_HANDLER(name, sp_save_loc) \
  25. st.w sp, sp_save_loc; \
  26. mov hilo(name), sp; \
  27. jmp [sp]
  28. /* Reset vector. */
  29. .section .intv.reset, "ax"
  30. .org 0x0
  31. mov hilo(C_SYMBOL_NAME(start)), r1;
  32. jmp [r1]
  33. /* Generic interrupt vectors. */
  34. .section .intv.common, "ax"
  35. .balign 0x10
  36. JUMP_TO_HANDLER (nmi, NMI_ENTRY_SP) // 0x10 - NMI0
  37. .balign 0x10
  38. JUMP_TO_HANDLER (nmi, NMI_ENTRY_SP) // 0x20 - NMI1
  39. .balign 0x10
  40. JUMP_TO_HANDLER (nmi, NMI_ENTRY_SP) // 0x30 - NMI2
  41. .balign 0x10
  42. JUMP_TO_HANDLER (trap, ENTRY_SP) // 0x40 - TRAP0n
  43. .balign 0x10
  44. JUMP_TO_HANDLER (trap, ENTRY_SP) // 0x50 - TRAP1n
  45. .balign 0x10
  46. JUMP_TO_HANDLER (dbtrap, ENTRY_SP) // 0x60 - Illegal op / DBTRAP insn
  47. /* Hardware interrupt vectors. */
  48. .section .intv.mach, "ax"
  49. .org 0x0
  50. #if defined (CONFIG_V850E_HIGHRES_TIMER) && defined (IRQ_INTCMD)
  51. /* Interrupts before the highres timer interrupt. */
  52. .rept IRQ_INTCMD (HIGHRES_TIMER_TIMER_D_UNIT)
  53. .balign 0x10
  54. JUMP_TO_HANDLER (irq, ENTRY_SP)
  55. .endr
  56. /* The highres timer interrupt. */
  57. .balign 0x10
  58. JUMP_TO_HANDLER (C_SYMBOL_NAME (highres_timer_slow_tick_irq), ENTRY_SP)
  59. /* Interrupts after the highres timer interrupt. */
  60. .rept NUM_CPU_IRQS - IRQ_INTCMD (HIGHRES_TIMER_TIMER_D_UNIT) - 1
  61. .balign 0x10
  62. JUMP_TO_HANDLER (irq, ENTRY_SP)
  63. .endr
  64. #else /* No highres timer */
  65. .rept NUM_CPU_IRQS
  66. .balign 0x10
  67. JUMP_TO_HANDLER (irq, ENTRY_SP)
  68. .endr
  69. #endif /* Highres timer */