entry-macro.S 1022 B

1234567891011121314151617181920212223242526272829303132333435
  1. /*
  2. * arch/arm/mach-iop33x/include/mach/entry-macro.S
  3. *
  4. * Low-level IRQ helper macros for IOP33x-based platforms
  5. *
  6. * This file is licensed under the terms of the GNU General Public
  7. * License version 2. This program is licensed "as is" without any
  8. * warranty of any kind, whether express or implied.
  9. */
  10. #include <mach/iop33x.h>
  11. .macro get_irqnr_preamble, base, tmp
  12. mrc p15, 0, \tmp, c15, c1, 0
  13. orr \tmp, \tmp, #(1 << 6)
  14. mcr p15, 0, \tmp, c15, c1, 0 @ Enable cp6 access
  15. mrc p15, 0, \tmp, c15, c1, 0
  16. mov \tmp, \tmp
  17. sub pc, pc, #4 @ cp_wait
  18. .endm
  19. .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
  20. mrc p6, 0, \irqstat, c14, c0, 0 @ Read IINTVEC
  21. cmp \irqstat, #0
  22. mrceq p6, 0, \irqstat, c14, c0, 0 @ erratum 63 workaround
  23. adds \irqnr, \irqstat, #1
  24. movne \irqnr, \irqstat, lsr #2
  25. .endm
  26. .macro arch_ret_to_user, tmp1, tmp2
  27. mrc p15, 0, \tmp1, c15, c1, 0
  28. ands \tmp2, \tmp1, #(1 << 6)
  29. bicne \tmp1, \tmp1, #(1 << 6)
  30. mcrne p15, 0, \tmp1, c15, c1, 0 @ Disable cp6 access
  31. .endm