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

Linux/Unix编程

开发平台:

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 ddb5477
  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 <asm/asm.h>
  13. #include <asm/mipsregs.h>
  14. #include <asm/addrspace.h>
  15. #include <asm/regdef.h>
  16. #include <asm/stackframe.h>
  17. /*
  18.  * first level interrupt dispatcher for ocelot board -
  19.  * We check for the timer first, then check PCI ints A and D.
  20.  * Then check for serial IRQ and fall through.
  21.  */
  22. .align 5
  23. NESTED(ddb5477_handle_int, PT_SIZE, sp)
  24. SAVE_ALL
  25. CLI
  26. .set at
  27. .set noreorder
  28. mfc0 t0, CP0_CAUSE
  29. mfc0 t2, CP0_STATUS
  30. and t0, t2
  31. andi t1, t0, STATUSF_IP7 /* cpu timer */
  32. bnez t1, ll_cputimer_irq
  33. andi t1, t0, (STATUSF_IP2 | STATUSF_IP3 | STATUSF_IP4 | STATUSF_IP5 | STATUSF_IP6 )
  34. bnez t1, ll_vrc5477_irq
  35. andi t1, t0, STATUSF_IP0 /* software int 0 */
  36. bnez t1, ll_cpu_ip0
  37. andi t1, t0, STATUSF_IP1 /* software int 1 */
  38. bnez t1, ll_cpu_ip1
  39. nop
  40. .set reorder
  41. /* wrong alarm or masked ... */
  42. j spurious_interrupt
  43. nop
  44. END(ddb5477_handle_int)
  45. .align 5
  46. ll_vrc5477_irq:
  47. move a0, sp
  48. jal vrc5477_irq_dispatch
  49. j ret_from_irq
  50. ll_cputimer_irq:
  51. li a0, 7
  52. move a1, sp
  53. jal do_IRQ
  54. j ret_from_irq
  55. ll_cpu_ip0:
  56. li a0, 0
  57. move a1, sp
  58. jal do_IRQ
  59. j ret_from_irq
  60. ll_cpu_ip1:
  61. li a0, 1
  62. move a1, sp
  63. jal do_IRQ
  64. j ret_from_irq