entry-macro.S 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /*
  2. * arch/arm/mach-ixp4xx/include/mach/entry-macro.S
  3. *
  4. * Low-level IRQ helper macros for IXP4xx-based 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/hardware.h>
  11. .macro get_irqnr_preamble, base, tmp
  12. .endm
  13. .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
  14. ldr \irqstat, =(IXP4XX_INTC_BASE_VIRT+IXP4XX_ICIP_OFFSET)
  15. ldr \irqstat, [\irqstat] @ get interrupts
  16. cmp \irqstat, #0
  17. beq 1001f @ upper IRQ?
  18. clz \irqnr, \irqstat
  19. mov \base, #31
  20. sub \irqnr, \base, \irqnr
  21. b 1002f @ lower IRQ being
  22. @ handled
  23. 1001:
  24. /*
  25. * IXP465/IXP435 has an upper IRQ status register
  26. */
  27. #if defined(CONFIG_CPU_IXP46X) || defined(CONFIG_CPU_IXP43X)
  28. ldr \irqstat, =(IXP4XX_INTC_BASE_VIRT+IXP4XX_ICIP2_OFFSET)
  29. ldr \irqstat, [\irqstat] @ get upper interrupts
  30. mov \irqnr, #63
  31. clz \irqstat, \irqstat
  32. cmp \irqstat, #32
  33. subne \irqnr, \irqnr, \irqstat
  34. #endif
  35. 1002:
  36. .endm