ip27-irq-glue.S
上传用户:jlfgdled
上传日期:2013-04-10
资源大小:33168k
文件大小:1k
源码类别:

Linux/Unix编程

开发平台:

Unix_Linux

  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) 1999 Ralf Baechle
  7.  * Copyright (C) 1999 Silicon Graphics, Inc.
  8.  */
  9. #include <asm/asm.h>
  10. #include <asm/mipsregs.h>
  11. #include <asm/regdef.h>
  12. #include <asm/stackframe.h>
  13. .text
  14. .set noat
  15. .align 5
  16. NESTED(ip27_irq, PT_SIZE, sp)
  17. SAVE_ALL
  18. CLI
  19. .set at
  20. /* IP27 may signal interrupt which we're not interested in.
  21.    Mask them out.  */
  22. mfc0 s0, CP0_CAUSE
  23. mfc0 t0, CP0_STATUS
  24. and s0, t0
  25. /* First check for RT interrupt.  */
  26. andi a0, s0, CAUSEF_IP4
  27. beqz a0, 1f
  28. /* Ok, a timer interrupt. */
  29. move a0, sp
  30. jal rt_timer_interrupt
  31. j ret_from_irq
  32. 1: andi a0, s0, (CAUSEF_IP2 | CAUSEF_IP3)
  33. beqz a0, 1f
  34. /* ... a device interrupt ...  */
  35. move a0, sp
  36. jal ip27_do_irq
  37. j ret_from_irq
  38. 1:
  39. #if 1
  40. mfc0 a1, CP0_STATUS
  41. srl a1, a1, 8
  42. andi a1, 0xff
  43. mfc0 a2, CP0_CAUSE
  44. srl a2, a2, 8
  45. andi a2, 0xff
  46. move a3, s0
  47. PRINT("Spurious interrupt, c0_status = %02x, c0_cause = %02x, pending %02x.n")
  48. ld a1, PT_EPC(sp)
  49. 0: b 0b
  50. #endif
  51. j ret_from_irq
  52. END(ip27_irq)