entry-macro.S 1011 B

123456789101112131415161718192021222324252627282930313233343536
  1. /*
  2. * include/asm-arm/arch-integrator/entry-macro.S
  3. *
  4. * Low-level IRQ helper macros for Integrator platforms
  5. *
  6. * This file is licensed under the terms of the GNU General Public
  7. * License version 2. This program is licensed "as is" without any
  8. * warranty of any kind, whether express or implied.
  9. */
  10. .macro disable_fiq
  11. .endm
  12. .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
  13. /* FIXME: should not be using soo many LDRs here */
  14. ldr \base, =IO_ADDRESS(INTEGRATOR_IC_BASE)
  15. mov \irqnr, #IRQ_PIC_START
  16. ldr \irqstat, [\base, #IRQ_STATUS] @ get masked status
  17. ldr \base, =IO_ADDRESS(INTEGRATOR_HDR_BASE)
  18. teq \irqstat, #0
  19. ldreq \irqstat, [\base, #(INTEGRATOR_HDR_IC_OFFSET+IRQ_STATUS)]
  20. moveq \irqnr, #IRQ_CIC_START
  21. 1001: tst \irqstat, #15
  22. bne 1002f
  23. add \irqnr, \irqnr, #4
  24. movs \irqstat, \irqstat, lsr #4
  25. bne 1001b
  26. 1002: tst \irqstat, #1
  27. bne 1003f
  28. add \irqnr, \irqnr, #1
  29. movs \irqstat, \irqstat, lsr #1
  30. bne 1002b
  31. 1003: /* EQ will be set if no irqs pending */
  32. .endm