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

嵌入式Linux

开发平台:

Unix_Linux

  1. /*
  2.  * Copyright 2001 MontaVista Software Inc.
  3.  * Author: ppopov@mvista.com
  4.  *
  5.  * Interrupt dispatcher for Au1000 boards.
  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. .text
  19. .set macro
  20. .set noat
  21. .align 5
  22. NESTED(au1000_IRQ, PT_SIZE, sp)
  23. SAVE_ALL
  24. CLI # Important: mark KERNEL mode !
  25. mfc0 t0,CP0_CAUSE # get pending interrupts
  26. mfc0 t1,CP0_STATUS # get enabled interrupts
  27. and t0,t1 # isolate allowed ones
  28. andi t0,0xff00 # isolate pending bits
  29. beqz t0, 3f # spurious interrupt
  30. andi a0, t0, CAUSEF_IP7
  31. beq a0, zero, 1f
  32. move a0, sp
  33. jal mips_timer_interrupt
  34. j ret_from_irq
  35. 1:
  36. andi a0, t0, CAUSEF_IP2 # Interrupt Controller 0, Request 0
  37. beq a0, zero, 2f         
  38. move a0,sp  
  39. jal intc0_req0_irqdispatch
  40. j ret_from_irq
  41. 2:
  42. andi a0, t0, CAUSEF_IP3 # Interrupt Controller 0, Request 1
  43. beq a0, zero, 3f        
  44. move a0,sp  
  45. jal intc0_req1_irqdispatch
  46. j ret_from_irq
  47. 3:
  48. andi a0, t0, CAUSEF_IP4 # Interrupt Controller 1, Request 0
  49. beq a0, zero, 4f        
  50. move a0,sp  
  51. jal intc1_req0_irqdispatch
  52. j ret_from_irq
  53. 4:
  54. andi a0, t0, CAUSEF_IP5 # Interrupt Controller 1, Request 1
  55. beq a0, zero, 5f        
  56. move a0, sp  
  57. jal intc1_req1_irqdispatch
  58. j ret_from_irq
  59. 5:
  60. move a0, sp
  61. jal mips_spurious_interrupt
  62. done:
  63. j ret_from_irq
  64. END(au1000_IRQ)