mipsIRQ.S 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /*
  2. * Copyright (c) 2002 Philips, Inc. All rights.
  3. * Copyright (c) 2002 Red Hat, Inc. All rights.
  4. *
  5. * This software may be freely redistributed under the terms of the
  6. * GNU General Public License.
  7. *
  8. * You should have received a copy of the GNU General Public License
  9. * along with this program; if not, write to the Free Software
  10. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  11. *
  12. * Based upon arch/mips/galileo-boards/ev64240/int-handler.S
  13. *
  14. */
  15. #include <asm/asm.h>
  16. #include <asm/mipsregs.h>
  17. #include <asm/addrspace.h>
  18. #include <asm/regdef.h>
  19. #include <asm/stackframe.h>
  20. /*
  21. * cp0_irqdispatch
  22. *
  23. * Code to handle in-core interrupt exception.
  24. */
  25. .align 5
  26. .set reorder
  27. .set noat
  28. NESTED(cp0_irqdispatch, PT_SIZE, sp)
  29. SAVE_ALL
  30. CLI
  31. .set at
  32. mfc0 t0,CP0_CAUSE
  33. mfc0 t2,CP0_STATUS
  34. and t0,t2
  35. andi t1,t0,STATUSF_IP2 /* int0 hardware line */
  36. bnez t1,ll_hw0_irq
  37. nop
  38. andi t1,t0,STATUSF_IP7 /* int5 hardware line */
  39. bnez t1,ll_timer_irq
  40. nop
  41. /* wrong alarm or masked ... */
  42. j spurious_interrupt
  43. nop
  44. END(cp0_irqdispatch)
  45. .align 5
  46. .set reorder
  47. ll_hw0_irq:
  48. li a0,2
  49. move a1,sp
  50. jal hw0_irqdispatch
  51. nop
  52. j ret_from_irq
  53. nop
  54. .align 5
  55. .set reorder
  56. ll_timer_irq:
  57. mfc0 t3,CP0_CONFIG,7
  58. andi t4,t3,0x01c0
  59. beqz t4,ll_timer_out
  60. nop
  61. li a0,7
  62. move a1,sp
  63. jal timer_irqdispatch
  64. nop
  65. ll_timer_out: j ret_from_irq
  66. nop