1 #define NVOC_EVENT_H_PRIVATE_ACCESS_ALLOWED
2 #include "nvoc/runtime.h"
3 #include "nvoc/rtti.h"
4 #include "nvtypes.h"
5 #include "nvport/nvport.h"
6 #include "nvport/inline/util_valist.h"
7 #include "utils/nvassert.h"
8 #include "g_event_nvoc.h"
9 
10 #ifdef DEBUG
11 char __nvoc_class_id_uniqueness_check_0xd5f150 = 1;
12 #endif
13 
14 extern const struct NVOC_CLASS_DEF __nvoc_class_def_NotifShare;
15 
16 extern const struct NVOC_CLASS_DEF __nvoc_class_def_Object;
17 
18 extern const struct NVOC_CLASS_DEF __nvoc_class_def_RsShared;
19 
20 void __nvoc_init_NotifShare(NotifShare*);
21 void __nvoc_init_funcTable_NotifShare(NotifShare*);
22 NV_STATUS __nvoc_ctor_NotifShare(NotifShare*);
23 void __nvoc_init_dataField_NotifShare(NotifShare*);
24 void __nvoc_dtor_NotifShare(NotifShare*);
25 extern const struct NVOC_EXPORT_INFO __nvoc_export_info_NotifShare;
26 
27 static const struct NVOC_RTTI __nvoc_rtti_NotifShare_NotifShare = {
28     /*pClassDef=*/          &__nvoc_class_def_NotifShare,
29     /*dtor=*/               (NVOC_DYNAMIC_DTOR) &__nvoc_dtor_NotifShare,
30     /*offset=*/             0,
31 };
32 
33 static const struct NVOC_RTTI __nvoc_rtti_NotifShare_Object = {
34     /*pClassDef=*/          &__nvoc_class_def_Object,
35     /*dtor=*/               &__nvoc_destructFromBase,
36     /*offset=*/             NV_OFFSETOF(NotifShare, __nvoc_base_RsShared.__nvoc_base_Object),
37 };
38 
39 static const struct NVOC_RTTI __nvoc_rtti_NotifShare_RsShared = {
40     /*pClassDef=*/          &__nvoc_class_def_RsShared,
41     /*dtor=*/               &__nvoc_destructFromBase,
42     /*offset=*/             NV_OFFSETOF(NotifShare, __nvoc_base_RsShared),
43 };
44 
45 static const struct NVOC_CASTINFO __nvoc_castinfo_NotifShare = {
46     /*numRelatives=*/       3,
47     /*relatives=*/ {
48         &__nvoc_rtti_NotifShare_NotifShare,
49         &__nvoc_rtti_NotifShare_RsShared,
50         &__nvoc_rtti_NotifShare_Object,
51     },
52 };
53 
54 const struct NVOC_CLASS_DEF __nvoc_class_def_NotifShare =
55 {
56     /*classInfo=*/ {
57         /*size=*/               sizeof(NotifShare),
58         /*classId=*/            classId(NotifShare),
59         /*providerId=*/         &__nvoc_rtti_provider,
60 #if NV_PRINTF_STRINGS_ALLOWED
61         /*name=*/               "NotifShare",
62 #endif
63     },
64     /*objCreatefn=*/        (NVOC_DYNAMIC_OBJ_CREATE) &__nvoc_objCreateDynamic_NotifShare,
65     /*pCastInfo=*/          &__nvoc_castinfo_NotifShare,
66     /*pExportInfo=*/        &__nvoc_export_info_NotifShare
67 };
68 
69 const struct NVOC_EXPORT_INFO __nvoc_export_info_NotifShare =
70 {
71     /*numEntries=*/     0,
72     /*pExportEntries=*/  0
73 };
74 
75 void __nvoc_dtor_RsShared(RsShared*);
__nvoc_dtor_NotifShare(NotifShare * pThis)76 void __nvoc_dtor_NotifShare(NotifShare *pThis) {
77     __nvoc_shrnotifDestruct(pThis);
78     __nvoc_dtor_RsShared(&pThis->__nvoc_base_RsShared);
79     PORT_UNREFERENCED_VARIABLE(pThis);
80 }
81 
__nvoc_init_dataField_NotifShare(NotifShare * pThis)82 void __nvoc_init_dataField_NotifShare(NotifShare *pThis) {
83     PORT_UNREFERENCED_VARIABLE(pThis);
84 }
85 
86 NV_STATUS __nvoc_ctor_RsShared(RsShared* );
__nvoc_ctor_NotifShare(NotifShare * pThis)87 NV_STATUS __nvoc_ctor_NotifShare(NotifShare *pThis) {
88     NV_STATUS status = NV_OK;
89     status = __nvoc_ctor_RsShared(&pThis->__nvoc_base_RsShared);
90     if (status != NV_OK) goto __nvoc_ctor_NotifShare_fail_RsShared;
91     __nvoc_init_dataField_NotifShare(pThis);
92 
93     status = __nvoc_shrnotifConstruct(pThis);
94     if (status != NV_OK) goto __nvoc_ctor_NotifShare_fail__init;
95     goto __nvoc_ctor_NotifShare_exit; // Success
96 
97 __nvoc_ctor_NotifShare_fail__init:
98     __nvoc_dtor_RsShared(&pThis->__nvoc_base_RsShared);
99 __nvoc_ctor_NotifShare_fail_RsShared:
100 __nvoc_ctor_NotifShare_exit:
101 
102     return status;
103 }
104 
__nvoc_init_funcTable_NotifShare_1(NotifShare * pThis)105 static void __nvoc_init_funcTable_NotifShare_1(NotifShare *pThis) {
106     PORT_UNREFERENCED_VARIABLE(pThis);
107 }
108 
__nvoc_init_funcTable_NotifShare(NotifShare * pThis)109 void __nvoc_init_funcTable_NotifShare(NotifShare *pThis) {
110     __nvoc_init_funcTable_NotifShare_1(pThis);
111 }
112 
113 void __nvoc_init_RsShared(RsShared*);
__nvoc_init_NotifShare(NotifShare * pThis)114 void __nvoc_init_NotifShare(NotifShare *pThis) {
115     pThis->__nvoc_pbase_NotifShare = pThis;
116     pThis->__nvoc_pbase_Object = &pThis->__nvoc_base_RsShared.__nvoc_base_Object;
117     pThis->__nvoc_pbase_RsShared = &pThis->__nvoc_base_RsShared;
118     __nvoc_init_RsShared(&pThis->__nvoc_base_RsShared);
119     __nvoc_init_funcTable_NotifShare(pThis);
120 }
121 
__nvoc_objCreate_NotifShare(NotifShare ** ppThis,Dynamic * pParent,NvU32 createFlags)122 NV_STATUS __nvoc_objCreate_NotifShare(NotifShare **ppThis, Dynamic *pParent, NvU32 createFlags)
123 {
124     NV_STATUS status;
125     Object *pParentObj = NULL;
126     NotifShare *pThis;
127 
128     // Assign `pThis`, allocating memory unless suppressed by flag.
129     status = __nvoc_handleObjCreateMemAlloc(createFlags, sizeof(NotifShare), (void**)&pThis, (void**)ppThis);
130     if (status != NV_OK)
131         return status;
132 
133     // Zero is the initial value for everything.
134     portMemSet(pThis, 0, sizeof(NotifShare));
135 
136     // Initialize runtime type information.
137     __nvoc_initRtti(staticCast(pThis, Dynamic), &__nvoc_class_def_NotifShare);
138 
139     pThis->__nvoc_base_RsShared.__nvoc_base_Object.createFlags = createFlags;
140 
141     // Link the child into the parent if there is one unless flagged not to do so.
142     if (pParent != NULL && !(createFlags & NVOC_OBJ_CREATE_FLAGS_PARENT_HALSPEC_ONLY))
143     {
144         pParentObj = dynamicCast(pParent, Object);
145         objAddChild(pParentObj, &pThis->__nvoc_base_RsShared.__nvoc_base_Object);
146     }
147     else
148     {
149         pThis->__nvoc_base_RsShared.__nvoc_base_Object.pParent = NULL;
150     }
151 
152     __nvoc_init_NotifShare(pThis);
153     status = __nvoc_ctor_NotifShare(pThis);
154     if (status != NV_OK) goto __nvoc_objCreate_NotifShare_cleanup;
155 
156     // Assignment has no effect if NVOC_OBJ_CREATE_FLAGS_IN_PLACE_CONSTRUCT is set.
157     *ppThis = pThis;
158 
159     return NV_OK;
160 
161 __nvoc_objCreate_NotifShare_cleanup:
162 
163     // Unlink the child from the parent if it was linked above.
164     if (pParentObj != NULL)
165         objRemoveChild(pParentObj, &pThis->__nvoc_base_RsShared.__nvoc_base_Object);
166 
167     // Do not call destructors here since the constructor already called them.
168     if (createFlags & NVOC_OBJ_CREATE_FLAGS_IN_PLACE_CONSTRUCT)
169         portMemSet(pThis, 0, sizeof(NotifShare));
170     else
171     {
172         portMemFree(pThis);
173         *ppThis = NULL;
174     }
175 
176     // coverity[leaked_storage:FALSE]
177     return status;
178 }
179 
__nvoc_objCreateDynamic_NotifShare(NotifShare ** ppThis,Dynamic * pParent,NvU32 createFlags,va_list args)180 NV_STATUS __nvoc_objCreateDynamic_NotifShare(NotifShare **ppThis, Dynamic *pParent, NvU32 createFlags, va_list args) {
181     NV_STATUS status;
182 
183     status = __nvoc_objCreate_NotifShare(ppThis, pParent, createFlags);
184 
185     return status;
186 }
187 
188 #ifdef DEBUG
189 char __nvoc_class_id_uniqueness_check_0xa4ecfc = 1;
190 #endif
191 
192 extern const struct NVOC_CLASS_DEF __nvoc_class_def_Event;
193 
194 extern const struct NVOC_CLASS_DEF __nvoc_class_def_Object;
195 
196 extern const struct NVOC_CLASS_DEF __nvoc_class_def_RsResource;
197 
198 extern const struct NVOC_CLASS_DEF __nvoc_class_def_RmResourceCommon;
199 
200 extern const struct NVOC_CLASS_DEF __nvoc_class_def_RmResource;
201 
202 void __nvoc_init_Event(Event*);
203 void __nvoc_init_funcTable_Event(Event*);
204 NV_STATUS __nvoc_ctor_Event(Event*, struct CALL_CONTEXT * arg_pCallContext, struct RS_RES_ALLOC_PARAMS_INTERNAL * arg_pParams);
205 void __nvoc_init_dataField_Event(Event*);
206 void __nvoc_dtor_Event(Event*);
207 extern const struct NVOC_EXPORT_INFO __nvoc_export_info_Event;
208 
209 static const struct NVOC_RTTI __nvoc_rtti_Event_Event = {
210     /*pClassDef=*/          &__nvoc_class_def_Event,
211     /*dtor=*/               (NVOC_DYNAMIC_DTOR) &__nvoc_dtor_Event,
212     /*offset=*/             0,
213 };
214 
215 static const struct NVOC_RTTI __nvoc_rtti_Event_Object = {
216     /*pClassDef=*/          &__nvoc_class_def_Object,
217     /*dtor=*/               &__nvoc_destructFromBase,
218     /*offset=*/             NV_OFFSETOF(Event, __nvoc_base_RmResource.__nvoc_base_RsResource.__nvoc_base_Object),
219 };
220 
221 static const struct NVOC_RTTI __nvoc_rtti_Event_RsResource = {
222     /*pClassDef=*/          &__nvoc_class_def_RsResource,
223     /*dtor=*/               &__nvoc_destructFromBase,
224     /*offset=*/             NV_OFFSETOF(Event, __nvoc_base_RmResource.__nvoc_base_RsResource),
225 };
226 
227 static const struct NVOC_RTTI __nvoc_rtti_Event_RmResourceCommon = {
228     /*pClassDef=*/          &__nvoc_class_def_RmResourceCommon,
229     /*dtor=*/               &__nvoc_destructFromBase,
230     /*offset=*/             NV_OFFSETOF(Event, __nvoc_base_RmResource.__nvoc_base_RmResourceCommon),
231 };
232 
233 static const struct NVOC_RTTI __nvoc_rtti_Event_RmResource = {
234     /*pClassDef=*/          &__nvoc_class_def_RmResource,
235     /*dtor=*/               &__nvoc_destructFromBase,
236     /*offset=*/             NV_OFFSETOF(Event, __nvoc_base_RmResource),
237 };
238 
239 static const struct NVOC_CASTINFO __nvoc_castinfo_Event = {
240     /*numRelatives=*/       5,
241     /*relatives=*/ {
242         &__nvoc_rtti_Event_Event,
243         &__nvoc_rtti_Event_RmResource,
244         &__nvoc_rtti_Event_RmResourceCommon,
245         &__nvoc_rtti_Event_RsResource,
246         &__nvoc_rtti_Event_Object,
247     },
248 };
249 
250 const struct NVOC_CLASS_DEF __nvoc_class_def_Event =
251 {
252     /*classInfo=*/ {
253         /*size=*/               sizeof(Event),
254         /*classId=*/            classId(Event),
255         /*providerId=*/         &__nvoc_rtti_provider,
256 #if NV_PRINTF_STRINGS_ALLOWED
257         /*name=*/               "Event",
258 #endif
259     },
260     /*objCreatefn=*/        (NVOC_DYNAMIC_OBJ_CREATE) &__nvoc_objCreateDynamic_Event,
261     /*pCastInfo=*/          &__nvoc_castinfo_Event,
262     /*pExportInfo=*/        &__nvoc_export_info_Event
263 };
264 
__nvoc_thunk_RmResource_eventShareCallback(struct Event * pResource,struct RsClient * pInvokingClient,struct RsResourceRef * pParentRef,RS_SHARE_POLICY * pSharePolicy)265 static NvBool __nvoc_thunk_RmResource_eventShareCallback(struct Event *pResource, struct RsClient *pInvokingClient, struct RsResourceRef *pParentRef, RS_SHARE_POLICY *pSharePolicy) {
266     return rmresShareCallback((struct RmResource *)(((unsigned char *)pResource) + __nvoc_rtti_Event_RmResource.offset), pInvokingClient, pParentRef, pSharePolicy);
267 }
268 
__nvoc_thunk_RmResource_eventCheckMemInterUnmap(struct Event * pRmResource,NvBool bSubdeviceHandleProvided)269 static NV_STATUS __nvoc_thunk_RmResource_eventCheckMemInterUnmap(struct Event *pRmResource, NvBool bSubdeviceHandleProvided) {
270     return rmresCheckMemInterUnmap((struct RmResource *)(((unsigned char *)pRmResource) + __nvoc_rtti_Event_RmResource.offset), bSubdeviceHandleProvided);
271 }
272 
__nvoc_thunk_RsResource_eventControl(struct Event * pResource,struct CALL_CONTEXT * pCallContext,struct RS_RES_CONTROL_PARAMS_INTERNAL * pParams)273 static NV_STATUS __nvoc_thunk_RsResource_eventControl(struct Event *pResource, struct CALL_CONTEXT *pCallContext, struct RS_RES_CONTROL_PARAMS_INTERNAL *pParams) {
274     return resControl((struct RsResource *)(((unsigned char *)pResource) + __nvoc_rtti_Event_RsResource.offset), pCallContext, pParams);
275 }
276 
__nvoc_thunk_RmResource_eventGetMemInterMapParams(struct Event * pRmResource,RMRES_MEM_INTER_MAP_PARAMS * pParams)277 static NV_STATUS __nvoc_thunk_RmResource_eventGetMemInterMapParams(struct Event *pRmResource, RMRES_MEM_INTER_MAP_PARAMS *pParams) {
278     return rmresGetMemInterMapParams((struct RmResource *)(((unsigned char *)pRmResource) + __nvoc_rtti_Event_RmResource.offset), pParams);
279 }
280 
__nvoc_thunk_RmResource_eventGetMemoryMappingDescriptor(struct Event * pRmResource,struct MEMORY_DESCRIPTOR ** ppMemDesc)281 static NV_STATUS __nvoc_thunk_RmResource_eventGetMemoryMappingDescriptor(struct Event *pRmResource, struct MEMORY_DESCRIPTOR **ppMemDesc) {
282     return rmresGetMemoryMappingDescriptor((struct RmResource *)(((unsigned char *)pRmResource) + __nvoc_rtti_Event_RmResource.offset), ppMemDesc);
283 }
284 
__nvoc_thunk_RsResource_eventGetRefCount(struct Event * pResource)285 static NvU32 __nvoc_thunk_RsResource_eventGetRefCount(struct Event *pResource) {
286     return resGetRefCount((struct RsResource *)(((unsigned char *)pResource) + __nvoc_rtti_Event_RsResource.offset));
287 }
288 
__nvoc_thunk_RsResource_eventControlFilter(struct Event * pResource,struct CALL_CONTEXT * pCallContext,struct RS_RES_CONTROL_PARAMS_INTERNAL * pParams)289 static NV_STATUS __nvoc_thunk_RsResource_eventControlFilter(struct Event *pResource, struct CALL_CONTEXT *pCallContext, struct RS_RES_CONTROL_PARAMS_INTERNAL *pParams) {
290     return resControlFilter((struct RsResource *)(((unsigned char *)pResource) + __nvoc_rtti_Event_RsResource.offset), pCallContext, pParams);
291 }
292 
__nvoc_thunk_RsResource_eventAddAdditionalDependants(struct RsClient * pClient,struct Event * pResource,RsResourceRef * pReference)293 static void __nvoc_thunk_RsResource_eventAddAdditionalDependants(struct RsClient *pClient, struct Event *pResource, RsResourceRef *pReference) {
294     resAddAdditionalDependants(pClient, (struct RsResource *)(((unsigned char *)pResource) + __nvoc_rtti_Event_RsResource.offset), pReference);
295 }
296 
__nvoc_thunk_RmResource_eventControlSerialization_Prologue(struct Event * pResource,struct CALL_CONTEXT * pCallContext,struct RS_RES_CONTROL_PARAMS_INTERNAL * pParams)297 static NV_STATUS __nvoc_thunk_RmResource_eventControlSerialization_Prologue(struct Event *pResource, struct CALL_CONTEXT *pCallContext, struct RS_RES_CONTROL_PARAMS_INTERNAL *pParams) {
298     return rmresControlSerialization_Prologue((struct RmResource *)(((unsigned char *)pResource) + __nvoc_rtti_Event_RmResource.offset), pCallContext, pParams);
299 }
300 
__nvoc_thunk_RmResource_eventControl_Prologue(struct Event * pResource,struct CALL_CONTEXT * pCallContext,struct RS_RES_CONTROL_PARAMS_INTERNAL * pParams)301 static NV_STATUS __nvoc_thunk_RmResource_eventControl_Prologue(struct Event *pResource, struct CALL_CONTEXT *pCallContext, struct RS_RES_CONTROL_PARAMS_INTERNAL *pParams) {
302     return rmresControl_Prologue((struct RmResource *)(((unsigned char *)pResource) + __nvoc_rtti_Event_RmResource.offset), pCallContext, pParams);
303 }
304 
__nvoc_thunk_RsResource_eventCanCopy(struct Event * pResource)305 static NvBool __nvoc_thunk_RsResource_eventCanCopy(struct Event *pResource) {
306     return resCanCopy((struct RsResource *)(((unsigned char *)pResource) + __nvoc_rtti_Event_RsResource.offset));
307 }
308 
__nvoc_thunk_RsResource_eventUnmap(struct Event * pResource,struct CALL_CONTEXT * pCallContext,RsCpuMapping * pCpuMapping)309 static NV_STATUS __nvoc_thunk_RsResource_eventUnmap(struct Event *pResource, struct CALL_CONTEXT *pCallContext, RsCpuMapping *pCpuMapping) {
310     return resUnmap((struct RsResource *)(((unsigned char *)pResource) + __nvoc_rtti_Event_RsResource.offset), pCallContext, pCpuMapping);
311 }
312 
__nvoc_thunk_RsResource_eventIsPartialUnmapSupported(struct Event * pResource)313 static NvBool __nvoc_thunk_RsResource_eventIsPartialUnmapSupported(struct Event *pResource) {
314     return resIsPartialUnmapSupported((struct RsResource *)(((unsigned char *)pResource) + __nvoc_rtti_Event_RsResource.offset));
315 }
316 
__nvoc_thunk_RsResource_eventPreDestruct(struct Event * pResource)317 static void __nvoc_thunk_RsResource_eventPreDestruct(struct Event *pResource) {
318     resPreDestruct((struct RsResource *)(((unsigned char *)pResource) + __nvoc_rtti_Event_RsResource.offset));
319 }
320 
__nvoc_thunk_RsResource_eventMapTo(struct Event * pResource,RS_RES_MAP_TO_PARAMS * pParams)321 static NV_STATUS __nvoc_thunk_RsResource_eventMapTo(struct Event *pResource, RS_RES_MAP_TO_PARAMS *pParams) {
322     return resMapTo((struct RsResource *)(((unsigned char *)pResource) + __nvoc_rtti_Event_RsResource.offset), pParams);
323 }
324 
__nvoc_thunk_RsResource_eventIsDuplicate(struct Event * pResource,NvHandle hMemory,NvBool * pDuplicate)325 static NV_STATUS __nvoc_thunk_RsResource_eventIsDuplicate(struct Event *pResource, NvHandle hMemory, NvBool *pDuplicate) {
326     return resIsDuplicate((struct RsResource *)(((unsigned char *)pResource) + __nvoc_rtti_Event_RsResource.offset), hMemory, pDuplicate);
327 }
328 
__nvoc_thunk_RmResource_eventControlSerialization_Epilogue(struct Event * pResource,struct CALL_CONTEXT * pCallContext,struct RS_RES_CONTROL_PARAMS_INTERNAL * pParams)329 static void __nvoc_thunk_RmResource_eventControlSerialization_Epilogue(struct Event *pResource, struct CALL_CONTEXT *pCallContext, struct RS_RES_CONTROL_PARAMS_INTERNAL *pParams) {
330     rmresControlSerialization_Epilogue((struct RmResource *)(((unsigned char *)pResource) + __nvoc_rtti_Event_RmResource.offset), pCallContext, pParams);
331 }
332 
__nvoc_thunk_RmResource_eventControl_Epilogue(struct Event * pResource,struct CALL_CONTEXT * pCallContext,struct RS_RES_CONTROL_PARAMS_INTERNAL * pParams)333 static void __nvoc_thunk_RmResource_eventControl_Epilogue(struct Event *pResource, struct CALL_CONTEXT *pCallContext, struct RS_RES_CONTROL_PARAMS_INTERNAL *pParams) {
334     rmresControl_Epilogue((struct RmResource *)(((unsigned char *)pResource) + __nvoc_rtti_Event_RmResource.offset), pCallContext, pParams);
335 }
336 
__nvoc_thunk_RsResource_eventUnmapFrom(struct Event * pResource,RS_RES_UNMAP_FROM_PARAMS * pParams)337 static NV_STATUS __nvoc_thunk_RsResource_eventUnmapFrom(struct Event *pResource, RS_RES_UNMAP_FROM_PARAMS *pParams) {
338     return resUnmapFrom((struct RsResource *)(((unsigned char *)pResource) + __nvoc_rtti_Event_RsResource.offset), pParams);
339 }
340 
__nvoc_thunk_RsResource_eventMap(struct Event * pResource,struct CALL_CONTEXT * pCallContext,RS_CPU_MAP_PARAMS * pParams,RsCpuMapping * pCpuMapping)341 static NV_STATUS __nvoc_thunk_RsResource_eventMap(struct Event *pResource, struct CALL_CONTEXT *pCallContext, RS_CPU_MAP_PARAMS *pParams, RsCpuMapping *pCpuMapping) {
342     return resMap((struct RsResource *)(((unsigned char *)pResource) + __nvoc_rtti_Event_RsResource.offset), pCallContext, pParams, pCpuMapping);
343 }
344 
__nvoc_thunk_RmResource_eventAccessCallback(struct Event * pResource,struct RsClient * pInvokingClient,void * pAllocParams,RsAccessRight accessRight)345 static NvBool __nvoc_thunk_RmResource_eventAccessCallback(struct Event *pResource, struct RsClient *pInvokingClient, void *pAllocParams, RsAccessRight accessRight) {
346     return rmresAccessCallback((struct RmResource *)(((unsigned char *)pResource) + __nvoc_rtti_Event_RmResource.offset), pInvokingClient, pAllocParams, accessRight);
347 }
348 
349 const struct NVOC_EXPORT_INFO __nvoc_export_info_Event =
350 {
351     /*numEntries=*/     0,
352     /*pExportEntries=*/  0
353 };
354 
355 void __nvoc_dtor_RmResource(RmResource*);
__nvoc_dtor_Event(Event * pThis)356 void __nvoc_dtor_Event(Event *pThis) {
357     __nvoc_eventDestruct(pThis);
358     __nvoc_dtor_RmResource(&pThis->__nvoc_base_RmResource);
359     PORT_UNREFERENCED_VARIABLE(pThis);
360 }
361 
__nvoc_init_dataField_Event(Event * pThis)362 void __nvoc_init_dataField_Event(Event *pThis) {
363     PORT_UNREFERENCED_VARIABLE(pThis);
364 }
365 
366 NV_STATUS __nvoc_ctor_RmResource(RmResource* , struct CALL_CONTEXT *, struct RS_RES_ALLOC_PARAMS_INTERNAL *);
__nvoc_ctor_Event(Event * pThis,struct CALL_CONTEXT * arg_pCallContext,struct RS_RES_ALLOC_PARAMS_INTERNAL * arg_pParams)367 NV_STATUS __nvoc_ctor_Event(Event *pThis, struct CALL_CONTEXT * arg_pCallContext, struct RS_RES_ALLOC_PARAMS_INTERNAL * arg_pParams) {
368     NV_STATUS status = NV_OK;
369     status = __nvoc_ctor_RmResource(&pThis->__nvoc_base_RmResource, arg_pCallContext, arg_pParams);
370     if (status != NV_OK) goto __nvoc_ctor_Event_fail_RmResource;
371     __nvoc_init_dataField_Event(pThis);
372 
373     status = __nvoc_eventConstruct(pThis, arg_pCallContext, arg_pParams);
374     if (status != NV_OK) goto __nvoc_ctor_Event_fail__init;
375     goto __nvoc_ctor_Event_exit; // Success
376 
377 __nvoc_ctor_Event_fail__init:
378     __nvoc_dtor_RmResource(&pThis->__nvoc_base_RmResource);
379 __nvoc_ctor_Event_fail_RmResource:
380 __nvoc_ctor_Event_exit:
381 
382     return status;
383 }
384 
__nvoc_init_funcTable_Event_1(Event * pThis)385 static void __nvoc_init_funcTable_Event_1(Event *pThis) {
386     PORT_UNREFERENCED_VARIABLE(pThis);
387 
388     pThis->__eventShareCallback__ = &__nvoc_thunk_RmResource_eventShareCallback;
389 
390     pThis->__eventCheckMemInterUnmap__ = &__nvoc_thunk_RmResource_eventCheckMemInterUnmap;
391 
392     pThis->__eventControl__ = &__nvoc_thunk_RsResource_eventControl;
393 
394     pThis->__eventGetMemInterMapParams__ = &__nvoc_thunk_RmResource_eventGetMemInterMapParams;
395 
396     pThis->__eventGetMemoryMappingDescriptor__ = &__nvoc_thunk_RmResource_eventGetMemoryMappingDescriptor;
397 
398     pThis->__eventGetRefCount__ = &__nvoc_thunk_RsResource_eventGetRefCount;
399 
400     pThis->__eventControlFilter__ = &__nvoc_thunk_RsResource_eventControlFilter;
401 
402     pThis->__eventAddAdditionalDependants__ = &__nvoc_thunk_RsResource_eventAddAdditionalDependants;
403 
404     pThis->__eventControlSerialization_Prologue__ = &__nvoc_thunk_RmResource_eventControlSerialization_Prologue;
405 
406     pThis->__eventControl_Prologue__ = &__nvoc_thunk_RmResource_eventControl_Prologue;
407 
408     pThis->__eventCanCopy__ = &__nvoc_thunk_RsResource_eventCanCopy;
409 
410     pThis->__eventUnmap__ = &__nvoc_thunk_RsResource_eventUnmap;
411 
412     pThis->__eventIsPartialUnmapSupported__ = &__nvoc_thunk_RsResource_eventIsPartialUnmapSupported;
413 
414     pThis->__eventPreDestruct__ = &__nvoc_thunk_RsResource_eventPreDestruct;
415 
416     pThis->__eventMapTo__ = &__nvoc_thunk_RsResource_eventMapTo;
417 
418     pThis->__eventIsDuplicate__ = &__nvoc_thunk_RsResource_eventIsDuplicate;
419 
420     pThis->__eventControlSerialization_Epilogue__ = &__nvoc_thunk_RmResource_eventControlSerialization_Epilogue;
421 
422     pThis->__eventControl_Epilogue__ = &__nvoc_thunk_RmResource_eventControl_Epilogue;
423 
424     pThis->__eventUnmapFrom__ = &__nvoc_thunk_RsResource_eventUnmapFrom;
425 
426     pThis->__eventMap__ = &__nvoc_thunk_RsResource_eventMap;
427 
428     pThis->__eventAccessCallback__ = &__nvoc_thunk_RmResource_eventAccessCallback;
429 }
430 
__nvoc_init_funcTable_Event(Event * pThis)431 void __nvoc_init_funcTable_Event(Event *pThis) {
432     __nvoc_init_funcTable_Event_1(pThis);
433 }
434 
435 void __nvoc_init_RmResource(RmResource*);
__nvoc_init_Event(Event * pThis)436 void __nvoc_init_Event(Event *pThis) {
437     pThis->__nvoc_pbase_Event = pThis;
438     pThis->__nvoc_pbase_Object = &pThis->__nvoc_base_RmResource.__nvoc_base_RsResource.__nvoc_base_Object;
439     pThis->__nvoc_pbase_RsResource = &pThis->__nvoc_base_RmResource.__nvoc_base_RsResource;
440     pThis->__nvoc_pbase_RmResourceCommon = &pThis->__nvoc_base_RmResource.__nvoc_base_RmResourceCommon;
441     pThis->__nvoc_pbase_RmResource = &pThis->__nvoc_base_RmResource;
442     __nvoc_init_RmResource(&pThis->__nvoc_base_RmResource);
443     __nvoc_init_funcTable_Event(pThis);
444 }
445 
__nvoc_objCreate_Event(Event ** ppThis,Dynamic * pParent,NvU32 createFlags,struct CALL_CONTEXT * arg_pCallContext,struct RS_RES_ALLOC_PARAMS_INTERNAL * arg_pParams)446 NV_STATUS __nvoc_objCreate_Event(Event **ppThis, Dynamic *pParent, NvU32 createFlags, struct CALL_CONTEXT * arg_pCallContext, struct RS_RES_ALLOC_PARAMS_INTERNAL * arg_pParams)
447 {
448     NV_STATUS status;
449     Object *pParentObj = NULL;
450     Event *pThis;
451 
452     // Assign `pThis`, allocating memory unless suppressed by flag.
453     status = __nvoc_handleObjCreateMemAlloc(createFlags, sizeof(Event), (void**)&pThis, (void**)ppThis);
454     if (status != NV_OK)
455         return status;
456 
457     // Zero is the initial value for everything.
458     portMemSet(pThis, 0, sizeof(Event));
459 
460     // Initialize runtime type information.
461     __nvoc_initRtti(staticCast(pThis, Dynamic), &__nvoc_class_def_Event);
462 
463     pThis->__nvoc_base_RmResource.__nvoc_base_RsResource.__nvoc_base_Object.createFlags = createFlags;
464 
465     // Link the child into the parent if there is one unless flagged not to do so.
466     if (pParent != NULL && !(createFlags & NVOC_OBJ_CREATE_FLAGS_PARENT_HALSPEC_ONLY))
467     {
468         pParentObj = dynamicCast(pParent, Object);
469         objAddChild(pParentObj, &pThis->__nvoc_base_RmResource.__nvoc_base_RsResource.__nvoc_base_Object);
470     }
471     else
472     {
473         pThis->__nvoc_base_RmResource.__nvoc_base_RsResource.__nvoc_base_Object.pParent = NULL;
474     }
475 
476     __nvoc_init_Event(pThis);
477     status = __nvoc_ctor_Event(pThis, arg_pCallContext, arg_pParams);
478     if (status != NV_OK) goto __nvoc_objCreate_Event_cleanup;
479 
480     // Assignment has no effect if NVOC_OBJ_CREATE_FLAGS_IN_PLACE_CONSTRUCT is set.
481     *ppThis = pThis;
482 
483     return NV_OK;
484 
485 __nvoc_objCreate_Event_cleanup:
486 
487     // Unlink the child from the parent if it was linked above.
488     if (pParentObj != NULL)
489         objRemoveChild(pParentObj, &pThis->__nvoc_base_RmResource.__nvoc_base_RsResource.__nvoc_base_Object);
490 
491     // Do not call destructors here since the constructor already called them.
492     if (createFlags & NVOC_OBJ_CREATE_FLAGS_IN_PLACE_CONSTRUCT)
493         portMemSet(pThis, 0, sizeof(Event));
494     else
495     {
496         portMemFree(pThis);
497         *ppThis = NULL;
498     }
499 
500     // coverity[leaked_storage:FALSE]
501     return status;
502 }
503 
__nvoc_objCreateDynamic_Event(Event ** ppThis,Dynamic * pParent,NvU32 createFlags,va_list args)504 NV_STATUS __nvoc_objCreateDynamic_Event(Event **ppThis, Dynamic *pParent, NvU32 createFlags, va_list args) {
505     NV_STATUS status;
506     struct CALL_CONTEXT * arg_pCallContext = va_arg(args, struct CALL_CONTEXT *);
507     struct RS_RES_ALLOC_PARAMS_INTERNAL * arg_pParams = va_arg(args, struct RS_RES_ALLOC_PARAMS_INTERNAL *);
508 
509     status = __nvoc_objCreate_Event(ppThis, pParent, createFlags, arg_pCallContext, arg_pParams);
510 
511     return status;
512 }
513 
514 #ifdef DEBUG
515 char __nvoc_class_id_uniqueness_check_0xf8f965 = 1;
516 #endif
517 
518 extern const struct NVOC_CLASS_DEF __nvoc_class_def_INotifier;
519 
520 void __nvoc_init_INotifier(INotifier*);
521 void __nvoc_init_funcTable_INotifier(INotifier*);
522 NV_STATUS __nvoc_ctor_INotifier(INotifier*, struct CALL_CONTEXT * arg_pCallContext);
523 void __nvoc_init_dataField_INotifier(INotifier*);
524 void __nvoc_dtor_INotifier(INotifier*);
525 extern const struct NVOC_EXPORT_INFO __nvoc_export_info_INotifier;
526 
527 static const struct NVOC_RTTI __nvoc_rtti_INotifier_INotifier = {
528     /*pClassDef=*/          &__nvoc_class_def_INotifier,
529     /*dtor=*/               (NVOC_DYNAMIC_DTOR) &__nvoc_dtor_INotifier,
530     /*offset=*/             0,
531 };
532 
533 static const struct NVOC_CASTINFO __nvoc_castinfo_INotifier = {
534     /*numRelatives=*/       1,
535     /*relatives=*/ {
536         &__nvoc_rtti_INotifier_INotifier,
537     },
538 };
539 
540 // Not instantiable because it's not derived from class "Object"
541 // Not instantiable because it's an abstract class with following pure virtual functions:
542 //  inotifyGetNotificationListPtr
543 //  inotifySetNotificationShare
544 //  inotifyGetNotificationShare
545 //  inotifyUnregisterEvent
546 //  inotifyGetOrAllocNotifShare
547 const struct NVOC_CLASS_DEF __nvoc_class_def_INotifier =
548 {
549     /*classInfo=*/ {
550         /*size=*/               sizeof(INotifier),
551         /*classId=*/            classId(INotifier),
552         /*providerId=*/         &__nvoc_rtti_provider,
553 #if NV_PRINTF_STRINGS_ALLOWED
554         /*name=*/               "INotifier",
555 #endif
556     },
557     /*objCreatefn=*/        (NVOC_DYNAMIC_OBJ_CREATE) NULL,
558     /*pCastInfo=*/          &__nvoc_castinfo_INotifier,
559     /*pExportInfo=*/        &__nvoc_export_info_INotifier
560 };
561 
562 const struct NVOC_EXPORT_INFO __nvoc_export_info_INotifier =
563 {
564     /*numEntries=*/     0,
565     /*pExportEntries=*/  0
566 };
567 
__nvoc_dtor_INotifier(INotifier * pThis)568 void __nvoc_dtor_INotifier(INotifier *pThis) {
569     __nvoc_inotifyDestruct(pThis);
570     PORT_UNREFERENCED_VARIABLE(pThis);
571 }
572 
__nvoc_init_dataField_INotifier(INotifier * pThis)573 void __nvoc_init_dataField_INotifier(INotifier *pThis) {
574     PORT_UNREFERENCED_VARIABLE(pThis);
575 }
576 
__nvoc_ctor_INotifier(INotifier * pThis,struct CALL_CONTEXT * arg_pCallContext)577 NV_STATUS __nvoc_ctor_INotifier(INotifier *pThis, struct CALL_CONTEXT * arg_pCallContext) {
578     NV_STATUS status = NV_OK;
579     __nvoc_init_dataField_INotifier(pThis);
580 
581     status = __nvoc_inotifyConstruct(pThis, arg_pCallContext);
582     if (status != NV_OK) goto __nvoc_ctor_INotifier_fail__init;
583     goto __nvoc_ctor_INotifier_exit; // Success
584 
585 __nvoc_ctor_INotifier_fail__init:
586 __nvoc_ctor_INotifier_exit:
587 
588     return status;
589 }
590 
__nvoc_init_funcTable_INotifier_1(INotifier * pThis)591 static void __nvoc_init_funcTable_INotifier_1(INotifier *pThis) {
592     PORT_UNREFERENCED_VARIABLE(pThis);
593 
594     pThis->__inotifyGetNotificationListPtr__ = NULL;
595 
596     pThis->__inotifySetNotificationShare__ = NULL;
597 
598     pThis->__inotifyGetNotificationShare__ = NULL;
599 
600     pThis->__inotifyUnregisterEvent__ = NULL;
601 
602     pThis->__inotifyGetOrAllocNotifShare__ = NULL;
603 }
604 
__nvoc_init_funcTable_INotifier(INotifier * pThis)605 void __nvoc_init_funcTable_INotifier(INotifier *pThis) {
606     __nvoc_init_funcTable_INotifier_1(pThis);
607 }
608 
__nvoc_init_INotifier(INotifier * pThis)609 void __nvoc_init_INotifier(INotifier *pThis) {
610     pThis->__nvoc_pbase_INotifier = pThis;
611     __nvoc_init_funcTable_INotifier(pThis);
612 }
613 
614 #ifdef DEBUG
615 char __nvoc_class_id_uniqueness_check_0xa8683b = 1;
616 #endif
617 
618 extern const struct NVOC_CLASS_DEF __nvoc_class_def_Notifier;
619 
620 extern const struct NVOC_CLASS_DEF __nvoc_class_def_INotifier;
621 
622 void __nvoc_init_Notifier(Notifier*);
623 void __nvoc_init_funcTable_Notifier(Notifier*);
624 NV_STATUS __nvoc_ctor_Notifier(Notifier*, struct CALL_CONTEXT * arg_pCallContext);
625 void __nvoc_init_dataField_Notifier(Notifier*);
626 void __nvoc_dtor_Notifier(Notifier*);
627 extern const struct NVOC_EXPORT_INFO __nvoc_export_info_Notifier;
628 
629 static const struct NVOC_RTTI __nvoc_rtti_Notifier_Notifier = {
630     /*pClassDef=*/          &__nvoc_class_def_Notifier,
631     /*dtor=*/               (NVOC_DYNAMIC_DTOR) &__nvoc_dtor_Notifier,
632     /*offset=*/             0,
633 };
634 
635 static const struct NVOC_RTTI __nvoc_rtti_Notifier_INotifier = {
636     /*pClassDef=*/          &__nvoc_class_def_INotifier,
637     /*dtor=*/               &__nvoc_destructFromBase,
638     /*offset=*/             NV_OFFSETOF(Notifier, __nvoc_base_INotifier),
639 };
640 
641 static const struct NVOC_CASTINFO __nvoc_castinfo_Notifier = {
642     /*numRelatives=*/       2,
643     /*relatives=*/ {
644         &__nvoc_rtti_Notifier_Notifier,
645         &__nvoc_rtti_Notifier_INotifier,
646     },
647 };
648 
649 // Not instantiable because it's not derived from class "Object"
650 const struct NVOC_CLASS_DEF __nvoc_class_def_Notifier =
651 {
652     /*classInfo=*/ {
653         /*size=*/               sizeof(Notifier),
654         /*classId=*/            classId(Notifier),
655         /*providerId=*/         &__nvoc_rtti_provider,
656 #if NV_PRINTF_STRINGS_ALLOWED
657         /*name=*/               "Notifier",
658 #endif
659     },
660     /*objCreatefn=*/        (NVOC_DYNAMIC_OBJ_CREATE) NULL,
661     /*pCastInfo=*/          &__nvoc_castinfo_Notifier,
662     /*pExportInfo=*/        &__nvoc_export_info_Notifier
663 };
664 
__nvoc_thunk_Notifier_inotifyGetNotificationListPtr(struct INotifier * pNotifier)665 static PEVENTNOTIFICATION *__nvoc_thunk_Notifier_inotifyGetNotificationListPtr(struct INotifier *pNotifier) {
666     return notifyGetNotificationListPtr((struct Notifier *)(((unsigned char *)pNotifier) - __nvoc_rtti_Notifier_INotifier.offset));
667 }
668 
__nvoc_thunk_Notifier_inotifyGetNotificationShare(struct INotifier * pNotifier)669 static struct NotifShare *__nvoc_thunk_Notifier_inotifyGetNotificationShare(struct INotifier *pNotifier) {
670     return notifyGetNotificationShare((struct Notifier *)(((unsigned char *)pNotifier) - __nvoc_rtti_Notifier_INotifier.offset));
671 }
672 
__nvoc_thunk_Notifier_inotifySetNotificationShare(struct INotifier * pNotifier,struct NotifShare * pNotifShare)673 static void __nvoc_thunk_Notifier_inotifySetNotificationShare(struct INotifier *pNotifier, struct NotifShare *pNotifShare) {
674     notifySetNotificationShare((struct Notifier *)(((unsigned char *)pNotifier) - __nvoc_rtti_Notifier_INotifier.offset), pNotifShare);
675 }
676 
__nvoc_thunk_Notifier_inotifyUnregisterEvent(struct INotifier * pNotifier,NvHandle hNotifierClient,NvHandle hNotifierResource,NvHandle hEventClient,NvHandle hEvent)677 static NV_STATUS __nvoc_thunk_Notifier_inotifyUnregisterEvent(struct INotifier *pNotifier, NvHandle hNotifierClient, NvHandle hNotifierResource, NvHandle hEventClient, NvHandle hEvent) {
678     return notifyUnregisterEvent((struct Notifier *)(((unsigned char *)pNotifier) - __nvoc_rtti_Notifier_INotifier.offset), hNotifierClient, hNotifierResource, hEventClient, hEvent);
679 }
680 
__nvoc_thunk_Notifier_inotifyGetOrAllocNotifShare(struct INotifier * pNotifier,NvHandle hNotifierClient,NvHandle hNotifierResource,struct NotifShare ** ppNotifShare)681 static NV_STATUS __nvoc_thunk_Notifier_inotifyGetOrAllocNotifShare(struct INotifier *pNotifier, NvHandle hNotifierClient, NvHandle hNotifierResource, struct NotifShare **ppNotifShare) {
682     return notifyGetOrAllocNotifShare((struct Notifier *)(((unsigned char *)pNotifier) - __nvoc_rtti_Notifier_INotifier.offset), hNotifierClient, hNotifierResource, ppNotifShare);
683 }
684 
685 const struct NVOC_EXPORT_INFO __nvoc_export_info_Notifier =
686 {
687     /*numEntries=*/     0,
688     /*pExportEntries=*/  0
689 };
690 
691 void __nvoc_dtor_INotifier(INotifier*);
__nvoc_dtor_Notifier(Notifier * pThis)692 void __nvoc_dtor_Notifier(Notifier *pThis) {
693     __nvoc_notifyDestruct(pThis);
694     __nvoc_dtor_INotifier(&pThis->__nvoc_base_INotifier);
695     PORT_UNREFERENCED_VARIABLE(pThis);
696 }
697 
__nvoc_init_dataField_Notifier(Notifier * pThis)698 void __nvoc_init_dataField_Notifier(Notifier *pThis) {
699     PORT_UNREFERENCED_VARIABLE(pThis);
700 }
701 
702 NV_STATUS __nvoc_ctor_INotifier(INotifier* , struct CALL_CONTEXT *);
__nvoc_ctor_Notifier(Notifier * pThis,struct CALL_CONTEXT * arg_pCallContext)703 NV_STATUS __nvoc_ctor_Notifier(Notifier *pThis, struct CALL_CONTEXT * arg_pCallContext) {
704     NV_STATUS status = NV_OK;
705     status = __nvoc_ctor_INotifier(&pThis->__nvoc_base_INotifier, arg_pCallContext);
706     if (status != NV_OK) goto __nvoc_ctor_Notifier_fail_INotifier;
707     __nvoc_init_dataField_Notifier(pThis);
708 
709     status = __nvoc_notifyConstruct(pThis, arg_pCallContext);
710     if (status != NV_OK) goto __nvoc_ctor_Notifier_fail__init;
711     goto __nvoc_ctor_Notifier_exit; // Success
712 
713 __nvoc_ctor_Notifier_fail__init:
714     __nvoc_dtor_INotifier(&pThis->__nvoc_base_INotifier);
715 __nvoc_ctor_Notifier_fail_INotifier:
716 __nvoc_ctor_Notifier_exit:
717 
718     return status;
719 }
720 
__nvoc_init_funcTable_Notifier_1(Notifier * pThis)721 static void __nvoc_init_funcTable_Notifier_1(Notifier *pThis) {
722     PORT_UNREFERENCED_VARIABLE(pThis);
723 
724     pThis->__notifyGetNotificationListPtr__ = &notifyGetNotificationListPtr_IMPL;
725 
726     pThis->__notifyGetNotificationShare__ = &notifyGetNotificationShare_IMPL;
727 
728     pThis->__notifySetNotificationShare__ = &notifySetNotificationShare_IMPL;
729 
730     pThis->__notifyUnregisterEvent__ = &notifyUnregisterEvent_IMPL;
731 
732     pThis->__notifyGetOrAllocNotifShare__ = &notifyGetOrAllocNotifShare_IMPL;
733 
734     pThis->__nvoc_base_INotifier.__inotifyGetNotificationListPtr__ = &__nvoc_thunk_Notifier_inotifyGetNotificationListPtr;
735 
736     pThis->__nvoc_base_INotifier.__inotifyGetNotificationShare__ = &__nvoc_thunk_Notifier_inotifyGetNotificationShare;
737 
738     pThis->__nvoc_base_INotifier.__inotifySetNotificationShare__ = &__nvoc_thunk_Notifier_inotifySetNotificationShare;
739 
740     pThis->__nvoc_base_INotifier.__inotifyUnregisterEvent__ = &__nvoc_thunk_Notifier_inotifyUnregisterEvent;
741 
742     pThis->__nvoc_base_INotifier.__inotifyGetOrAllocNotifShare__ = &__nvoc_thunk_Notifier_inotifyGetOrAllocNotifShare;
743 }
744 
__nvoc_init_funcTable_Notifier(Notifier * pThis)745 void __nvoc_init_funcTable_Notifier(Notifier *pThis) {
746     __nvoc_init_funcTable_Notifier_1(pThis);
747 }
748 
749 void __nvoc_init_INotifier(INotifier*);
__nvoc_init_Notifier(Notifier * pThis)750 void __nvoc_init_Notifier(Notifier *pThis) {
751     pThis->__nvoc_pbase_Notifier = pThis;
752     pThis->__nvoc_pbase_INotifier = &pThis->__nvoc_base_INotifier;
753     __nvoc_init_INotifier(&pThis->__nvoc_base_INotifier);
754     __nvoc_init_funcTable_Notifier(pThis);
755 }
756 
757