0001 #ifndef __NVIF_VMM_H__
0002 #define __NVIF_VMM_H__
0003 #include <nvif/object.h>
0004 struct nvif_mem;
0005 struct nvif_mmu;
0006
0007 enum nvif_vmm_get {
0008 ADDR,
0009 PTES,
0010 LAZY
0011 };
0012
0013 struct nvif_vma {
0014 u64 addr;
0015 u64 size;
0016 };
0017
0018 struct nvif_vmm {
0019 struct nvif_object object;
0020 u64 start;
0021 u64 limit;
0022
0023 struct {
0024 u8 shift;
0025 bool sparse:1;
0026 bool vram:1;
0027 bool host:1;
0028 bool comp:1;
0029 } *page;
0030 int page_nr;
0031 };
0032
0033 int nvif_vmm_ctor(struct nvif_mmu *, const char *name, s32 oclass, bool managed,
0034 u64 addr, u64 size, void *argv, u32 argc, struct nvif_vmm *);
0035 void nvif_vmm_dtor(struct nvif_vmm *);
0036 int nvif_vmm_get(struct nvif_vmm *, enum nvif_vmm_get, bool sparse,
0037 u8 page, u8 align, u64 size, struct nvif_vma *);
0038 void nvif_vmm_put(struct nvif_vmm *, struct nvif_vma *);
0039 int nvif_vmm_map(struct nvif_vmm *, u64 addr, u64 size, void *argv, u32 argc,
0040 struct nvif_mem *, u64 offset);
0041 int nvif_vmm_unmap(struct nvif_vmm *, u64);
0042 #endif