entry-macro.S 917 B

12345678910111213141516171819202122232425262728293031323334
  1. /*
  2. * arch/arm/mach-dove/include/mach/entry-macro.S
  3. *
  4. * Low-level IRQ helper macros for Marvell Dove 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. #include <mach/bridge-regs.h>
  11. .macro get_irqnr_preamble, base, tmp
  12. ldr \base, =IRQ_VIRT_BASE
  13. .endm
  14. .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
  15. @ check low interrupts
  16. ldr \irqstat, [\base, #IRQ_CAUSE_LOW_OFF]
  17. ldr \tmp, [\base, #IRQ_MASK_LOW_OFF]
  18. mov \irqnr, #31
  19. ands \irqstat, \irqstat, \tmp
  20. @ if no low interrupts set, check high interrupts
  21. ldreq \irqstat, [\base, #IRQ_CAUSE_HIGH_OFF]
  22. ldreq \tmp, [\base, #IRQ_MASK_HIGH_OFF]
  23. moveq \irqnr, #63
  24. andeqs \irqstat, \irqstat, \tmp
  25. @ find first active interrupt source
  26. clzne \irqstat, \irqstat
  27. subne \irqnr, \irqnr, \irqstat
  28. .endm