int-handler.S
上传用户:lgb322
上传日期:2013-02-24
资源大小:30529k
文件大小:3k
源码类别:

嵌入式Linux

开发平台:

Unix_Linux

  1. /*
  2.  * Copyright 2001 MontaVista Software Inc.
  3.  * Author: jsun@mvista.com or jsun@junsun.net
  4.  *
  5.  * First-level interrupt dispatcher for ocelot board.
  6.  *
  7.  * This program is free software; you can redistribute  it and/or modify it
  8.  * under  the terms of  the GNU General  Public License as published by the
  9.  * Free Software Foundation;  either version 2 of the  License, or (at your
  10.  * option) any later version.
  11.  */
  12. #include <linux/config.h>
  13. #include <asm/asm.h>
  14. #include <asm/mipsregs.h>
  15. #include <asm/addrspace.h>
  16. #include <asm/regdef.h>
  17. #include <asm/stackframe.h>
  18. /*
  19.  * first level interrupt dispatcher for ocelot board -
  20.  * We check for the timer first, then check PCI ints A and D.
  21.  * Then check for serial IRQ and fall through.
  22.  */
  23. .align 5
  24. NESTED(ocelot_handle_int, PT_SIZE, sp)
  25. SAVE_ALL
  26. CLI
  27. .set at
  28. mfc0 t0, CP0_CAUSE  
  29. mfc0 t2, CP0_STATUS
  30. and t0, t2
  31.         
  32.  andi t1, t0, STATUSF_IP2 /* int0 hardware line */
  33. bnez t1, ll_pri_enet_irq
  34.  andi t1, t0, STATUSF_IP3 /* int1 hardware line */
  35. bnez t1, ll_sec_enet_irq
  36.  andi t1, t0, STATUSF_IP4 /* int2 hardware line */
  37. bnez t1, ll_uart1_irq
  38.  andi t1, t0, STATUSF_IP5 /* int3 hardware line */
  39. bnez t1, ll_cpci_irq
  40.  andi t1, t0, STATUSF_IP6 /* int4 hardware line */
  41. bnez t1, ll_galileo_irq
  42.  andi t1, t0, STATUSF_IP7 /* cpu timer */
  43. bnez t1, ll_cputimer_irq
  44.                 /* now look at the extended interrupts */
  45. mfc0 t0, CP0_CAUSE  
  46. cfc0 t1, CP0_S1_INTCONTROL
  47. /* shift the mask 8 bits left to line up the bits */
  48.  sll t2, t1, 8
  49.  and t0, t2
  50.  srl t0, t0, 16
  51.  andi t1, t0, STATUSF_IP8 /* int6 hardware line */
  52. bnez t1, ll_pmc1_irq
  53.  andi t1, t0, STATUSF_IP9 /* int7 hardware line */
  54. bnez t1, ll_pmc2_irq
  55.  andi t1, t0, STATUSF_IP10 /* int8 hardware line */
  56. bnez t1, ll_cpci_abcd_irq
  57.  andi t1, t0, STATUSF_IP11 /* int9 hardware line */
  58. bnez t1, ll_uart2_irq
  59. .set reorder
  60. /* wrong alarm or masked ... */
  61. j spurious_interrupt
  62. nop
  63. END(ocelot_handle_int)
  64. .align 5
  65. ll_pri_enet_irq:
  66. li a0, 2
  67. move a1, sp
  68. jal do_IRQ
  69. j ret_from_irq
  70. ll_sec_enet_irq:
  71. li a0, 3
  72. move a1, sp
  73. jal do_IRQ
  74. j ret_from_irq
  75. ll_uart1_irq:
  76. li a0, 4
  77. move a1, sp
  78. jal do_IRQ
  79. j ret_from_irq
  80. ll_cpci_irq:
  81. li a0, 5
  82. move a1, sp
  83. jal do_IRQ
  84. j ret_from_irq
  85. ll_galileo_irq:
  86. li a0, 6
  87. move a1, sp
  88. jal do_IRQ
  89. j ret_from_irq
  90. ll_cputimer_irq:
  91. li a0, 7
  92. move a1, sp
  93. jal do_IRQ
  94. j ret_from_irq
  95. ll_pmc1_irq:
  96. li a0, 8
  97. move a1, sp
  98. jal do_IRQ
  99. j ret_from_irq
  100. ll_pmc2_irq:
  101. li a0, 9
  102. move a1, sp
  103. jal do_IRQ
  104. j ret_from_irq
  105. ll_cpci_abcd_irq:
  106. li a0, 10
  107. move a1, sp
  108. jal do_IRQ
  109. j ret_from_irq
  110. ll_uart2_irq:
  111. li a0, 11
  112. move a1, sp
  113. jal do_IRQ
  114. j ret_from_irq