int-handler.S 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. /*
  2. * int-handler.S
  3. *
  4. * Based on the cobalt handler.
  5. */
  6. #include <asm/asm.h>
  7. #include <asm/mipsregs.h>
  8. #include <asm/addrspace.h>
  9. #include <asm/regdef.h>
  10. #include <asm/stackframe.h>
  11. /*
  12. * galileo_handle_int -
  13. * We check for the timer first, then check PCI ints A and D.
  14. * Then check for serial IRQ and fall through.
  15. */
  16. .align 5
  17. .set reorder
  18. .set noat
  19. NESTED(galileo_handle_int, PT_SIZE, sp)
  20. SAVE_ALL
  21. CLI
  22. .set at
  23. mfc0 t0,CP0_CAUSE
  24. mfc0 t2,CP0_STATUS
  25. and t0,t2
  26. andi t1,t0,STATUSF_IP4 /* int2 hardware line (timer) */
  27. bnez t1,ll_gt64120_irq
  28. andi t1,t0,STATUSF_IP2 /* int0 hardware line */
  29. bnez t1,ll_pci_intA
  30. andi t1,t0,STATUSF_IP5 /* int3 hardware line */
  31. bnez t1,ll_pci_intD
  32. andi t1,t0,STATUSF_IP6 /* int4 hardware line */
  33. bnez t1,ll_serial_irq
  34. andi t1,t0,STATUSF_IP7 /* compare int */
  35. bnez t1,ll_compare_irq
  36. nop
  37. /* wrong alarm or masked ... */
  38. j spurious_interrupt
  39. nop
  40. END(galileo_handle_int)
  41. .align 5
  42. .set reorder
  43. ll_gt64120_irq:
  44. li a0,4
  45. move a1,sp
  46. jal do_IRQ
  47. nop
  48. j ret_from_irq
  49. nop
  50. .align 5
  51. .set reorder
  52. ll_compare_irq:
  53. li a0,7
  54. move a1,sp
  55. jal do_IRQ
  56. nop
  57. j ret_from_irq
  58. nop
  59. .align 5
  60. .set reorder
  61. ll_pci_intA:
  62. move a0,sp
  63. jal pci_intA
  64. nop
  65. j ret_from_irq
  66. nop
  67. #if 0
  68. .align 5
  69. .set reorder
  70. ll_pci_intB:
  71. move a0,sp
  72. jal pci_intB
  73. nop
  74. j ret_from_irq
  75. nop
  76. .align 5
  77. .set reorder
  78. ll_pci_intC:
  79. move a0,sp
  80. jal pci_intC
  81. nop
  82. j ret_from_irq
  83. nop
  84. #endif
  85. .align 5
  86. .set reorder
  87. ll_pci_intD:
  88. move a0,sp
  89. jal pci_intD
  90. nop
  91. j ret_from_irq
  92. nop
  93. .align 5
  94. .set reorder
  95. ll_serial_irq:
  96. li a0,6
  97. move a1,sp
  98. jal do_IRQ
  99. nop
  100. j ret_from_irq
  101. nop