entry-macro.S 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /*
  2. * Copyright (C) 2007 Lennert Buytenhek <buytenh@wantstofly.org>
  3. * Copyright 2004-2007 Freescale Semiconductor, Inc. All Rights Reserved.
  4. */
  5. /*
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License version 2 as
  8. * published by the Free Software Foundation.
  9. */
  10. #define AVIC_NIMASK 0x04
  11. @ this macro disables fast irq (not implemented)
  12. .macro disable_fiq
  13. .endm
  14. .macro get_irqnr_preamble, base, tmp
  15. ldr \base, =AVIC_IO_ADDRESS(AVIC_BASE_ADDR)
  16. #ifdef CONFIG_MXC_IRQ_PRIOR
  17. ldr r4, [\base, #AVIC_NIMASK]
  18. #endif
  19. .endm
  20. .macro arch_ret_to_user, tmp1, tmp2
  21. .endm
  22. @ this macro checks which interrupt occured
  23. @ and returns its number in irqnr
  24. @ and returns if an interrupt occured in irqstat
  25. .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
  26. @ Load offset & priority of the highest priority
  27. @ interrupt pending from AVIC_NIVECSR
  28. ldr \irqstat, [\base, #0x40]
  29. @ Shift to get the decoded IRQ number, using ASR so
  30. @ 'no interrupt pending' becomes 0xffffffff
  31. mov \irqnr, \irqstat, asr #16
  32. @ set zero flag if IRQ + 1 == 0
  33. adds \tmp, \irqnr, #1
  34. #ifdef CONFIG_MXC_IRQ_PRIOR
  35. bicne \tmp, \irqstat, #0xFFFFFFE0
  36. strne \tmp, [\base, #AVIC_NIMASK]
  37. streq r4, [\base, #AVIC_NIMASK]
  38. #endif
  39. .endm
  40. @ irq priority table (not used)
  41. .macro irq_prio_table
  42. .endm