1 #define NVOC_OS_DESC_MEM_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_os_desc_mem_nvoc.h"
9
10 #ifdef DEBUG
11 char __nvoc_class_id_uniqueness_check_0xb3dacd = 1;
12 #endif
13
14 extern const struct NVOC_CLASS_DEF __nvoc_class_def_OsDescMemory;
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_Memory;
25
26 void __nvoc_init_OsDescMemory(OsDescMemory*);
27 void __nvoc_init_funcTable_OsDescMemory(OsDescMemory*);
28 NV_STATUS __nvoc_ctor_OsDescMemory(OsDescMemory*, CALL_CONTEXT * arg_pCallContext, struct RS_RES_ALLOC_PARAMS_INTERNAL * arg_pParams);
29 void __nvoc_init_dataField_OsDescMemory(OsDescMemory*);
30 void __nvoc_dtor_OsDescMemory(OsDescMemory*);
31 extern const struct NVOC_EXPORT_INFO __nvoc_export_info_OsDescMemory;
32
33 static const struct NVOC_RTTI __nvoc_rtti_OsDescMemory_OsDescMemory = {
34 /*pClassDef=*/ &__nvoc_class_def_OsDescMemory,
35 /*dtor=*/ (NVOC_DYNAMIC_DTOR) &__nvoc_dtor_OsDescMemory,
36 /*offset=*/ 0,
37 };
38
39 static const struct NVOC_RTTI __nvoc_rtti_OsDescMemory_Object = {
40 /*pClassDef=*/ &__nvoc_class_def_Object,
41 /*dtor=*/ &__nvoc_destructFromBase,
42 /*offset=*/ NV_OFFSETOF(OsDescMemory, __nvoc_base_Memory.__nvoc_base_RmResource.__nvoc_base_RsResource.__nvoc_base_Object),
43 };
44
45 static const struct NVOC_RTTI __nvoc_rtti_OsDescMemory_RsResource = {
46 /*pClassDef=*/ &__nvoc_class_def_RsResource,
47 /*dtor=*/ &__nvoc_destructFromBase,
48 /*offset=*/ NV_OFFSETOF(OsDescMemory, __nvoc_base_Memory.__nvoc_base_RmResource.__nvoc_base_RsResource),
49 };
50
51 static const struct NVOC_RTTI __nvoc_rtti_OsDescMemory_RmResourceCommon = {
52 /*pClassDef=*/ &__nvoc_class_def_RmResourceCommon,
53 /*dtor=*/ &__nvoc_destructFromBase,
54 /*offset=*/ NV_OFFSETOF(OsDescMemory, __nvoc_base_Memory.__nvoc_base_RmResource.__nvoc_base_RmResourceCommon),
55 };
56
57 static const struct NVOC_RTTI __nvoc_rtti_OsDescMemory_RmResource = {
58 /*pClassDef=*/ &__nvoc_class_def_RmResource,
59 /*dtor=*/ &__nvoc_destructFromBase,
60 /*offset=*/ NV_OFFSETOF(OsDescMemory, __nvoc_base_Memory.__nvoc_base_RmResource),
61 };
62
63 static const struct NVOC_RTTI __nvoc_rtti_OsDescMemory_Memory = {
64 /*pClassDef=*/ &__nvoc_class_def_Memory,
65 /*dtor=*/ &__nvoc_destructFromBase,
66 /*offset=*/ NV_OFFSETOF(OsDescMemory, __nvoc_base_Memory),
67 };
68
69 static const struct NVOC_CASTINFO __nvoc_castinfo_OsDescMemory = {
70 /*numRelatives=*/ 6,
71 /*relatives=*/ {
72 &__nvoc_rtti_OsDescMemory_OsDescMemory,
73 &__nvoc_rtti_OsDescMemory_Memory,
74 &__nvoc_rtti_OsDescMemory_RmResource,
75 &__nvoc_rtti_OsDescMemory_RmResourceCommon,
76 &__nvoc_rtti_OsDescMemory_RsResource,
77 &__nvoc_rtti_OsDescMemory_Object,
78 },
79 };
80
81 const struct NVOC_CLASS_DEF __nvoc_class_def_OsDescMemory =
82 {
83 /*classInfo=*/ {
84 /*size=*/ sizeof(OsDescMemory),
85 /*classId=*/ classId(OsDescMemory),
86 /*providerId=*/ &__nvoc_rtti_provider,
87 #if NV_PRINTF_STRINGS_ALLOWED
88 /*name=*/ "OsDescMemory",
89 #endif
90 },
91 /*objCreatefn=*/ (NVOC_DYNAMIC_OBJ_CREATE) &__nvoc_objCreateDynamic_OsDescMemory,
92 /*pCastInfo=*/ &__nvoc_castinfo_OsDescMemory,
93 /*pExportInfo=*/ &__nvoc_export_info_OsDescMemory
94 };
95
__nvoc_thunk_OsDescMemory_resCanCopy(struct RsResource * pOsDescMemory)96 static NvBool __nvoc_thunk_OsDescMemory_resCanCopy(struct RsResource *pOsDescMemory) {
97 return osdescCanCopy((struct OsDescMemory *)(((unsigned char *)pOsDescMemory) - __nvoc_rtti_OsDescMemory_RsResource.offset));
98 }
99
__nvoc_thunk_Memory_osdescCheckMemInterUnmap(struct OsDescMemory * pMemory,NvBool bSubdeviceHandleProvided)100 static NV_STATUS __nvoc_thunk_Memory_osdescCheckMemInterUnmap(struct OsDescMemory *pMemory, NvBool bSubdeviceHandleProvided) {
101 return memCheckMemInterUnmap((struct Memory *)(((unsigned char *)pMemory) + __nvoc_rtti_OsDescMemory_Memory.offset), bSubdeviceHandleProvided);
102 }
103
__nvoc_thunk_RmResource_osdescShareCallback(struct OsDescMemory * pResource,struct RsClient * pInvokingClient,struct RsResourceRef * pParentRef,RS_SHARE_POLICY * pSharePolicy)104 static NvBool __nvoc_thunk_RmResource_osdescShareCallback(struct OsDescMemory *pResource, struct RsClient *pInvokingClient, struct RsResourceRef *pParentRef, RS_SHARE_POLICY *pSharePolicy) {
105 return rmresShareCallback((struct RmResource *)(((unsigned char *)pResource) + __nvoc_rtti_OsDescMemory_RmResource.offset), pInvokingClient, pParentRef, pSharePolicy);
106 }
107
__nvoc_thunk_RsResource_osdescMapTo(struct OsDescMemory * pResource,RS_RES_MAP_TO_PARAMS * pParams)108 static NV_STATUS __nvoc_thunk_RsResource_osdescMapTo(struct OsDescMemory *pResource, RS_RES_MAP_TO_PARAMS *pParams) {
109 return resMapTo((struct RsResource *)(((unsigned char *)pResource) + __nvoc_rtti_OsDescMemory_RsResource.offset), pParams);
110 }
111
__nvoc_thunk_Memory_osdescGetMapAddrSpace(struct OsDescMemory * pMemory,CALL_CONTEXT * pCallContext,NvU32 mapFlags,NV_ADDRESS_SPACE * pAddrSpace)112 static NV_STATUS __nvoc_thunk_Memory_osdescGetMapAddrSpace(struct OsDescMemory *pMemory, CALL_CONTEXT *pCallContext, NvU32 mapFlags, NV_ADDRESS_SPACE *pAddrSpace) {
113 return memGetMapAddrSpace((struct Memory *)(((unsigned char *)pMemory) + __nvoc_rtti_OsDescMemory_Memory.offset), pCallContext, mapFlags, pAddrSpace);
114 }
115
__nvoc_thunk_Memory_osdescIsExportAllowed(struct OsDescMemory * pMemory)116 static NvBool __nvoc_thunk_Memory_osdescIsExportAllowed(struct OsDescMemory *pMemory) {
117 return memIsExportAllowed((struct Memory *)(((unsigned char *)pMemory) + __nvoc_rtti_OsDescMemory_Memory.offset));
118 }
119
__nvoc_thunk_RsResource_osdescGetRefCount(struct OsDescMemory * pResource)120 static NvU32 __nvoc_thunk_RsResource_osdescGetRefCount(struct OsDescMemory *pResource) {
121 return resGetRefCount((struct RsResource *)(((unsigned char *)pResource) + __nvoc_rtti_OsDescMemory_RsResource.offset));
122 }
123
__nvoc_thunk_RsResource_osdescAddAdditionalDependants(struct RsClient * pClient,struct OsDescMemory * pResource,RsResourceRef * pReference)124 static void __nvoc_thunk_RsResource_osdescAddAdditionalDependants(struct RsClient *pClient, struct OsDescMemory *pResource, RsResourceRef *pReference) {
125 resAddAdditionalDependants(pClient, (struct RsResource *)(((unsigned char *)pResource) + __nvoc_rtti_OsDescMemory_RsResource.offset), pReference);
126 }
127
__nvoc_thunk_RmResource_osdescControl_Prologue(struct OsDescMemory * pResource,CALL_CONTEXT * pCallContext,struct RS_RES_CONTROL_PARAMS_INTERNAL * pParams)128 static NV_STATUS __nvoc_thunk_RmResource_osdescControl_Prologue(struct OsDescMemory *pResource, CALL_CONTEXT *pCallContext, struct RS_RES_CONTROL_PARAMS_INTERNAL *pParams) {
129 return rmresControl_Prologue((struct RmResource *)(((unsigned char *)pResource) + __nvoc_rtti_OsDescMemory_RmResource.offset), pCallContext, pParams);
130 }
131
__nvoc_thunk_Memory_osdescIsGpuMapAllowed(struct OsDescMemory * pMemory,struct OBJGPU * pGpu)132 static NvBool __nvoc_thunk_Memory_osdescIsGpuMapAllowed(struct OsDescMemory *pMemory, struct OBJGPU *pGpu) {
133 return memIsGpuMapAllowed((struct Memory *)(((unsigned char *)pMemory) + __nvoc_rtti_OsDescMemory_Memory.offset), pGpu);
134 }
135
__nvoc_thunk_RsResource_osdescUnmapFrom(struct OsDescMemory * pResource,RS_RES_UNMAP_FROM_PARAMS * pParams)136 static NV_STATUS __nvoc_thunk_RsResource_osdescUnmapFrom(struct OsDescMemory *pResource, RS_RES_UNMAP_FROM_PARAMS *pParams) {
137 return resUnmapFrom((struct RsResource *)(((unsigned char *)pResource) + __nvoc_rtti_OsDescMemory_RsResource.offset), pParams);
138 }
139
__nvoc_thunk_RmResource_osdescControl_Epilogue(struct OsDescMemory * pResource,CALL_CONTEXT * pCallContext,struct RS_RES_CONTROL_PARAMS_INTERNAL * pParams)140 static void __nvoc_thunk_RmResource_osdescControl_Epilogue(struct OsDescMemory *pResource, CALL_CONTEXT *pCallContext, struct RS_RES_CONTROL_PARAMS_INTERNAL *pParams) {
141 rmresControl_Epilogue((struct RmResource *)(((unsigned char *)pResource) + __nvoc_rtti_OsDescMemory_RmResource.offset), pCallContext, pParams);
142 }
143
__nvoc_thunk_Memory_osdescControl(struct OsDescMemory * pMemory,CALL_CONTEXT * pCallContext,struct RS_RES_CONTROL_PARAMS_INTERNAL * pParams)144 static NV_STATUS __nvoc_thunk_Memory_osdescControl(struct OsDescMemory *pMemory, CALL_CONTEXT *pCallContext, struct RS_RES_CONTROL_PARAMS_INTERNAL *pParams) {
145 return memControl((struct Memory *)(((unsigned char *)pMemory) + __nvoc_rtti_OsDescMemory_Memory.offset), pCallContext, pParams);
146 }
147
__nvoc_thunk_Memory_osdescUnmap(struct OsDescMemory * pMemory,CALL_CONTEXT * pCallContext,RsCpuMapping * pCpuMapping)148 static NV_STATUS __nvoc_thunk_Memory_osdescUnmap(struct OsDescMemory *pMemory, CALL_CONTEXT *pCallContext, RsCpuMapping *pCpuMapping) {
149 return memUnmap((struct Memory *)(((unsigned char *)pMemory) + __nvoc_rtti_OsDescMemory_Memory.offset), pCallContext, pCpuMapping);
150 }
151
__nvoc_thunk_Memory_osdescGetMemInterMapParams(struct OsDescMemory * pMemory,RMRES_MEM_INTER_MAP_PARAMS * pParams)152 static NV_STATUS __nvoc_thunk_Memory_osdescGetMemInterMapParams(struct OsDescMemory *pMemory, RMRES_MEM_INTER_MAP_PARAMS *pParams) {
153 return memGetMemInterMapParams((struct Memory *)(((unsigned char *)pMemory) + __nvoc_rtti_OsDescMemory_Memory.offset), pParams);
154 }
155
__nvoc_thunk_Memory_osdescGetMemoryMappingDescriptor(struct OsDescMemory * pMemory,MEMORY_DESCRIPTOR ** ppMemDesc)156 static NV_STATUS __nvoc_thunk_Memory_osdescGetMemoryMappingDescriptor(struct OsDescMemory *pMemory, MEMORY_DESCRIPTOR **ppMemDesc) {
157 return memGetMemoryMappingDescriptor((struct Memory *)(((unsigned char *)pMemory) + __nvoc_rtti_OsDescMemory_Memory.offset), ppMemDesc);
158 }
159
__nvoc_thunk_RsResource_osdescControlFilter(struct OsDescMemory * pResource,struct CALL_CONTEXT * pCallContext,struct RS_RES_CONTROL_PARAMS_INTERNAL * pParams)160 static NV_STATUS __nvoc_thunk_RsResource_osdescControlFilter(struct OsDescMemory *pResource, struct CALL_CONTEXT *pCallContext, struct RS_RES_CONTROL_PARAMS_INTERNAL *pParams) {
161 return resControlFilter((struct RsResource *)(((unsigned char *)pResource) + __nvoc_rtti_OsDescMemory_RsResource.offset), pCallContext, pParams);
162 }
163
__nvoc_thunk_RmResource_osdescControlSerialization_Prologue(struct OsDescMemory * pResource,CALL_CONTEXT * pCallContext,struct RS_RES_CONTROL_PARAMS_INTERNAL * pParams)164 static NV_STATUS __nvoc_thunk_RmResource_osdescControlSerialization_Prologue(struct OsDescMemory *pResource, CALL_CONTEXT *pCallContext, struct RS_RES_CONTROL_PARAMS_INTERNAL *pParams) {
165 return rmresControlSerialization_Prologue((struct RmResource *)(((unsigned char *)pResource) + __nvoc_rtti_OsDescMemory_RmResource.offset), pCallContext, pParams);
166 }
167
__nvoc_thunk_RsResource_osdescIsPartialUnmapSupported(struct OsDescMemory * pResource)168 static NvBool __nvoc_thunk_RsResource_osdescIsPartialUnmapSupported(struct OsDescMemory *pResource) {
169 return resIsPartialUnmapSupported((struct RsResource *)(((unsigned char *)pResource) + __nvoc_rtti_OsDescMemory_RsResource.offset));
170 }
171
__nvoc_thunk_Memory_osdescIsReady(struct OsDescMemory * pMemory,NvBool bCopyConstructorContext)172 static NV_STATUS __nvoc_thunk_Memory_osdescIsReady(struct OsDescMemory *pMemory, NvBool bCopyConstructorContext) {
173 return memIsReady((struct Memory *)(((unsigned char *)pMemory) + __nvoc_rtti_OsDescMemory_Memory.offset), bCopyConstructorContext);
174 }
175
__nvoc_thunk_Memory_osdescCheckCopyPermissions(struct OsDescMemory * pMemory,struct OBJGPU * pDstGpu,struct Device * pDstDevice)176 static NV_STATUS __nvoc_thunk_Memory_osdescCheckCopyPermissions(struct OsDescMemory *pMemory, struct OBJGPU *pDstGpu, struct Device *pDstDevice) {
177 return memCheckCopyPermissions((struct Memory *)(((unsigned char *)pMemory) + __nvoc_rtti_OsDescMemory_Memory.offset), pDstGpu, pDstDevice);
178 }
179
__nvoc_thunk_RsResource_osdescPreDestruct(struct OsDescMemory * pResource)180 static void __nvoc_thunk_RsResource_osdescPreDestruct(struct OsDescMemory *pResource) {
181 resPreDestruct((struct RsResource *)(((unsigned char *)pResource) + __nvoc_rtti_OsDescMemory_RsResource.offset));
182 }
183
__nvoc_thunk_Memory_osdescIsDuplicate(struct OsDescMemory * pMemory,NvHandle hMemory,NvBool * pDuplicate)184 static NV_STATUS __nvoc_thunk_Memory_osdescIsDuplicate(struct OsDescMemory *pMemory, NvHandle hMemory, NvBool *pDuplicate) {
185 return memIsDuplicate((struct Memory *)(((unsigned char *)pMemory) + __nvoc_rtti_OsDescMemory_Memory.offset), hMemory, pDuplicate);
186 }
187
__nvoc_thunk_RmResource_osdescControlSerialization_Epilogue(struct OsDescMemory * pResource,CALL_CONTEXT * pCallContext,struct RS_RES_CONTROL_PARAMS_INTERNAL * pParams)188 static void __nvoc_thunk_RmResource_osdescControlSerialization_Epilogue(struct OsDescMemory *pResource, CALL_CONTEXT *pCallContext, struct RS_RES_CONTROL_PARAMS_INTERNAL *pParams) {
189 rmresControlSerialization_Epilogue((struct RmResource *)(((unsigned char *)pResource) + __nvoc_rtti_OsDescMemory_RmResource.offset), pCallContext, pParams);
190 }
191
__nvoc_thunk_Memory_osdescMap(struct OsDescMemory * pMemory,CALL_CONTEXT * pCallContext,struct RS_CPU_MAP_PARAMS * pParams,RsCpuMapping * pCpuMapping)192 static NV_STATUS __nvoc_thunk_Memory_osdescMap(struct OsDescMemory *pMemory, CALL_CONTEXT *pCallContext, struct RS_CPU_MAP_PARAMS *pParams, RsCpuMapping *pCpuMapping) {
193 return memMap((struct Memory *)(((unsigned char *)pMemory) + __nvoc_rtti_OsDescMemory_Memory.offset), pCallContext, pParams, pCpuMapping);
194 }
195
__nvoc_thunk_RmResource_osdescAccessCallback(struct OsDescMemory * pResource,struct RsClient * pInvokingClient,void * pAllocParams,RsAccessRight accessRight)196 static NvBool __nvoc_thunk_RmResource_osdescAccessCallback(struct OsDescMemory *pResource, struct RsClient *pInvokingClient, void *pAllocParams, RsAccessRight accessRight) {
197 return rmresAccessCallback((struct RmResource *)(((unsigned char *)pResource) + __nvoc_rtti_OsDescMemory_RmResource.offset), pInvokingClient, pAllocParams, accessRight);
198 }
199
200 const struct NVOC_EXPORT_INFO __nvoc_export_info_OsDescMemory =
201 {
202 /*numEntries=*/ 0,
203 /*pExportEntries=*/ 0
204 };
205
206 void __nvoc_dtor_Memory(Memory*);
__nvoc_dtor_OsDescMemory(OsDescMemory * pThis)207 void __nvoc_dtor_OsDescMemory(OsDescMemory *pThis) {
208 __nvoc_dtor_Memory(&pThis->__nvoc_base_Memory);
209 PORT_UNREFERENCED_VARIABLE(pThis);
210 }
211
__nvoc_init_dataField_OsDescMemory(OsDescMemory * pThis)212 void __nvoc_init_dataField_OsDescMemory(OsDescMemory *pThis) {
213 PORT_UNREFERENCED_VARIABLE(pThis);
214 }
215
216 NV_STATUS __nvoc_ctor_Memory(Memory* , CALL_CONTEXT *, struct RS_RES_ALLOC_PARAMS_INTERNAL *);
__nvoc_ctor_OsDescMemory(OsDescMemory * pThis,CALL_CONTEXT * arg_pCallContext,struct RS_RES_ALLOC_PARAMS_INTERNAL * arg_pParams)217 NV_STATUS __nvoc_ctor_OsDescMemory(OsDescMemory *pThis, CALL_CONTEXT * arg_pCallContext, struct RS_RES_ALLOC_PARAMS_INTERNAL * arg_pParams) {
218 NV_STATUS status = NV_OK;
219 status = __nvoc_ctor_Memory(&pThis->__nvoc_base_Memory, arg_pCallContext, arg_pParams);
220 if (status != NV_OK) goto __nvoc_ctor_OsDescMemory_fail_Memory;
221 __nvoc_init_dataField_OsDescMemory(pThis);
222
223 status = __nvoc_osdescConstruct(pThis, arg_pCallContext, arg_pParams);
224 if (status != NV_OK) goto __nvoc_ctor_OsDescMemory_fail__init;
225 goto __nvoc_ctor_OsDescMemory_exit; // Success
226
227 __nvoc_ctor_OsDescMemory_fail__init:
228 __nvoc_dtor_Memory(&pThis->__nvoc_base_Memory);
229 __nvoc_ctor_OsDescMemory_fail_Memory:
230 __nvoc_ctor_OsDescMemory_exit:
231
232 return status;
233 }
234
__nvoc_init_funcTable_OsDescMemory_1(OsDescMemory * pThis)235 static void __nvoc_init_funcTable_OsDescMemory_1(OsDescMemory *pThis) {
236 PORT_UNREFERENCED_VARIABLE(pThis);
237
238 pThis->__osdescCanCopy__ = &osdescCanCopy_IMPL;
239
240 pThis->__nvoc_base_Memory.__nvoc_base_RmResource.__nvoc_base_RsResource.__resCanCopy__ = &__nvoc_thunk_OsDescMemory_resCanCopy;
241
242 pThis->__osdescCheckMemInterUnmap__ = &__nvoc_thunk_Memory_osdescCheckMemInterUnmap;
243
244 pThis->__osdescShareCallback__ = &__nvoc_thunk_RmResource_osdescShareCallback;
245
246 pThis->__osdescMapTo__ = &__nvoc_thunk_RsResource_osdescMapTo;
247
248 pThis->__osdescGetMapAddrSpace__ = &__nvoc_thunk_Memory_osdescGetMapAddrSpace;
249
250 pThis->__osdescIsExportAllowed__ = &__nvoc_thunk_Memory_osdescIsExportAllowed;
251
252 pThis->__osdescGetRefCount__ = &__nvoc_thunk_RsResource_osdescGetRefCount;
253
254 pThis->__osdescAddAdditionalDependants__ = &__nvoc_thunk_RsResource_osdescAddAdditionalDependants;
255
256 pThis->__osdescControl_Prologue__ = &__nvoc_thunk_RmResource_osdescControl_Prologue;
257
258 pThis->__osdescIsGpuMapAllowed__ = &__nvoc_thunk_Memory_osdescIsGpuMapAllowed;
259
260 pThis->__osdescUnmapFrom__ = &__nvoc_thunk_RsResource_osdescUnmapFrom;
261
262 pThis->__osdescControl_Epilogue__ = &__nvoc_thunk_RmResource_osdescControl_Epilogue;
263
264 pThis->__osdescControl__ = &__nvoc_thunk_Memory_osdescControl;
265
266 pThis->__osdescUnmap__ = &__nvoc_thunk_Memory_osdescUnmap;
267
268 pThis->__osdescGetMemInterMapParams__ = &__nvoc_thunk_Memory_osdescGetMemInterMapParams;
269
270 pThis->__osdescGetMemoryMappingDescriptor__ = &__nvoc_thunk_Memory_osdescGetMemoryMappingDescriptor;
271
272 pThis->__osdescControlFilter__ = &__nvoc_thunk_RsResource_osdescControlFilter;
273
274 pThis->__osdescControlSerialization_Prologue__ = &__nvoc_thunk_RmResource_osdescControlSerialization_Prologue;
275
276 pThis->__osdescIsPartialUnmapSupported__ = &__nvoc_thunk_RsResource_osdescIsPartialUnmapSupported;
277
278 pThis->__osdescIsReady__ = &__nvoc_thunk_Memory_osdescIsReady;
279
280 pThis->__osdescCheckCopyPermissions__ = &__nvoc_thunk_Memory_osdescCheckCopyPermissions;
281
282 pThis->__osdescPreDestruct__ = &__nvoc_thunk_RsResource_osdescPreDestruct;
283
284 pThis->__osdescIsDuplicate__ = &__nvoc_thunk_Memory_osdescIsDuplicate;
285
286 pThis->__osdescControlSerialization_Epilogue__ = &__nvoc_thunk_RmResource_osdescControlSerialization_Epilogue;
287
288 pThis->__osdescMap__ = &__nvoc_thunk_Memory_osdescMap;
289
290 pThis->__osdescAccessCallback__ = &__nvoc_thunk_RmResource_osdescAccessCallback;
291 }
292
__nvoc_init_funcTable_OsDescMemory(OsDescMemory * pThis)293 void __nvoc_init_funcTable_OsDescMemory(OsDescMemory *pThis) {
294 __nvoc_init_funcTable_OsDescMemory_1(pThis);
295 }
296
297 void __nvoc_init_Memory(Memory*);
__nvoc_init_OsDescMemory(OsDescMemory * pThis)298 void __nvoc_init_OsDescMemory(OsDescMemory *pThis) {
299 pThis->__nvoc_pbase_OsDescMemory = pThis;
300 pThis->__nvoc_pbase_Object = &pThis->__nvoc_base_Memory.__nvoc_base_RmResource.__nvoc_base_RsResource.__nvoc_base_Object;
301 pThis->__nvoc_pbase_RsResource = &pThis->__nvoc_base_Memory.__nvoc_base_RmResource.__nvoc_base_RsResource;
302 pThis->__nvoc_pbase_RmResourceCommon = &pThis->__nvoc_base_Memory.__nvoc_base_RmResource.__nvoc_base_RmResourceCommon;
303 pThis->__nvoc_pbase_RmResource = &pThis->__nvoc_base_Memory.__nvoc_base_RmResource;
304 pThis->__nvoc_pbase_Memory = &pThis->__nvoc_base_Memory;
305 __nvoc_init_Memory(&pThis->__nvoc_base_Memory);
306 __nvoc_init_funcTable_OsDescMemory(pThis);
307 }
308
__nvoc_objCreate_OsDescMemory(OsDescMemory ** ppThis,Dynamic * pParent,NvU32 createFlags,CALL_CONTEXT * arg_pCallContext,struct RS_RES_ALLOC_PARAMS_INTERNAL * arg_pParams)309 NV_STATUS __nvoc_objCreate_OsDescMemory(OsDescMemory **ppThis, Dynamic *pParent, NvU32 createFlags, CALL_CONTEXT * arg_pCallContext, struct RS_RES_ALLOC_PARAMS_INTERNAL * arg_pParams)
310 {
311 NV_STATUS status;
312 Object *pParentObj = NULL;
313 OsDescMemory *pThis;
314
315 // Assign `pThis`, allocating memory unless suppressed by flag.
316 status = __nvoc_handleObjCreateMemAlloc(createFlags, sizeof(OsDescMemory), (void**)&pThis, (void**)ppThis);
317 if (status != NV_OK)
318 return status;
319
320 // Zero is the initial value for everything.
321 portMemSet(pThis, 0, sizeof(OsDescMemory));
322
323 // Initialize runtime type information.
324 __nvoc_initRtti(staticCast(pThis, Dynamic), &__nvoc_class_def_OsDescMemory);
325
326 pThis->__nvoc_base_Memory.__nvoc_base_RmResource.__nvoc_base_RsResource.__nvoc_base_Object.createFlags = createFlags;
327
328 // Link the child into the parent if there is one unless flagged not to do so.
329 if (pParent != NULL && !(createFlags & NVOC_OBJ_CREATE_FLAGS_PARENT_HALSPEC_ONLY))
330 {
331 pParentObj = dynamicCast(pParent, Object);
332 objAddChild(pParentObj, &pThis->__nvoc_base_Memory.__nvoc_base_RmResource.__nvoc_base_RsResource.__nvoc_base_Object);
333 }
334 else
335 {
336 pThis->__nvoc_base_Memory.__nvoc_base_RmResource.__nvoc_base_RsResource.__nvoc_base_Object.pParent = NULL;
337 }
338
339 __nvoc_init_OsDescMemory(pThis);
340 status = __nvoc_ctor_OsDescMemory(pThis, arg_pCallContext, arg_pParams);
341 if (status != NV_OK) goto __nvoc_objCreate_OsDescMemory_cleanup;
342
343 // Assignment has no effect if NVOC_OBJ_CREATE_FLAGS_IN_PLACE_CONSTRUCT is set.
344 *ppThis = pThis;
345
346 return NV_OK;
347
348 __nvoc_objCreate_OsDescMemory_cleanup:
349
350 // Unlink the child from the parent if it was linked above.
351 if (pParentObj != NULL)
352 objRemoveChild(pParentObj, &pThis->__nvoc_base_Memory.__nvoc_base_RmResource.__nvoc_base_RsResource.__nvoc_base_Object);
353
354 // Do not call destructors here since the constructor already called them.
355 if (createFlags & NVOC_OBJ_CREATE_FLAGS_IN_PLACE_CONSTRUCT)
356 portMemSet(pThis, 0, sizeof(OsDescMemory));
357 else
358 {
359 portMemFree(pThis);
360 *ppThis = NULL;
361 }
362
363 // coverity[leaked_storage:FALSE]
364 return status;
365 }
366
__nvoc_objCreateDynamic_OsDescMemory(OsDescMemory ** ppThis,Dynamic * pParent,NvU32 createFlags,va_list args)367 NV_STATUS __nvoc_objCreateDynamic_OsDescMemory(OsDescMemory **ppThis, Dynamic *pParent, NvU32 createFlags, va_list args) {
368 NV_STATUS status;
369 CALL_CONTEXT * arg_pCallContext = va_arg(args, CALL_CONTEXT *);
370 struct RS_RES_ALLOC_PARAMS_INTERNAL * arg_pParams = va_arg(args, struct RS_RES_ALLOC_PARAMS_INTERNAL *);
371
372 status = __nvoc_objCreate_OsDescMemory(ppThis, pParent, createFlags, arg_pCallContext, arg_pParams);
373
374 return status;
375 }
376
377