mipsIRQ.S 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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. jal spurious_interrupt
  43. nop
  44. j ret_from_irq
  45. END(cp0_irqdispatch)
  46. .align 5
  47. .set reorder
  48. ll_hw0_irq:
  49. li a0,2
  50. move a1,sp
  51. jal hw0_irqdispatch
  52. nop
  53. j ret_from_irq
  54. nop
  55. .align 5
  56. .set reorder
  57. ll_timer_irq:
  58. mfc0 t3,CP0_CONFIG,7
  59. andi t4,t3,0x01c0
  60. beqz t4,ll_timer_out
  61. nop
  62. li a0,7
  63. move a1,sp
  64. jal timer_irqdispatch
  65. nop
  66. ll_timer_out: j ret_from_irq
  67. nop