diff options
Diffstat (limited to 'drivers/gpu/nvgpu/boardobj/boardobj.h')
-rw-r--r-- | drivers/gpu/nvgpu/boardobj/boardobj.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/boardobj/boardobj.h b/drivers/gpu/nvgpu/boardobj/boardobj.h index 5c1b4b81..a433fda8 100644 --- a/drivers/gpu/nvgpu/boardobj/boardobj.h +++ b/drivers/gpu/nvgpu/boardobj/boardobj.h | |||
@@ -71,6 +71,8 @@ struct boardobj { | |||
71 | 71 | ||
72 | u8 type; /*type of the device*/ | 72 | u8 type; /*type of the device*/ |
73 | u8 idx; /*index of boardobj within in its group*/ | 73 | u8 idx; /*index of boardobj within in its group*/ |
74 | /* true if allocated in constructor. destructor should free */ | ||
75 | u8 allocated; | ||
74 | u32 type_mask; /*mask of types this boardobjimplements*/ | 76 | u32 type_mask; /*mask of types this boardobjimplements*/ |
75 | boardobj_implements *implements; | 77 | boardobj_implements *implements; |
76 | boardobj_destruct *destruct; | 78 | boardobj_destruct *destruct; |
@@ -79,6 +81,7 @@ struct boardobj { | |||
79 | * that inherit from BOARDOBJ | 81 | * that inherit from BOARDOBJ |
80 | */ | 82 | */ |
81 | boardobj_pmudatainit *pmudatainit; | 83 | boardobj_pmudatainit *pmudatainit; |
84 | struct nvgpu_list_node node; | ||
82 | }; | 85 | }; |
83 | 86 | ||
84 | boardobj_construct boardobj_construct_super; | 87 | boardobj_construct boardobj_construct_super; |
@@ -89,4 +92,11 @@ boardobj_pmudatainit boardobj_pmudatainit_super; | |||
89 | #define BOARDOBJ_GET_TYPE(pobj) (((struct boardobj *)(pobj))->type) | 92 | #define BOARDOBJ_GET_TYPE(pobj) (((struct boardobj *)(pobj))->type) |
90 | #define BOARDOBJ_GET_IDX(pobj) (((struct boardobj *)(pobj))->idx) | 93 | #define BOARDOBJ_GET_IDX(pobj) (((struct boardobj *)(pobj))->idx) |
91 | 94 | ||
95 | static inline struct boardobj * | ||
96 | boardobj_from_node(struct nvgpu_list_node *node) | ||
97 | { | ||
98 | return (struct boardobj *) | ||
99 | ((uintptr_t)node - offsetof(struct boardobj, node)); | ||
100 | }; | ||
101 | |||
92 | #endif | 102 | #endif |