/arch/mips/momentum/jaguar_atx/int-handler.S

https://bitbucket.org/evzijst/gittest · Assembly · 128 lines · 89 code · 18 blank · 21 comment · 0 complexity · c33f5f29b21309ba04bd3ec5f6920b2b MD5 · raw file

  1. /*
  2. * Copyright 2002 Momentum Computer Inc.
  3. * Author: Matthew Dharm <mdharm@momenco.com>
  4. *
  5. * Based on work:
  6. * Copyright 2001 MontaVista Software Inc.
  7. * Author: jsun@mvista.com or jsun@junsun.net
  8. *
  9. * First-level interrupt dispatcher for Jaguar-ATX board.
  10. *
  11. * This program is free software; you can redistribute it and/or modify it
  12. * under the terms of the GNU General Public License as published by the
  13. * Free Software Foundation; either version 2 of the License, or (at your
  14. * option) any later version.
  15. */
  16. #include <asm/asm.h>
  17. #include <asm/mipsregs.h>
  18. #include <asm/addrspace.h>
  19. #include <asm/regdef.h>
  20. #include <asm/stackframe.h>
  21. /*
  22. * First level interrupt dispatcher for Ocelot-CS board
  23. */
  24. .align 5
  25. NESTED(jaguar_handle_int, PT_SIZE, sp)
  26. SAVE_ALL
  27. CLI
  28. .set at
  29. mfc0 t0, CP0_CAUSE
  30. mfc0 t2, CP0_STATUS
  31. and t0, t2
  32. andi t1, t0, STATUSF_IP0 /* sw0 software interrupt */
  33. bnez t1, ll_sw0_irq
  34. andi t1, t0, STATUSF_IP1 /* sw1 software interrupt */
  35. bnez t1, ll_sw1_irq
  36. andi t1, t0, STATUSF_IP2 /* int0 hardware line */
  37. bnez t1, ll_pcixa_irq
  38. andi t1, t0, STATUSF_IP3 /* int1 hardware line */
  39. bnez t1, ll_pcixb_irq
  40. andi t1, t0, STATUSF_IP4 /* int2 hardware line */
  41. bnez t1, ll_pcia_irq
  42. andi t1, t0, STATUSF_IP5 /* int3 hardware line */
  43. bnez t1, ll_pcib_irq
  44. andi t1, t0, STATUSF_IP6 /* int4 hardware line */
  45. bnez t1, ll_uart_irq
  46. andi t1, t0, STATUSF_IP7 /* cpu timer */
  47. bnez t1, ll_cputimer_irq
  48. nop
  49. nop
  50. /* now look at extended interrupts */
  51. mfc0 t0, CP0_CAUSE
  52. cfc0 t1, CP0_S1_INTCONTROL
  53. /* shift the mask 8 bits left to line up the bits */
  54. sll t2, t1, 8
  55. and t0, t2
  56. srl t0, t0, 16
  57. andi t1, t0, STATUSF_IP8 /* int6 hardware line */
  58. bnez t1, ll_mv64340_decode_irq
  59. nop
  60. nop
  61. .set reorder
  62. /* wrong alarm or masked ... */
  63. j spurious_interrupt
  64. nop
  65. END(jaguar_handle_int)
  66. .align 5
  67. ll_sw0_irq:
  68. li a0, 0
  69. move a1, sp
  70. jal do_IRQ
  71. j ret_from_irq
  72. ll_sw1_irq:
  73. li a0, 1
  74. move a1, sp
  75. jal do_IRQ
  76. j ret_from_irq
  77. ll_pcixa_irq:
  78. li a0, 2
  79. move a1, sp
  80. jal do_IRQ
  81. j ret_from_irq
  82. ll_pcixb_irq:
  83. li a0, 3
  84. move a1, sp
  85. jal do_IRQ
  86. j ret_from_irq
  87. ll_pcia_irq:
  88. li a0, 4
  89. move a1, sp
  90. jal do_IRQ
  91. j ret_from_irq
  92. ll_pcib_irq:
  93. li a0, 5
  94. move a1, sp
  95. jal do_IRQ
  96. j ret_from_irq
  97. ll_uart_irq:
  98. li a0, 6
  99. move a1, sp
  100. jal do_IRQ
  101. j ret_from_irq
  102. ll_cputimer_irq:
  103. li a0, 7
  104. move a1, sp
  105. jal ll_timer_interrupt
  106. j ret_from_irq
  107. ll_mv64340_decode_irq:
  108. move a0, sp
  109. jal ll_mv64340_irq
  110. j ret_from_irq