1 #ifndef __NVKM_PMU_PRIV_H__ 2 #define __NVKM_PMU_PRIV_H__ 3 4 #include <subdev/pmu.h> 5 #include <subdev/pmu/fuc/os.h> 6 7 #define nouveau_pmu_create(p, e, o, d) \ 8 nouveau_pmu_create_((p), (e), (o), sizeof(**d), (void **)d) 9 #define nouveau_pmu_destroy(p) \ 10 nouveau_subdev_destroy(&(p)->base) 11 #define nouveau_pmu_init(p) ({ \ 12 struct nouveau_pmu *_pmu = (p); \ 13 _nouveau_pmu_init(nv_object(_pmu)); \ 14 }) 15 #define nouveau_pmu_fini(p,s) ({ \ 16 struct nouveau_pmu *_pmu = (p); \ 17 _nouveau_pmu_fini(nv_object(_pmu), (s)); \ 18 }) 19 20 int nouveau_pmu_create_(struct nouveau_object *, struct nouveau_object *, 21 struct nouveau_oclass *, int, void **); 22 23 int _nouveau_pmu_ctor(struct nouveau_object *, struct nouveau_object *, 24 struct nouveau_oclass *, void *, u32, 25 struct nouveau_object **); 26 #define _nouveau_pmu_dtor _nouveau_subdev_dtor 27 int _nouveau_pmu_init(struct nouveau_object *); 28 int _nouveau_pmu_fini(struct nouveau_object *, bool); 29 void nouveau_pmu_pgob(struct nouveau_pmu *pmu, bool enable); 30 31 struct nvkm_pmu_impl { 32 struct nouveau_oclass base; 33 struct { 34 u32 *data; 35 u32 size; 36 } code; 37 struct { 38 u32 *data; 39 u32 size; 40 } data; 41 42 void (*pgob)(struct nouveau_pmu *, bool); 43 }; 44 45 #endif 46