proc-macros.S 860 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /*
  2. * We need constants.h for:
  3. * VMA_VM_MM
  4. * VMA_VM_FLAGS
  5. * VM_EXEC
  6. */
  7. #include <asm/constants.h>
  8. #include <asm/thread_info.h>
  9. /*
  10. * vma_vm_mm - get mm pointer from vma pointer (vma->vm_mm)
  11. */
  12. .macro vma_vm_mm, rd, rn
  13. ldr \rd, [\rn, #VMA_VM_MM]
  14. .endm
  15. /*
  16. * vma_vm_flags - get vma->vm_flags
  17. */
  18. .macro vma_vm_flags, rd, rn
  19. ldr \rd, [\rn, #VMA_VM_FLAGS]
  20. .endm
  21. .macro tsk_mm, rd, rn
  22. ldr \rd, [\rn, #TI_TASK]
  23. ldr \rd, [\rd, #TSK_ACTIVE_MM]
  24. .endm
  25. /*
  26. * act_mm - get current->active_mm
  27. */
  28. .macro act_mm, rd
  29. bic \rd, sp, #8128
  30. bic \rd, \rd, #63
  31. ldr \rd, [\rd, #TI_TASK]
  32. ldr \rd, [\rd, #TSK_ACTIVE_MM]
  33. .endm
  34. /*
  35. * mmid - get context id from mm pointer (mm->context.id)
  36. */
  37. .macro mmid, rd, rn
  38. ldr \rd, [\rn, #MM_CONTEXT_ID]
  39. .endm
  40. /*
  41. * mask_asid - mask the ASID from the context ID
  42. */
  43. .macro asid, rd, rn
  44. and \rd, \rn, #255
  45. .endm