entry-macro.S 1.3 KB

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