int-handler.S
上传用户:jlfgdled
上传日期:2013-04-10
资源大小:33168k
文件大小:2k
源码类别:

Linux/Unix编程

开发平台:

Unix_Linux

  1. /*
  2.  * SNI RM200 PCI specific interrupt handler code.
  3.  *
  4.  * Copyright (C) 1994, 95, 96, 97, 98, 1999, 2000, 01 by Ralf Baechle
  5.  */
  6. #include <asm/asm.h>
  7. #include <asm/mipsregs.h>
  8. #include <asm/regdef.h>
  9. #include <asm/sni.h>
  10. #include <asm/stackframe.h>
  11. /*
  12.  * The PCI ASIC has the nasty property that it may delay writes if it is busy.
  13.  * As a consequence from writes that have not graduated when we exit from the
  14.  * interrupt handler we might catch a spurious interrupt.  To avoid this we
  15.  * force the PCI ASIC to graduate all writes by executing a read from the
  16.  * PCI bus.
  17.  */
  18. .set noreorder
  19. .set noat
  20. .align 5
  21. NESTED(sni_rm200_pci_handle_int, PT_SIZE, sp)
  22. SAVE_ALL
  23. CLI
  24. .set at
  25. /* Blinken light ...  */
  26. lb t0, led_cache
  27. addiu t0, 1
  28. sb t0, led_cache
  29. sb t0, PCIMT_CSLED # write only register
  30. .data
  31. led_cache: .byte 0
  32. .text
  33. mfc0 t0, CP0_STATUS
  34. mfc0 t1, CP0_CAUSE
  35. and t0, t1
  36.  andi t1, t0, 0x4a00 # hardware interrupt 1
  37. bnez t1, _hwint134
  38.  andi t1, t0, 0x1000 # hardware interrupt 2
  39. bnez t1, _hwint2
  40.  andi t1, t0, 0x8000 # hardware interrupt 5
  41. bnez t1, _hwint5
  42.  andi t1, t0, 0x0400 # hardware interrupt 0
  43. bnez t1, _hwint0
  44.  nop
  45. j restore_all # spurious interrupt
  46.  nop
  47.  ##############################################################################
  48. /* hwint0 should deal with MP agent, ASIC PCI, EISA NMI and debug
  49.    button interrupts.  */
  50. _hwint0: jal pciasic_hwint0
  51.  move a1, sp
  52. /*
  53.  * hwint 1 deals with EISA and SCSI interrupts,
  54.  * hwint 3 should deal with the PCI A - D interrupts,
  55.  * hwint 4 is used for only the onboard PCnet 32.
  56.  */
  57. _hwint134: jal pciasic_hwint134
  58. /* This interrupt was used for the com1 console on the first prototypes.  */
  59. _hwint2: jal pciasic_hwint2
  60. /* hwint5 is the r4k count / compare interrupt  */
  61. _hwint5: jal pciasic_hwint5
  62. END(sni_rm200_pci_handle_int)