bar.h 708 字节
Newer Older
1 2
#ifndef __NVKM_BAR_H__
#define __NVKM_BAR_H__
3
#include <core/subdev.h>
4 5
struct nvkm_mem;
struct nvkm_vma;
6

7
struct nvkm_bar {
B
Ben Skeggs 已提交
8
	struct nvkm_subdev subdev;
9

10 11
	struct nvkm_vm *(*kmap)(struct nvkm_bar *);
	int  (*umap)(struct nvkm_bar *, u64 size, int type, struct nvkm_vma *);
12 13
	void (*unmap)(struct nvkm_bar *, struct nvkm_vma *);
	void (*flush)(struct nvkm_bar *);
14 15 16

	/* whether the BAR supports to be ioremapped WC or should be uncached */
	bool iomap_uncached;
17 18
};

19 20
static inline struct nvkm_bar *
nvkm_bar(void *obj)
21
{
22
	return (void *)nvkm_subdev(obj, NVDEV_SUBDEV_BAR);
23 24
}

25 26 27
extern struct nvkm_oclass nv50_bar_oclass;
extern struct nvkm_oclass gf100_bar_oclass;
extern struct nvkm_oclass gk20a_bar_oclass;
28
#endif