mm.c 954 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. // SPDX-License-Identifier: GPL-2.0
  2. #include <linux/mm.h>
  3. #include <linux/sched/mm.h>
  4. __rust_helper void rust_helper_mmgrab(struct mm_struct *mm)
  5. {
  6. mmgrab(mm);
  7. }
  8. __rust_helper void rust_helper_mmdrop(struct mm_struct *mm)
  9. {
  10. mmdrop(mm);
  11. }
  12. __rust_helper void rust_helper_mmget(struct mm_struct *mm)
  13. {
  14. mmget(mm);
  15. }
  16. __rust_helper bool rust_helper_mmget_not_zero(struct mm_struct *mm)
  17. {
  18. return mmget_not_zero(mm);
  19. }
  20. __rust_helper void rust_helper_mmap_read_lock(struct mm_struct *mm)
  21. {
  22. mmap_read_lock(mm);
  23. }
  24. __rust_helper bool rust_helper_mmap_read_trylock(struct mm_struct *mm)
  25. {
  26. return mmap_read_trylock(mm);
  27. }
  28. __rust_helper void rust_helper_mmap_read_unlock(struct mm_struct *mm)
  29. {
  30. mmap_read_unlock(mm);
  31. }
  32. __rust_helper struct vm_area_struct *
  33. rust_helper_vma_lookup(struct mm_struct *mm, unsigned long addr)
  34. {
  35. return vma_lookup(mm, addr);
  36. }
  37. __rust_helper void rust_helper_vma_end_read(struct vm_area_struct *vma)
  38. {
  39. vma_end_read(vma);
  40. }