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