2013-12-22 22:39:47 +08:00
|
|
|
#ifndef __NVKM_INSTMEM_PRIV_H__
|
|
|
|
#define __NVKM_INSTMEM_PRIV_H__
|
|
|
|
#include <subdev/instmem.h>
|
|
|
|
|
2015-01-14 13:05:26 +08:00
|
|
|
struct nvkm_instobj_impl {
|
|
|
|
struct nvkm_oclass base;
|
2013-12-22 23:08:00 +08:00
|
|
|
};
|
|
|
|
|
2015-01-14 13:05:26 +08:00
|
|
|
struct nvkm_instobj_args {
|
2013-12-22 23:08:00 +08:00
|
|
|
u32 size;
|
|
|
|
u32 align;
|
|
|
|
};
|
|
|
|
|
2015-01-14 13:05:26 +08:00
|
|
|
#define nvkm_instobj_create(p,e,o,d) \
|
|
|
|
nvkm_instobj_create_((p), (e), (o), sizeof(**d), (void **)d)
|
|
|
|
#define nvkm_instobj_destroy(p) ({ \
|
|
|
|
struct nvkm_instobj *iobj = (p); \
|
|
|
|
_nvkm_instobj_dtor(nv_object(iobj)); \
|
2013-12-22 23:08:00 +08:00
|
|
|
})
|
2015-01-14 13:05:26 +08:00
|
|
|
#define nvkm_instobj_init(p) \
|
|
|
|
nvkm_object_init(&(p)->base)
|
|
|
|
#define nvkm_instobj_fini(p,s) \
|
|
|
|
nvkm_object_fini(&(p)->base, (s))
|
|
|
|
|
|
|
|
int nvkm_instobj_create_(struct nvkm_object *, struct nvkm_object *,
|
|
|
|
struct nvkm_oclass *, int, void **);
|
|
|
|
void _nvkm_instobj_dtor(struct nvkm_object *);
|
|
|
|
#define _nvkm_instobj_init nvkm_object_init
|
|
|
|
#define _nvkm_instobj_fini nvkm_object_fini
|
|
|
|
|
|
|
|
struct nvkm_instmem_impl {
|
|
|
|
struct nvkm_oclass base;
|
|
|
|
struct nvkm_oclass *instobj;
|
2013-12-22 22:39:47 +08:00
|
|
|
};
|
|
|
|
|
2015-01-14 13:05:26 +08:00
|
|
|
#define nvkm_instmem_create(p,e,o,d) \
|
|
|
|
nvkm_instmem_create_((p), (e), (o), sizeof(**d), (void **)d)
|
|
|
|
#define nvkm_instmem_destroy(p) \
|
|
|
|
nvkm_subdev_destroy(&(p)->base)
|
|
|
|
#define nvkm_instmem_init(p) ({ \
|
|
|
|
struct nvkm_instmem *imem = (p); \
|
|
|
|
_nvkm_instmem_init(nv_object(imem)); \
|
2013-12-22 22:39:47 +08:00
|
|
|
})
|
2015-01-14 13:05:26 +08:00
|
|
|
#define nvkm_instmem_fini(p,s) ({ \
|
|
|
|
struct nvkm_instmem *imem = (p); \
|
|
|
|
_nvkm_instmem_fini(nv_object(imem), (s)); \
|
2013-12-22 22:39:47 +08:00
|
|
|
})
|
|
|
|
|
2015-01-14 13:05:26 +08:00
|
|
|
int nvkm_instmem_create_(struct nvkm_object *, struct nvkm_object *,
|
|
|
|
struct nvkm_oclass *, int, void **);
|
|
|
|
#define _nvkm_instmem_dtor _nvkm_subdev_dtor
|
|
|
|
int _nvkm_instmem_init(struct nvkm_object *);
|
|
|
|
int _nvkm_instmem_fini(struct nvkm_object *, bool);
|
2013-12-22 22:39:47 +08:00
|
|
|
#endif
|