entry-macro.S 933 B

1234567891011121314151617181920212223242526272829303132333435
  1. /*
  2. * arch/arm/mach-kirkwood/include/mach/entry-macro.S
  3. *
  4. * Low-level IRQ helper macros for Marvell Kirkwood 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. bne 1001f
  21. @ if no low interrupts set, check high interrupts
  22. ldr \irqstat, [\base, #IRQ_CAUSE_HIGH_OFF]
  23. ldr \tmp, [\base, #IRQ_MASK_HIGH_OFF]
  24. mov \irqnr, #63
  25. ands \irqstat, \irqstat, \tmp
  26. @ find first active interrupt source
  27. 1001: clzne \irqstat, \irqstat
  28. subne \irqnr, \irqnr, \irqstat
  29. .endm