1 #ifndef __NVKM_BAR_H__
2 #define __NVKM_BAR_H__
3 #include <core/subdev.h>
4 struct nvkm_mem;
5 struct nvkm_vma;
6 
7 struct nvkm_bar {
8 	struct nvkm_subdev subdev;
9 
10 	struct nvkm_vm *(*kmap)(struct nvkm_bar *);
11 	int  (*umap)(struct nvkm_bar *, u64 size, int type, struct nvkm_vma *);
12 	void (*unmap)(struct nvkm_bar *, struct nvkm_vma *);
13 	void (*flush)(struct nvkm_bar *);
14 
15 	/* whether the BAR supports to be ioremapped WC or should be uncached */
16 	bool iomap_uncached;
17 };
18 
19 static inline struct nvkm_bar *
20 nvkm_bar(void *obj)
21 {
22 	return (void *)nvkm_subdev(obj, NVDEV_SUBDEV_BAR);
23 }
24 
25 extern struct nvkm_oclass nv50_bar_oclass;
26 extern struct nvkm_oclass gf100_bar_oclass;
27 extern struct nvkm_oclass gk20a_bar_oclass;
28 #endif
29