1 #ifndef __NVKM_PMU_PRIV_H__ 2 #define __NVKM_PMU_PRIV_H__ 3 #include <subdev/pmu.h> 4 #include <subdev/pmu/fuc/os.h> 5 6 #define nvkm_pmu_create(p, e, o, d) \ 7 nvkm_pmu_create_((p), (e), (o), sizeof(**d), (void **)d) 8 #define nvkm_pmu_destroy(p) \ 9 nvkm_subdev_destroy(&(p)->base) 10 #define nvkm_pmu_init(p) ({ \ 11 struct nvkm_pmu *_pmu = (p); \ 12 _nvkm_pmu_init(nv_object(_pmu)); \ 13 }) 14 #define nvkm_pmu_fini(p,s) ({ \ 15 struct nvkm_pmu *_pmu = (p); \ 16 _nvkm_pmu_fini(nv_object(_pmu), (s)); \ 17 }) 18 19 int nvkm_pmu_create_(struct nvkm_object *, struct nvkm_object *, 20 struct nvkm_oclass *, int, void **); 21 22 int _nvkm_pmu_ctor(struct nvkm_object *, struct nvkm_object *, 23 struct nvkm_oclass *, void *, u32, 24 struct nvkm_object **); 25 #define _nvkm_pmu_dtor _nvkm_subdev_dtor 26 int _nvkm_pmu_init(struct nvkm_object *); 27 int _nvkm_pmu_fini(struct nvkm_object *, bool); 28 void nvkm_pmu_pgob(struct nvkm_pmu *pmu, bool enable); 29 30 struct nvkm_pmu_impl { 31 struct nvkm_oclass base; 32 struct { 33 u32 *data; 34 u32 size; 35 } code; 36 struct { 37 u32 *data; 38 u32 size; 39 } data; 40 41 void (*pgob)(struct nvkm_pmu *, bool); 42 }; 43 #endif 44