entry-macro.S 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /*
  2. * arch/arm/mach-omap1/include/mach/entry-macro.S
  3. *
  4. * Low-level IRQ helper macros for OMAP-based platforms
  5. *
  6. * Copyright (C) 2009 Texas Instruments
  7. *
  8. * This file is licensed under the terms of the GNU General Public
  9. * License version 2. This program is licensed "as is" without any
  10. * warranty of any kind, whether express or implied.
  11. */
  12. #include <mach/hardware.h>
  13. #include <mach/io.h>
  14. #include <mach/irqs.h>
  15. #include <asm/hardware/gic.h>
  16. /*
  17. * We use __glue to avoid errors with multiple definitions of
  18. * .globl omap_irq_flags as it's included from entry-armv.S but not
  19. * from entry-common.S.
  20. */
  21. #ifdef __glue
  22. .pushsection .data
  23. .globl omap_irq_flags
  24. omap_irq_flags:
  25. .word 0
  26. .popsection
  27. #endif
  28. .macro disable_fiq
  29. .endm
  30. .macro get_irqnr_preamble, base, tmp
  31. .endm
  32. .macro arch_ret_to_user, tmp1, tmp2
  33. .endm
  34. .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
  35. ldr \base, =OMAP1_IO_ADDRESS(OMAP_IH1_BASE)
  36. ldr \irqnr, [\base, #IRQ_ITR_REG_OFFSET]
  37. ldr \tmp, [\base, #IRQ_MIR_REG_OFFSET]
  38. mov \irqstat, #0xffffffff
  39. bic \tmp, \irqstat, \tmp
  40. tst \irqnr, \tmp
  41. beq 1510f
  42. ldr \irqnr, [\base, #IRQ_SIR_FIQ_REG_OFFSET]
  43. ldr \tmp, =omap_irq_flags @ irq flags address
  44. ldr \tmp, [\tmp, #0] @ irq flags value
  45. cmp \irqnr, #0
  46. ldreq \irqnr, [\base, #IRQ_SIR_IRQ_REG_OFFSET]
  47. cmpeq \irqnr, \tmp
  48. ldreq \base, =OMAP1_IO_ADDRESS(OMAP_IH2_BASE)
  49. ldreq \irqnr, [\base, #IRQ_SIR_IRQ_REG_OFFSET]
  50. addeqs \irqnr, \irqnr, #32
  51. 1510:
  52. .endm