proc-macros.S 994 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /*
  2. * We need constants.h for:
  3. * VMA_VM_MM
  4. * VMA_VM_FLAGS
  5. * VM_EXEC
  6. */
  7. #include <asm/asm-offsets.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
  46. .macro crval, clear, mmuset, ucset
  47. #ifdef CONFIG_MMU
  48. .word \clear
  49. .word \mmuset
  50. #else
  51. .word \clear
  52. .word \ucset
  53. #endif
  54. .endm