entry-macro.S 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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. #include <mach/hardware.h>
  11. #define AVIC_NIMASK 0x04
  12. @ this macro disables fast irq (not implemented)
  13. .macro disable_fiq
  14. .endm
  15. .macro get_irqnr_preamble, base, tmp
  16. ldr \base, =avic_base
  17. ldr \base, [\base]
  18. #ifdef CONFIG_MXC_IRQ_PRIOR
  19. ldr r4, [\base, #AVIC_NIMASK]
  20. #endif
  21. .endm
  22. .macro arch_ret_to_user, tmp1, tmp2
  23. .endm
  24. @ this macro checks which interrupt occured
  25. @ and returns its number in irqnr
  26. @ and returns if an interrupt occured in irqstat
  27. .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
  28. @ Load offset & priority of the highest priority
  29. @ interrupt pending from AVIC_NIVECSR
  30. ldr \irqstat, [\base, #0x40]
  31. @ Shift to get the decoded IRQ number, using ASR so
  32. @ 'no interrupt pending' becomes 0xffffffff
  33. mov \irqnr, \irqstat, asr #16
  34. @ set zero flag if IRQ + 1 == 0
  35. adds \tmp, \irqnr, #1
  36. #ifdef CONFIG_MXC_IRQ_PRIOR
  37. bicne \tmp, \irqstat, #0xFFFFFFE0
  38. strne \tmp, [\base, #AVIC_NIMASK]
  39. streq r4, [\base, #AVIC_NIMASK]
  40. #endif
  41. .endm
  42. @ irq priority table (not used)
  43. .macro irq_prio_table
  44. .endm