xref: /linux/drivers/gpu/drm/nouveau/nvkm/subdev/instmem/priv.h (revision 0883c2c06fb5bcf5b9e008270827e63c09a88c1e)
1 #ifndef __NVKM_INSTMEM_PRIV_H__
2 #define __NVKM_INSTMEM_PRIV_H__
3 #define nvkm_instmem(p) container_of((p), struct nvkm_instmem, subdev)
4 #include <subdev/instmem.h>
5 
6 struct nvkm_instmem_func {
7 	void *(*dtor)(struct nvkm_instmem *);
8 	int (*oneinit)(struct nvkm_instmem *);
9 	void (*fini)(struct nvkm_instmem *);
10 	u32  (*rd32)(struct nvkm_instmem *, u32 addr);
11 	void (*wr32)(struct nvkm_instmem *, u32 addr, u32 data);
12 	int (*memory_new)(struct nvkm_instmem *, u32 size, u32 align,
13 			  bool zero, struct nvkm_memory **);
14 	bool persistent;
15 	bool zero;
16 };
17 
18 void nvkm_instmem_ctor(const struct nvkm_instmem_func *, struct nvkm_device *,
19 		       int index, struct nvkm_instmem *);
20 #endif
21