int-handler.S 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. #include <asm/asm.h>
  2. #include <asm/mipsregs.h>
  3. #include <asm/regdef.h>
  4. #include <asm/stackframe.h>
  5. .text
  6. .set macro
  7. .set noat
  8. .align 5
  9. NESTED(it8172_IRQ, PT_SIZE, sp)
  10. SAVE_ALL
  11. CLI # Important: mark KERNEL mode !
  12. /* We're working with 'reorder' set at this point. */
  13. /*
  14. * Get pending interrupts
  15. */
  16. mfc0 t0,CP0_CAUSE # get pending interrupts
  17. mfc0 t1,CP0_STATUS # get enabled interrupts
  18. and t0,t1 # isolate allowed ones
  19. andi t0,0xff00 # isolate pending bits
  20. beqz t0, 3f # spurious interrupt
  21. andi a0, t0, CAUSEF_IP7
  22. beq a0, zero, 1f
  23. li a0, 127 # MIPS_CPU_TIMER_IRQ = (NR_IRQS-1)
  24. move a1, sp
  25. jal ll_timer_interrupt
  26. j ret_from_irq
  27. nop
  28. 1:
  29. andi a0, t0, CAUSEF_IP2 # the only int we expect at this time
  30. beq a0, zero, 3f
  31. move a0,sp
  32. jal it8172_hw0_irqdispatch
  33. mfc0 t0,CP0_STATUS # disable interrupts
  34. ori t0,1
  35. xori t0,1
  36. mtc0 t0,CP0_STATUS
  37. nop
  38. nop
  39. nop
  40. la a1, ret_from_irq
  41. jr a1
  42. nop
  43. 3:
  44. move a0, sp
  45. jal mips_spurious_interrupt
  46. nop
  47. la a1, ret_from_irq
  48. jr a1
  49. nop
  50. END(it8172_IRQ)