vmm.h 872 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #ifndef __NVIF_VMM_H__
  2. #define __NVIF_VMM_H__
  3. #include <nvif/object.h>
  4. struct nvif_mem;
  5. struct nvif_mmu;
  6. enum nvif_vmm_get {
  7. ADDR,
  8. PTES,
  9. LAZY
  10. };
  11. struct nvif_vma {
  12. u64 addr;
  13. u64 size;
  14. };
  15. struct nvif_vmm {
  16. struct nvif_object object;
  17. u64 start;
  18. u64 limit;
  19. struct {
  20. u8 shift;
  21. bool sparse:1;
  22. bool vram:1;
  23. bool host:1;
  24. bool comp:1;
  25. } *page;
  26. int page_nr;
  27. };
  28. int nvif_vmm_init(struct nvif_mmu *, s32 oclass, u64 addr, u64 size,
  29. void *argv, u32 argc, struct nvif_vmm *);
  30. void nvif_vmm_fini(struct nvif_vmm *);
  31. int nvif_vmm_get(struct nvif_vmm *, enum nvif_vmm_get, bool sparse,
  32. u8 page, u8 align, u64 size, struct nvif_vma *);
  33. void nvif_vmm_put(struct nvif_vmm *, struct nvif_vma *);
  34. int nvif_vmm_map(struct nvif_vmm *, u64 addr, u64 size, void *argv, u32 argc,
  35. struct nvif_mem *, u64 offset);
  36. int nvif_vmm_unmap(struct nvif_vmm *, u64);
  37. #endif