entry-macro-vic2.S 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /* arch/arm/include/asm/entry-macro-vic2.S
  2. *
  3. * Originally arch/arm/mach-s3c6400/include/mach/entry-macro.S
  4. *
  5. * Copyright 2008 Openmoko, Inc.
  6. * Copyright 2008 Simtec Electronics
  7. * http://armlinux.simtec.co.uk/
  8. * Ben Dooks <ben@simtec.co.uk>
  9. *
  10. * Low-level IRQ helper macros for a device with two VICs
  11. *
  12. * This file is licensed under the terms of the GNU General Public
  13. * License version 2. This program is licensed "as is" without any
  14. * warranty of any kind, whether express or implied.
  15. */
  16. /* This should be included from <mach/entry-macro.S> with the necessary
  17. * defines for virtual addresses and IRQ bases for the two vics.
  18. *
  19. * The code needs the following defined:
  20. * IRQ_VIC0_BASE IRQ number of VIC0's first IRQ
  21. * IRQ_VIC1_BASE IRQ number of VIC1's first IRQ
  22. * VA_VIC0 Virtual address of VIC0
  23. * VA_VIC1 Virtual address of VIC1
  24. *
  25. * Note, code assumes VIC0's virtual address is an ARM immediate constant
  26. * away from VIC1.
  27. */
  28. #include <asm/hardware/vic.h>
  29. .macro disable_fiq
  30. .endm
  31. .macro get_irqnr_preamble, base, tmp
  32. ldr \base, =VA_VIC0
  33. .endm
  34. .macro arch_ret_to_user, tmp1, tmp2
  35. .endm
  36. .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
  37. @ check the vic0
  38. mov \irqnr, #IRQ_VIC0_BASE + 31
  39. ldr \irqstat, [ \base, # VIC_IRQ_STATUS ]
  40. teq \irqstat, #0
  41. @ otherwise try vic1
  42. addeq \tmp, \base, #(VA_VIC1 - VA_VIC0)
  43. addeq \irqnr, \irqnr, #(IRQ_VIC1_BASE - IRQ_VIC0_BASE)
  44. ldreq \irqstat, [ \tmp, # VIC_IRQ_STATUS ]
  45. teqeq \irqstat, #0
  46. clzne \irqstat, \irqstat
  47. subne \irqnr, \irqnr, \irqstat
  48. .endm