ip32-irq-glue.S 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. /*
  2. * Low level interrupt handler for the SGI O2 aka IP32 aka Moosehead
  3. *
  4. * This file is subject to the terms and conditions of the GNU General Public
  5. * License. See the file "COPYING" in the main directory of this archive
  6. * for more details.
  7. *
  8. * Copyright (C) 2000 Harald Koerfgen
  9. * Copyright (C) 2001 Keith M Wesolowski
  10. */
  11. #include <asm/asm.h>
  12. #include <asm/regdef.h>
  13. #include <asm/mipsregs.h>
  14. #include <asm/stackframe.h>
  15. #include <asm/addrspace.h>
  16. .text
  17. .set noreorder
  18. .set noat
  19. .align 5
  20. NESTED(ip32_handle_int, PT_SIZE, ra)
  21. .set noat
  22. SAVE_ALL
  23. CLI # TEST: interrupts should be off
  24. .set at
  25. .set noreorder
  26. mfc0 s0,CP0_CAUSE
  27. andi t1, s0, IE_IRQ0
  28. bnez t1, handle_irq0
  29. andi t1, s0, IE_IRQ1
  30. bnez t1, handle_irq1
  31. andi t1, s0, IE_IRQ2
  32. bnez t1, handle_irq2
  33. andi t1, s0, IE_IRQ3
  34. bnez t1, handle_irq3
  35. andi t1, s0, IE_IRQ4
  36. bnez t1, handle_irq4
  37. andi t1, s0, IE_IRQ5
  38. bnez t1, handle_irq5
  39. nop
  40. /* Either someone has triggered the "software interrupts"
  41. * or we lost an interrupt somehow. Ignore it.
  42. */
  43. j ret_from_irq
  44. nop
  45. handle_irq0:
  46. jal ip32_irq0
  47. move a0, sp
  48. j ret_from_irq
  49. nop
  50. handle_irq1:
  51. jal ip32_irq1
  52. move a0, sp
  53. j ret_from_irq
  54. nop
  55. handle_irq2:
  56. jal ip32_irq2
  57. move a0, sp
  58. j ret_from_irq
  59. nop
  60. handle_irq3:
  61. jal ip32_irq3
  62. move a0, sp
  63. j ret_from_irq
  64. nop
  65. handle_irq4:
  66. jal ip32_irq4
  67. move a0, sp
  68. j ret_from_irq
  69. nop
  70. handle_irq5:
  71. jal ip32_irq5
  72. move a0, sp
  73. j ret_from_irq
  74. nop
  75. END(ip32_handle_int)