entry-macro.S 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. /*
  2. * Low-level IRQ helper macros for TI DaVinci-based platforms
  3. *
  4. * Author: Kevin Hilman, MontaVista Software, Inc. <source@mvista.com>
  5. *
  6. * 2007 (c) MontaVista Software, Inc. This file is licensed under
  7. * the terms of the GNU General Public License version 2. This program
  8. * is licensed "as is" without any warranty of any kind, whether express
  9. * or implied.
  10. */
  11. #include <mach/irqs.h>
  12. .macro get_irqnr_preamble, base, tmp
  13. ldr \base, =davinci_intc_base
  14. ldr \base, [\base]
  15. .endm
  16. .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
  17. #if defined(CONFIG_AINTC) && defined(CONFIG_CP_INTC)
  18. ldr \tmp, =davinci_intc_type
  19. ldr \tmp, [\tmp]
  20. cmp \tmp, #DAVINCI_INTC_TYPE_CP_INTC
  21. beq 1001f
  22. #endif
  23. #if defined(CONFIG_AINTC)
  24. ldr \tmp, [\base, #0x14]
  25. movs \tmp, \tmp, lsr #2
  26. sub \irqnr, \tmp, #1
  27. b 1002f
  28. #endif
  29. #if defined(CONFIG_CP_INTC)
  30. 1001: ldr \irqnr, [\base, #0x80] /* get irq number */
  31. mov \tmp, \irqnr, lsr #31
  32. and \irqnr, \irqnr, #0xff /* irq is in bits 0-9 */
  33. and \tmp, \tmp, #0x1
  34. cmp \tmp, #0x1
  35. #endif
  36. 1002:
  37. .endm