int-handler.S 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /*
  2. * This file is subject to the terms and conditions of the GNU General Public
  3. * License. See the file "COPYING" in the main directory of this archive
  4. * for more details.
  5. *
  6. * Copyright (C) 1995, 1996, 1997, 2003 by Ralf Baechle
  7. * Copyright (C) Wind River System Inc. Rongkai.Zhan <rongkai.zhan@windriver.com>
  8. */
  9. #include <asm/asm.h>
  10. #include <asm/mipsregs.h>
  11. #include <asm/addrspace.h>
  12. #include <asm/regdef.h>
  13. #include <asm/stackframe.h>
  14. #include <asm/mach-wrppmc/mach-gt64120.h>
  15. .align 5
  16. .set noat
  17. NESTED(handle_IRQ, PT_SIZE, sp)
  18. SAVE_ALL
  19. CLI # Important: mark KERNEL mode !
  20. .set at
  21. mfc0 t0, CP0_CAUSE # get pending interrupts
  22. mfc0 t1, CP0_STATUS # get enabled interrupts
  23. and t0, t0, t1 # get allowed interrupts
  24. andi t0, t0, 0xFF00
  25. beqz t0, 1f
  26. move a1, sp # Prepare 'struct pt_regs *regs' pointer
  27. andi t1, t0, CAUSEF_IP7 # CPU Compare/Count internal timer
  28. bnez t1, handle_cputimer_irq
  29. andi t1, t0, CAUSEF_IP6 # UART 16550 port
  30. bnez t1, handle_uart_irq
  31. andi t1, t0, CAUSEF_IP3 # PCI INT_A
  32. bnez t1, handle_pci_intA_irq
  33. /* wrong alarm or masked ... */
  34. 1: j spurious_interrupt
  35. nop
  36. END(handle_IRQ)
  37. .align 5
  38. handle_cputimer_irq:
  39. li a0, WRPPMC_MIPS_TIMER_IRQ
  40. jal do_IRQ
  41. j ret_from_irq
  42. .align 5
  43. handle_uart_irq:
  44. li a0, WRPPMC_UART16550_IRQ
  45. jal do_IRQ
  46. j ret_from_irq
  47. .align 5
  48. handle_pci_intA_irq:
  49. li a0, WRPPMC_PCI_INTA_IRQ
  50. jal do_IRQ
  51. j ret_from_irq