1 #define NVOC_KERNEL_OFA_CTX_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_kernel_ofa_ctx_nvoc.h"
9 
10 #ifdef DEBUG
11 char __nvoc_class_id_uniqueness_check_0xf63d99 = 1;
12 #endif
13 
14 extern const struct NVOC_CLASS_DEF __nvoc_class_def_OfaContext;
15 
16 extern const struct NVOC_CLASS_DEF __nvoc_class_def_Object;
17 
18 extern const struct NVOC_CLASS_DEF __nvoc_class_def_RsResource;
19 
20 extern const struct NVOC_CLASS_DEF __nvoc_class_def_RmResourceCommon;
21 
22 extern const struct NVOC_CLASS_DEF __nvoc_class_def_RmResource;
23 
24 extern const struct NVOC_CLASS_DEF __nvoc_class_def_GpuResource;
25 
26 extern const struct NVOC_CLASS_DEF __nvoc_class_def_INotifier;
27 
28 extern const struct NVOC_CLASS_DEF __nvoc_class_def_Notifier;
29 
30 extern const struct NVOC_CLASS_DEF __nvoc_class_def_ChannelDescendant;
31 
32 void __nvoc_init_OfaContext(OfaContext*, RmHalspecOwner* );
33 void __nvoc_init_funcTable_OfaContext(OfaContext*, RmHalspecOwner* );
34 NV_STATUS __nvoc_ctor_OfaContext(OfaContext*, RmHalspecOwner* , struct CALL_CONTEXT * arg_pCallContext, struct RS_RES_ALLOC_PARAMS_INTERNAL * arg_pParams);
35 void __nvoc_init_dataField_OfaContext(OfaContext*, RmHalspecOwner* );
36 void __nvoc_dtor_OfaContext(OfaContext*);
37 extern const struct NVOC_EXPORT_INFO __nvoc_export_info_OfaContext;
38 
39 static const struct NVOC_RTTI __nvoc_rtti_OfaContext_OfaContext = {
40     /*pClassDef=*/          &__nvoc_class_def_OfaContext,
41     /*dtor=*/               (NVOC_DYNAMIC_DTOR) &__nvoc_dtor_OfaContext,
42     /*offset=*/             0,
43 };
44 
45 static const struct NVOC_RTTI __nvoc_rtti_OfaContext_Object = {
46     /*pClassDef=*/          &__nvoc_class_def_Object,
47     /*dtor=*/               &__nvoc_destructFromBase,
48     /*offset=*/             NV_OFFSETOF(OfaContext, __nvoc_base_ChannelDescendant.__nvoc_base_GpuResource.__nvoc_base_RmResource.__nvoc_base_RsResource.__nvoc_base_Object),
49 };
50 
51 static const struct NVOC_RTTI __nvoc_rtti_OfaContext_RsResource = {
52     /*pClassDef=*/          &__nvoc_class_def_RsResource,
53     /*dtor=*/               &__nvoc_destructFromBase,
54     /*offset=*/             NV_OFFSETOF(OfaContext, __nvoc_base_ChannelDescendant.__nvoc_base_GpuResource.__nvoc_base_RmResource.__nvoc_base_RsResource),
55 };
56 
57 static const struct NVOC_RTTI __nvoc_rtti_OfaContext_RmResourceCommon = {
58     /*pClassDef=*/          &__nvoc_class_def_RmResourceCommon,
59     /*dtor=*/               &__nvoc_destructFromBase,
60     /*offset=*/             NV_OFFSETOF(OfaContext, __nvoc_base_ChannelDescendant.__nvoc_base_GpuResource.__nvoc_base_RmResource.__nvoc_base_RmResourceCommon),
61 };
62 
63 static const struct NVOC_RTTI __nvoc_rtti_OfaContext_RmResource = {
64     /*pClassDef=*/          &__nvoc_class_def_RmResource,
65     /*dtor=*/               &__nvoc_destructFromBase,
66     /*offset=*/             NV_OFFSETOF(OfaContext, __nvoc_base_ChannelDescendant.__nvoc_base_GpuResource.__nvoc_base_RmResource),
67 };
68 
69 static const struct NVOC_RTTI __nvoc_rtti_OfaContext_GpuResource = {
70     /*pClassDef=*/          &__nvoc_class_def_GpuResource,
71     /*dtor=*/               &__nvoc_destructFromBase,
72     /*offset=*/             NV_OFFSETOF(OfaContext, __nvoc_base_ChannelDescendant.__nvoc_base_GpuResource),
73 };
74 
75 static const struct NVOC_RTTI __nvoc_rtti_OfaContext_INotifier = {
76     /*pClassDef=*/          &__nvoc_class_def_INotifier,
77     /*dtor=*/               &__nvoc_destructFromBase,
78     /*offset=*/             NV_OFFSETOF(OfaContext, __nvoc_base_ChannelDescendant.__nvoc_base_Notifier.__nvoc_base_INotifier),
79 };
80 
81 static const struct NVOC_RTTI __nvoc_rtti_OfaContext_Notifier = {
82     /*pClassDef=*/          &__nvoc_class_def_Notifier,
83     /*dtor=*/               &__nvoc_destructFromBase,
84     /*offset=*/             NV_OFFSETOF(OfaContext, __nvoc_base_ChannelDescendant.__nvoc_base_Notifier),
85 };
86 
87 static const struct NVOC_RTTI __nvoc_rtti_OfaContext_ChannelDescendant = {
88     /*pClassDef=*/          &__nvoc_class_def_ChannelDescendant,
89     /*dtor=*/               &__nvoc_destructFromBase,
90     /*offset=*/             NV_OFFSETOF(OfaContext, __nvoc_base_ChannelDescendant),
91 };
92 
93 static const struct NVOC_CASTINFO __nvoc_castinfo_OfaContext = {
94     /*numRelatives=*/       9,
95     /*relatives=*/ {
96         &__nvoc_rtti_OfaContext_OfaContext,
97         &__nvoc_rtti_OfaContext_ChannelDescendant,
98         &__nvoc_rtti_OfaContext_Notifier,
99         &__nvoc_rtti_OfaContext_INotifier,
100         &__nvoc_rtti_OfaContext_GpuResource,
101         &__nvoc_rtti_OfaContext_RmResource,
102         &__nvoc_rtti_OfaContext_RmResourceCommon,
103         &__nvoc_rtti_OfaContext_RsResource,
104         &__nvoc_rtti_OfaContext_Object,
105     },
106 };
107 
108 const struct NVOC_CLASS_DEF __nvoc_class_def_OfaContext =
109 {
110     /*classInfo=*/ {
111         /*size=*/               sizeof(OfaContext),
112         /*classId=*/            classId(OfaContext),
113         /*providerId=*/         &__nvoc_rtti_provider,
114 #if NV_PRINTF_STRINGS_ALLOWED
115         /*name=*/               "OfaContext",
116 #endif
117     },
118     /*objCreatefn=*/        (NVOC_DYNAMIC_OBJ_CREATE) &__nvoc_objCreateDynamic_OfaContext,
119     /*pCastInfo=*/          &__nvoc_castinfo_OfaContext,
120     /*pExportInfo=*/        &__nvoc_export_info_OfaContext
121 };
122 
123 static NV_STATUS __nvoc_thunk_ChannelDescendant_ofactxCheckMemInterUnmap(struct OfaContext *pChannelDescendant, NvBool bSubdeviceHandleProvided) {
124     return chandesCheckMemInterUnmap((struct ChannelDescendant *)(((unsigned char *)pChannelDescendant) + __nvoc_rtti_OfaContext_ChannelDescendant.offset), bSubdeviceHandleProvided);
125 }
126 
127 static NvBool __nvoc_thunk_GpuResource_ofactxShareCallback(struct OfaContext *pGpuResource, struct RsClient *pInvokingClient, struct RsResourceRef *pParentRef, RS_SHARE_POLICY *pSharePolicy) {
128     return gpuresShareCallback((struct GpuResource *)(((unsigned char *)pGpuResource) + __nvoc_rtti_OfaContext_GpuResource.offset), pInvokingClient, pParentRef, pSharePolicy);
129 }
130 
131 static NvBool __nvoc_thunk_RmResource_ofactxAccessCallback(struct OfaContext *pResource, struct RsClient *pInvokingClient, void *pAllocParams, RsAccessRight accessRight) {
132     return rmresAccessCallback((struct RmResource *)(((unsigned char *)pResource) + __nvoc_rtti_OfaContext_RmResource.offset), pInvokingClient, pAllocParams, accessRight);
133 }
134 
135 static NV_STATUS __nvoc_thunk_RsResource_ofactxMapTo(struct OfaContext *pResource, RS_RES_MAP_TO_PARAMS *pParams) {
136     return resMapTo((struct RsResource *)(((unsigned char *)pResource) + __nvoc_rtti_OfaContext_RsResource.offset), pParams);
137 }
138 
139 static NV_STATUS __nvoc_thunk_GpuResource_ofactxGetMapAddrSpace(struct OfaContext *pGpuResource, struct CALL_CONTEXT *pCallContext, NvU32 mapFlags, NV_ADDRESS_SPACE *pAddrSpace) {
140     return gpuresGetMapAddrSpace((struct GpuResource *)(((unsigned char *)pGpuResource) + __nvoc_rtti_OfaContext_GpuResource.offset), pCallContext, mapFlags, pAddrSpace);
141 }
142 
143 static void __nvoc_thunk_Notifier_ofactxSetNotificationShare(struct OfaContext *pNotifier, struct NotifShare *pNotifShare) {
144     notifySetNotificationShare((struct Notifier *)(((unsigned char *)pNotifier) + __nvoc_rtti_OfaContext_Notifier.offset), pNotifShare);
145 }
146 
147 static NvU32 __nvoc_thunk_RsResource_ofactxGetRefCount(struct OfaContext *pResource) {
148     return resGetRefCount((struct RsResource *)(((unsigned char *)pResource) + __nvoc_rtti_OfaContext_RsResource.offset));
149 }
150 
151 static void __nvoc_thunk_RsResource_ofactxAddAdditionalDependants(struct RsClient *pClient, struct OfaContext *pResource, RsResourceRef *pReference) {
152     resAddAdditionalDependants(pClient, (struct RsResource *)(((unsigned char *)pResource) + __nvoc_rtti_OfaContext_RsResource.offset), pReference);
153 }
154 
155 static NV_STATUS __nvoc_thunk_RmResource_ofactxControl_Prologue(struct OfaContext *pResource, struct CALL_CONTEXT *pCallContext, struct RS_RES_CONTROL_PARAMS_INTERNAL *pParams) {
156     return rmresControl_Prologue((struct RmResource *)(((unsigned char *)pResource) + __nvoc_rtti_OfaContext_RmResource.offset), pCallContext, pParams);
157 }
158 
159 static NV_STATUS __nvoc_thunk_GpuResource_ofactxGetRegBaseOffsetAndSize(struct OfaContext *pGpuResource, struct OBJGPU *pGpu, NvU32 *pOffset, NvU32 *pSize) {
160     return gpuresGetRegBaseOffsetAndSize((struct GpuResource *)(((unsigned char *)pGpuResource) + __nvoc_rtti_OfaContext_GpuResource.offset), pGpu, pOffset, pSize);
161 }
162 
163 static NV_STATUS __nvoc_thunk_GpuResource_ofactxInternalControlForward(struct OfaContext *pGpuResource, NvU32 command, void *pParams, NvU32 size) {
164     return gpuresInternalControlForward((struct GpuResource *)(((unsigned char *)pGpuResource) + __nvoc_rtti_OfaContext_GpuResource.offset), command, pParams, size);
165 }
166 
167 static NV_STATUS __nvoc_thunk_RsResource_ofactxUnmapFrom(struct OfaContext *pResource, RS_RES_UNMAP_FROM_PARAMS *pParams) {
168     return resUnmapFrom((struct RsResource *)(((unsigned char *)pResource) + __nvoc_rtti_OfaContext_RsResource.offset), pParams);
169 }
170 
171 static void __nvoc_thunk_RmResource_ofactxControl_Epilogue(struct OfaContext *pResource, struct CALL_CONTEXT *pCallContext, struct RS_RES_CONTROL_PARAMS_INTERNAL *pParams) {
172     rmresControl_Epilogue((struct RmResource *)(((unsigned char *)pResource) + __nvoc_rtti_OfaContext_RmResource.offset), pCallContext, pParams);
173 }
174 
175 static NV_STATUS __nvoc_thunk_RsResource_ofactxControlLookup(struct OfaContext *pResource, struct RS_RES_CONTROL_PARAMS_INTERNAL *pParams, const struct NVOC_EXPORTED_METHOD_DEF **ppEntry) {
176     return resControlLookup((struct RsResource *)(((unsigned char *)pResource) + __nvoc_rtti_OfaContext_RsResource.offset), pParams, ppEntry);
177 }
178 
179 static NV_STATUS __nvoc_thunk_ChannelDescendant_ofactxGetSwMethods(struct OfaContext *pChannelDescendant, const METHOD **ppMethods, NvU32 *pNumMethods) {
180     return chandesGetSwMethods((struct ChannelDescendant *)(((unsigned char *)pChannelDescendant) + __nvoc_rtti_OfaContext_ChannelDescendant.offset), ppMethods, pNumMethods);
181 }
182 
183 static NvHandle __nvoc_thunk_GpuResource_ofactxGetInternalObjectHandle(struct OfaContext *pGpuResource) {
184     return gpuresGetInternalObjectHandle((struct GpuResource *)(((unsigned char *)pGpuResource) + __nvoc_rtti_OfaContext_GpuResource.offset));
185 }
186 
187 static NV_STATUS __nvoc_thunk_GpuResource_ofactxControl(struct OfaContext *pGpuResource, struct CALL_CONTEXT *pCallContext, struct RS_RES_CONTROL_PARAMS_INTERNAL *pParams) {
188     return gpuresControl((struct GpuResource *)(((unsigned char *)pGpuResource) + __nvoc_rtti_OfaContext_GpuResource.offset), pCallContext, pParams);
189 }
190 
191 static NV_STATUS __nvoc_thunk_GpuResource_ofactxUnmap(struct OfaContext *pGpuResource, struct CALL_CONTEXT *pCallContext, struct RsCpuMapping *pCpuMapping) {
192     return gpuresUnmap((struct GpuResource *)(((unsigned char *)pGpuResource) + __nvoc_rtti_OfaContext_GpuResource.offset), pCallContext, pCpuMapping);
193 }
194 
195 static NV_STATUS __nvoc_thunk_RmResource_ofactxGetMemInterMapParams(struct OfaContext *pRmResource, RMRES_MEM_INTER_MAP_PARAMS *pParams) {
196     return rmresGetMemInterMapParams((struct RmResource *)(((unsigned char *)pRmResource) + __nvoc_rtti_OfaContext_RmResource.offset), pParams);
197 }
198 
199 static NV_STATUS __nvoc_thunk_RmResource_ofactxGetMemoryMappingDescriptor(struct OfaContext *pRmResource, struct MEMORY_DESCRIPTOR **ppMemDesc) {
200     return rmresGetMemoryMappingDescriptor((struct RmResource *)(((unsigned char *)pRmResource) + __nvoc_rtti_OfaContext_RmResource.offset), ppMemDesc);
201 }
202 
203 static NvBool __nvoc_thunk_ChannelDescendant_ofactxIsSwMethodStalling(struct OfaContext *pChannelDescendant, NvU32 hHandle) {
204     return chandesIsSwMethodStalling((struct ChannelDescendant *)(((unsigned char *)pChannelDescendant) + __nvoc_rtti_OfaContext_ChannelDescendant.offset), hHandle);
205 }
206 
207 static NV_STATUS __nvoc_thunk_RsResource_ofactxControlFilter(struct OfaContext *pResource, struct CALL_CONTEXT *pCallContext, struct RS_RES_CONTROL_PARAMS_INTERNAL *pParams) {
208     return resControlFilter((struct RsResource *)(((unsigned char *)pResource) + __nvoc_rtti_OfaContext_RsResource.offset), pCallContext, pParams);
209 }
210 
211 static NV_STATUS __nvoc_thunk_Notifier_ofactxUnregisterEvent(struct OfaContext *pNotifier, NvHandle hNotifierClient, NvHandle hNotifierResource, NvHandle hEventClient, NvHandle hEvent) {
212     return notifyUnregisterEvent((struct Notifier *)(((unsigned char *)pNotifier) + __nvoc_rtti_OfaContext_Notifier.offset), hNotifierClient, hNotifierResource, hEventClient, hEvent);
213 }
214 
215 static NV_STATUS __nvoc_thunk_RmResource_ofactxControlSerialization_Prologue(struct OfaContext *pResource, struct CALL_CONTEXT *pCallContext, struct RS_RES_CONTROL_PARAMS_INTERNAL *pParams) {
216     return rmresControlSerialization_Prologue((struct RmResource *)(((unsigned char *)pResource) + __nvoc_rtti_OfaContext_RmResource.offset), pCallContext, pParams);
217 }
218 
219 static NvBool __nvoc_thunk_RsResource_ofactxCanCopy(struct OfaContext *pResource) {
220     return resCanCopy((struct RsResource *)(((unsigned char *)pResource) + __nvoc_rtti_OfaContext_RsResource.offset));
221 }
222 
223 static void __nvoc_thunk_RsResource_ofactxPreDestruct(struct OfaContext *pResource) {
224     resPreDestruct((struct RsResource *)(((unsigned char *)pResource) + __nvoc_rtti_OfaContext_RsResource.offset));
225 }
226 
227 static NV_STATUS __nvoc_thunk_RsResource_ofactxIsDuplicate(struct OfaContext *pResource, NvHandle hMemory, NvBool *pDuplicate) {
228     return resIsDuplicate((struct RsResource *)(((unsigned char *)pResource) + __nvoc_rtti_OfaContext_RsResource.offset), hMemory, pDuplicate);
229 }
230 
231 static void __nvoc_thunk_RmResource_ofactxControlSerialization_Epilogue(struct OfaContext *pResource, struct CALL_CONTEXT *pCallContext, struct RS_RES_CONTROL_PARAMS_INTERNAL *pParams) {
232     rmresControlSerialization_Epilogue((struct RmResource *)(((unsigned char *)pResource) + __nvoc_rtti_OfaContext_RmResource.offset), pCallContext, pParams);
233 }
234 
235 static PEVENTNOTIFICATION *__nvoc_thunk_Notifier_ofactxGetNotificationListPtr(struct OfaContext *pNotifier) {
236     return notifyGetNotificationListPtr((struct Notifier *)(((unsigned char *)pNotifier) + __nvoc_rtti_OfaContext_Notifier.offset));
237 }
238 
239 static struct NotifShare *__nvoc_thunk_Notifier_ofactxGetNotificationShare(struct OfaContext *pNotifier) {
240     return notifyGetNotificationShare((struct Notifier *)(((unsigned char *)pNotifier) + __nvoc_rtti_OfaContext_Notifier.offset));
241 }
242 
243 static NV_STATUS __nvoc_thunk_GpuResource_ofactxMap(struct OfaContext *pGpuResource, struct CALL_CONTEXT *pCallContext, struct RS_CPU_MAP_PARAMS *pParams, struct RsCpuMapping *pCpuMapping) {
244     return gpuresMap((struct GpuResource *)(((unsigned char *)pGpuResource) + __nvoc_rtti_OfaContext_GpuResource.offset), pCallContext, pParams, pCpuMapping);
245 }
246 
247 static NV_STATUS __nvoc_thunk_Notifier_ofactxGetOrAllocNotifShare(struct OfaContext *pNotifier, NvHandle hNotifierClient, NvHandle hNotifierResource, struct NotifShare **ppNotifShare) {
248     return notifyGetOrAllocNotifShare((struct Notifier *)(((unsigned char *)pNotifier) + __nvoc_rtti_OfaContext_Notifier.offset), hNotifierClient, hNotifierResource, ppNotifShare);
249 }
250 
251 const struct NVOC_EXPORT_INFO __nvoc_export_info_OfaContext =
252 {
253     /*numEntries=*/     0,
254     /*pExportEntries=*/  0
255 };
256 
257 void __nvoc_dtor_ChannelDescendant(ChannelDescendant*);
258 void __nvoc_dtor_OfaContext(OfaContext *pThis) {
259     __nvoc_ofactxDestruct(pThis);
260     __nvoc_dtor_ChannelDescendant(&pThis->__nvoc_base_ChannelDescendant);
261     PORT_UNREFERENCED_VARIABLE(pThis);
262 }
263 
264 void __nvoc_init_dataField_OfaContext(OfaContext *pThis, RmHalspecOwner *pRmhalspecowner) {
265     RmVariantHal *rmVariantHal = &pRmhalspecowner->rmVariantHal;
266     const unsigned long rmVariantHal_HalVarIdx = (unsigned long)rmVariantHal->__nvoc_HalVarIdx;
267     PORT_UNREFERENCED_VARIABLE(pThis);
268     PORT_UNREFERENCED_VARIABLE(pRmhalspecowner);
269     PORT_UNREFERENCED_VARIABLE(rmVariantHal);
270     PORT_UNREFERENCED_VARIABLE(rmVariantHal_HalVarIdx);
271 }
272 
273 NV_STATUS __nvoc_ctor_ChannelDescendant(ChannelDescendant* , RmHalspecOwner* , struct CALL_CONTEXT *, struct RS_RES_ALLOC_PARAMS_INTERNAL *, ENGDESCRIPTOR (*)(struct OBJGPU *, NvU32, void *));
274 NV_STATUS __nvoc_ctor_OfaContext(OfaContext *pThis, RmHalspecOwner *pRmhalspecowner, struct CALL_CONTEXT * arg_pCallContext, struct RS_RES_ALLOC_PARAMS_INTERNAL * arg_pParams) {
275     NV_STATUS status = NV_OK;
276     status = __nvoc_ctor_ChannelDescendant(&pThis->__nvoc_base_ChannelDescendant, pRmhalspecowner, arg_pCallContext, arg_pParams, ofaGetEngineDescFromAllocParams);
277     if (status != NV_OK) goto __nvoc_ctor_OfaContext_fail_ChannelDescendant;
278     __nvoc_init_dataField_OfaContext(pThis, pRmhalspecowner);
279 
280     status = __nvoc_ofactxConstruct(pThis, arg_pCallContext, arg_pParams);
281     if (status != NV_OK) goto __nvoc_ctor_OfaContext_fail__init;
282     goto __nvoc_ctor_OfaContext_exit; // Success
283 
284 __nvoc_ctor_OfaContext_fail__init:
285     __nvoc_dtor_ChannelDescendant(&pThis->__nvoc_base_ChannelDescendant);
286 __nvoc_ctor_OfaContext_fail_ChannelDescendant:
287 __nvoc_ctor_OfaContext_exit:
288 
289     return status;
290 }
291 
292 static void __nvoc_init_funcTable_OfaContext_1(OfaContext *pThis, RmHalspecOwner *pRmhalspecowner) {
293     RmVariantHal *rmVariantHal = &pRmhalspecowner->rmVariantHal;
294     const unsigned long rmVariantHal_HalVarIdx = (unsigned long)rmVariantHal->__nvoc_HalVarIdx;
295     PORT_UNREFERENCED_VARIABLE(pThis);
296     PORT_UNREFERENCED_VARIABLE(pRmhalspecowner);
297     PORT_UNREFERENCED_VARIABLE(rmVariantHal);
298     PORT_UNREFERENCED_VARIABLE(rmVariantHal_HalVarIdx);
299 
300     pThis->__ofactxCheckMemInterUnmap__ = &__nvoc_thunk_ChannelDescendant_ofactxCheckMemInterUnmap;
301 
302     pThis->__ofactxShareCallback__ = &__nvoc_thunk_GpuResource_ofactxShareCallback;
303 
304     pThis->__ofactxAccessCallback__ = &__nvoc_thunk_RmResource_ofactxAccessCallback;
305 
306     pThis->__ofactxMapTo__ = &__nvoc_thunk_RsResource_ofactxMapTo;
307 
308     pThis->__ofactxGetMapAddrSpace__ = &__nvoc_thunk_GpuResource_ofactxGetMapAddrSpace;
309 
310     pThis->__ofactxSetNotificationShare__ = &__nvoc_thunk_Notifier_ofactxSetNotificationShare;
311 
312     pThis->__ofactxGetRefCount__ = &__nvoc_thunk_RsResource_ofactxGetRefCount;
313 
314     pThis->__ofactxAddAdditionalDependants__ = &__nvoc_thunk_RsResource_ofactxAddAdditionalDependants;
315 
316     pThis->__ofactxControl_Prologue__ = &__nvoc_thunk_RmResource_ofactxControl_Prologue;
317 
318     pThis->__ofactxGetRegBaseOffsetAndSize__ = &__nvoc_thunk_GpuResource_ofactxGetRegBaseOffsetAndSize;
319 
320     pThis->__ofactxInternalControlForward__ = &__nvoc_thunk_GpuResource_ofactxInternalControlForward;
321 
322     pThis->__ofactxUnmapFrom__ = &__nvoc_thunk_RsResource_ofactxUnmapFrom;
323 
324     pThis->__ofactxControl_Epilogue__ = &__nvoc_thunk_RmResource_ofactxControl_Epilogue;
325 
326     pThis->__ofactxControlLookup__ = &__nvoc_thunk_RsResource_ofactxControlLookup;
327 
328     pThis->__ofactxGetSwMethods__ = &__nvoc_thunk_ChannelDescendant_ofactxGetSwMethods;
329 
330     pThis->__ofactxGetInternalObjectHandle__ = &__nvoc_thunk_GpuResource_ofactxGetInternalObjectHandle;
331 
332     pThis->__ofactxControl__ = &__nvoc_thunk_GpuResource_ofactxControl;
333 
334     pThis->__ofactxUnmap__ = &__nvoc_thunk_GpuResource_ofactxUnmap;
335 
336     pThis->__ofactxGetMemInterMapParams__ = &__nvoc_thunk_RmResource_ofactxGetMemInterMapParams;
337 
338     pThis->__ofactxGetMemoryMappingDescriptor__ = &__nvoc_thunk_RmResource_ofactxGetMemoryMappingDescriptor;
339 
340     pThis->__ofactxIsSwMethodStalling__ = &__nvoc_thunk_ChannelDescendant_ofactxIsSwMethodStalling;
341 
342     pThis->__ofactxControlFilter__ = &__nvoc_thunk_RsResource_ofactxControlFilter;
343 
344     pThis->__ofactxUnregisterEvent__ = &__nvoc_thunk_Notifier_ofactxUnregisterEvent;
345 
346     pThis->__ofactxControlSerialization_Prologue__ = &__nvoc_thunk_RmResource_ofactxControlSerialization_Prologue;
347 
348     pThis->__ofactxCanCopy__ = &__nvoc_thunk_RsResource_ofactxCanCopy;
349 
350     pThis->__ofactxPreDestruct__ = &__nvoc_thunk_RsResource_ofactxPreDestruct;
351 
352     pThis->__ofactxIsDuplicate__ = &__nvoc_thunk_RsResource_ofactxIsDuplicate;
353 
354     pThis->__ofactxControlSerialization_Epilogue__ = &__nvoc_thunk_RmResource_ofactxControlSerialization_Epilogue;
355 
356     pThis->__ofactxGetNotificationListPtr__ = &__nvoc_thunk_Notifier_ofactxGetNotificationListPtr;
357 
358     pThis->__ofactxGetNotificationShare__ = &__nvoc_thunk_Notifier_ofactxGetNotificationShare;
359 
360     pThis->__ofactxMap__ = &__nvoc_thunk_GpuResource_ofactxMap;
361 
362     pThis->__ofactxGetOrAllocNotifShare__ = &__nvoc_thunk_Notifier_ofactxGetOrAllocNotifShare;
363 }
364 
365 void __nvoc_init_funcTable_OfaContext(OfaContext *pThis, RmHalspecOwner *pRmhalspecowner) {
366     __nvoc_init_funcTable_OfaContext_1(pThis, pRmhalspecowner);
367 }
368 
369 void __nvoc_init_ChannelDescendant(ChannelDescendant*, RmHalspecOwner* );
370 void __nvoc_init_OfaContext(OfaContext *pThis, RmHalspecOwner *pRmhalspecowner) {
371     pThis->__nvoc_pbase_OfaContext = pThis;
372     pThis->__nvoc_pbase_Object = &pThis->__nvoc_base_ChannelDescendant.__nvoc_base_GpuResource.__nvoc_base_RmResource.__nvoc_base_RsResource.__nvoc_base_Object;
373     pThis->__nvoc_pbase_RsResource = &pThis->__nvoc_base_ChannelDescendant.__nvoc_base_GpuResource.__nvoc_base_RmResource.__nvoc_base_RsResource;
374     pThis->__nvoc_pbase_RmResourceCommon = &pThis->__nvoc_base_ChannelDescendant.__nvoc_base_GpuResource.__nvoc_base_RmResource.__nvoc_base_RmResourceCommon;
375     pThis->__nvoc_pbase_RmResource = &pThis->__nvoc_base_ChannelDescendant.__nvoc_base_GpuResource.__nvoc_base_RmResource;
376     pThis->__nvoc_pbase_GpuResource = &pThis->__nvoc_base_ChannelDescendant.__nvoc_base_GpuResource;
377     pThis->__nvoc_pbase_INotifier = &pThis->__nvoc_base_ChannelDescendant.__nvoc_base_Notifier.__nvoc_base_INotifier;
378     pThis->__nvoc_pbase_Notifier = &pThis->__nvoc_base_ChannelDescendant.__nvoc_base_Notifier;
379     pThis->__nvoc_pbase_ChannelDescendant = &pThis->__nvoc_base_ChannelDescendant;
380     __nvoc_init_ChannelDescendant(&pThis->__nvoc_base_ChannelDescendant, pRmhalspecowner);
381     __nvoc_init_funcTable_OfaContext(pThis, pRmhalspecowner);
382 }
383 
384 NV_STATUS __nvoc_objCreate_OfaContext(OfaContext **ppThis, Dynamic *pParent, NvU32 createFlags, struct CALL_CONTEXT * arg_pCallContext, struct RS_RES_ALLOC_PARAMS_INTERNAL * arg_pParams) {
385     NV_STATUS status;
386     Object *pParentObj;
387     OfaContext *pThis;
388     RmHalspecOwner *pRmhalspecowner;
389 
390     status = __nvoc_handleObjCreateMemAlloc(createFlags, sizeof(OfaContext), (void**)&pThis, (void**)ppThis);
391     if (status != NV_OK)
392         return status;
393 
394     portMemSet(pThis, 0, sizeof(OfaContext));
395 
396     __nvoc_initRtti(staticCast(pThis, Dynamic), &__nvoc_class_def_OfaContext);
397 
398     pThis->__nvoc_base_ChannelDescendant.__nvoc_base_GpuResource.__nvoc_base_RmResource.__nvoc_base_RsResource.__nvoc_base_Object.createFlags = createFlags;
399 
400     if (pParent != NULL && !(createFlags & NVOC_OBJ_CREATE_FLAGS_PARENT_HALSPEC_ONLY))
401     {
402         pParentObj = dynamicCast(pParent, Object);
403         objAddChild(pParentObj, &pThis->__nvoc_base_ChannelDescendant.__nvoc_base_GpuResource.__nvoc_base_RmResource.__nvoc_base_RsResource.__nvoc_base_Object);
404     }
405     else
406     {
407         pThis->__nvoc_base_ChannelDescendant.__nvoc_base_GpuResource.__nvoc_base_RmResource.__nvoc_base_RsResource.__nvoc_base_Object.pParent = NULL;
408     }
409 
410     if ((pRmhalspecowner = dynamicCast(pParent, RmHalspecOwner)) == NULL)
411         pRmhalspecowner = objFindAncestorOfType(RmHalspecOwner, pParent);
412     NV_ASSERT_OR_RETURN(pRmhalspecowner != NULL, NV_ERR_INVALID_ARGUMENT);
413 
414     __nvoc_init_OfaContext(pThis, pRmhalspecowner);
415     status = __nvoc_ctor_OfaContext(pThis, pRmhalspecowner, arg_pCallContext, arg_pParams);
416     if (status != NV_OK) goto __nvoc_objCreate_OfaContext_cleanup;
417 
418     *ppThis = pThis;
419 
420     return NV_OK;
421 
422 __nvoc_objCreate_OfaContext_cleanup:
423     // do not call destructors here since the constructor already called them
424     if (createFlags & NVOC_OBJ_CREATE_FLAGS_IN_PLACE_CONSTRUCT)
425         portMemSet(pThis, 0, sizeof(OfaContext));
426     else
427         portMemFree(pThis);
428 
429     // coverity[leaked_storage:FALSE]
430     return status;
431 }
432 
433 NV_STATUS __nvoc_objCreateDynamic_OfaContext(OfaContext **ppThis, Dynamic *pParent, NvU32 createFlags, va_list args) {
434     NV_STATUS status;
435     struct CALL_CONTEXT * arg_pCallContext = va_arg(args, struct CALL_CONTEXT *);
436     struct RS_RES_ALLOC_PARAMS_INTERNAL * arg_pParams = va_arg(args, struct RS_RES_ALLOC_PARAMS_INTERNAL *);
437 
438     status = __nvoc_objCreate_OfaContext(ppThis, pParent, createFlags, arg_pCallContext, arg_pParams);
439 
440     return status;
441 }
442 
443