1 #define NVOC_EGM_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_egm_mem_nvoc.h"
9 
10 #ifdef DEBUG
11 char __nvoc_class_id_uniqueness_check_0xeffa5c = 1;
12 #endif
13 
14 extern const struct NVOC_CLASS_DEF __nvoc_class_def_ExtendedGpuMemory;
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 extern const struct NVOC_CLASS_DEF __nvoc_class_def_StandardMemory;
27 
28 void __nvoc_init_ExtendedGpuMemory(ExtendedGpuMemory*);
29 void __nvoc_init_funcTable_ExtendedGpuMemory(ExtendedGpuMemory*);
30 NV_STATUS __nvoc_ctor_ExtendedGpuMemory(ExtendedGpuMemory*, CALL_CONTEXT * arg_pCallContext, struct RS_RES_ALLOC_PARAMS_INTERNAL * arg_pParams);
31 void __nvoc_init_dataField_ExtendedGpuMemory(ExtendedGpuMemory*);
32 void __nvoc_dtor_ExtendedGpuMemory(ExtendedGpuMemory*);
33 extern const struct NVOC_EXPORT_INFO __nvoc_export_info_ExtendedGpuMemory;
34 
35 static const struct NVOC_RTTI __nvoc_rtti_ExtendedGpuMemory_ExtendedGpuMemory = {
36     /*pClassDef=*/          &__nvoc_class_def_ExtendedGpuMemory,
37     /*dtor=*/               (NVOC_DYNAMIC_DTOR) &__nvoc_dtor_ExtendedGpuMemory,
38     /*offset=*/             0,
39 };
40 
41 static const struct NVOC_RTTI __nvoc_rtti_ExtendedGpuMemory_Object = {
42     /*pClassDef=*/          &__nvoc_class_def_Object,
43     /*dtor=*/               &__nvoc_destructFromBase,
44     /*offset=*/             NV_OFFSETOF(ExtendedGpuMemory, __nvoc_base_StandardMemory.__nvoc_base_Memory.__nvoc_base_RmResource.__nvoc_base_RsResource.__nvoc_base_Object),
45 };
46 
47 static const struct NVOC_RTTI __nvoc_rtti_ExtendedGpuMemory_RsResource = {
48     /*pClassDef=*/          &__nvoc_class_def_RsResource,
49     /*dtor=*/               &__nvoc_destructFromBase,
50     /*offset=*/             NV_OFFSETOF(ExtendedGpuMemory, __nvoc_base_StandardMemory.__nvoc_base_Memory.__nvoc_base_RmResource.__nvoc_base_RsResource),
51 };
52 
53 static const struct NVOC_RTTI __nvoc_rtti_ExtendedGpuMemory_RmResourceCommon = {
54     /*pClassDef=*/          &__nvoc_class_def_RmResourceCommon,
55     /*dtor=*/               &__nvoc_destructFromBase,
56     /*offset=*/             NV_OFFSETOF(ExtendedGpuMemory, __nvoc_base_StandardMemory.__nvoc_base_Memory.__nvoc_base_RmResource.__nvoc_base_RmResourceCommon),
57 };
58 
59 static const struct NVOC_RTTI __nvoc_rtti_ExtendedGpuMemory_RmResource = {
60     /*pClassDef=*/          &__nvoc_class_def_RmResource,
61     /*dtor=*/               &__nvoc_destructFromBase,
62     /*offset=*/             NV_OFFSETOF(ExtendedGpuMemory, __nvoc_base_StandardMemory.__nvoc_base_Memory.__nvoc_base_RmResource),
63 };
64 
65 static const struct NVOC_RTTI __nvoc_rtti_ExtendedGpuMemory_Memory = {
66     /*pClassDef=*/          &__nvoc_class_def_Memory,
67     /*dtor=*/               &__nvoc_destructFromBase,
68     /*offset=*/             NV_OFFSETOF(ExtendedGpuMemory, __nvoc_base_StandardMemory.__nvoc_base_Memory),
69 };
70 
71 static const struct NVOC_RTTI __nvoc_rtti_ExtendedGpuMemory_StandardMemory = {
72     /*pClassDef=*/          &__nvoc_class_def_StandardMemory,
73     /*dtor=*/               &__nvoc_destructFromBase,
74     /*offset=*/             NV_OFFSETOF(ExtendedGpuMemory, __nvoc_base_StandardMemory),
75 };
76 
77 static const struct NVOC_CASTINFO __nvoc_castinfo_ExtendedGpuMemory = {
78     /*numRelatives=*/       7,
79     /*relatives=*/ {
80         &__nvoc_rtti_ExtendedGpuMemory_ExtendedGpuMemory,
81         &__nvoc_rtti_ExtendedGpuMemory_StandardMemory,
82         &__nvoc_rtti_ExtendedGpuMemory_Memory,
83         &__nvoc_rtti_ExtendedGpuMemory_RmResource,
84         &__nvoc_rtti_ExtendedGpuMemory_RmResourceCommon,
85         &__nvoc_rtti_ExtendedGpuMemory_RsResource,
86         &__nvoc_rtti_ExtendedGpuMemory_Object,
87     },
88 };
89 
90 const struct NVOC_CLASS_DEF __nvoc_class_def_ExtendedGpuMemory =
91 {
92     /*classInfo=*/ {
93         /*size=*/               sizeof(ExtendedGpuMemory),
94         /*classId=*/            classId(ExtendedGpuMemory),
95         /*providerId=*/         &__nvoc_rtti_provider,
96 #if NV_PRINTF_STRINGS_ALLOWED
97         /*name=*/               "ExtendedGpuMemory",
98 #endif
99     },
100     /*objCreatefn=*/        (NVOC_DYNAMIC_OBJ_CREATE) &__nvoc_objCreateDynamic_ExtendedGpuMemory,
101     /*pCastInfo=*/          &__nvoc_castinfo_ExtendedGpuMemory,
102     /*pExportInfo=*/        &__nvoc_export_info_ExtendedGpuMemory
103 };
104 
__nvoc_thunk_Memory_egmmemCheckMemInterUnmap(struct ExtendedGpuMemory * pMemory,NvBool bSubdeviceHandleProvided)105 static NV_STATUS __nvoc_thunk_Memory_egmmemCheckMemInterUnmap(struct ExtendedGpuMemory *pMemory, NvBool bSubdeviceHandleProvided) {
106     return memCheckMemInterUnmap((struct Memory *)(((unsigned char *)pMemory) + __nvoc_rtti_ExtendedGpuMemory_Memory.offset), bSubdeviceHandleProvided);
107 }
108 
__nvoc_thunk_RmResource_egmmemShareCallback(struct ExtendedGpuMemory * pResource,struct RsClient * pInvokingClient,struct RsResourceRef * pParentRef,RS_SHARE_POLICY * pSharePolicy)109 static NvBool __nvoc_thunk_RmResource_egmmemShareCallback(struct ExtendedGpuMemory *pResource, struct RsClient *pInvokingClient, struct RsResourceRef *pParentRef, RS_SHARE_POLICY *pSharePolicy) {
110     return rmresShareCallback((struct RmResource *)(((unsigned char *)pResource) + __nvoc_rtti_ExtendedGpuMemory_RmResource.offset), pInvokingClient, pParentRef, pSharePolicy);
111 }
112 
__nvoc_thunk_RsResource_egmmemMapTo(struct ExtendedGpuMemory * pResource,RS_RES_MAP_TO_PARAMS * pParams)113 static NV_STATUS __nvoc_thunk_RsResource_egmmemMapTo(struct ExtendedGpuMemory *pResource, RS_RES_MAP_TO_PARAMS *pParams) {
114     return resMapTo((struct RsResource *)(((unsigned char *)pResource) + __nvoc_rtti_ExtendedGpuMemory_RsResource.offset), pParams);
115 }
116 
__nvoc_thunk_Memory_egmmemGetMapAddrSpace(struct ExtendedGpuMemory * pMemory,CALL_CONTEXT * pCallContext,NvU32 mapFlags,NV_ADDRESS_SPACE * pAddrSpace)117 static NV_STATUS __nvoc_thunk_Memory_egmmemGetMapAddrSpace(struct ExtendedGpuMemory *pMemory, CALL_CONTEXT *pCallContext, NvU32 mapFlags, NV_ADDRESS_SPACE *pAddrSpace) {
118     return memGetMapAddrSpace((struct Memory *)(((unsigned char *)pMemory) + __nvoc_rtti_ExtendedGpuMemory_Memory.offset), pCallContext, mapFlags, pAddrSpace);
119 }
120 
__nvoc_thunk_Memory_egmmemIsExportAllowed(struct ExtendedGpuMemory * pMemory)121 static NvBool __nvoc_thunk_Memory_egmmemIsExportAllowed(struct ExtendedGpuMemory *pMemory) {
122     return memIsExportAllowed((struct Memory *)(((unsigned char *)pMemory) + __nvoc_rtti_ExtendedGpuMemory_Memory.offset));
123 }
124 
__nvoc_thunk_RsResource_egmmemGetRefCount(struct ExtendedGpuMemory * pResource)125 static NvU32 __nvoc_thunk_RsResource_egmmemGetRefCount(struct ExtendedGpuMemory *pResource) {
126     return resGetRefCount((struct RsResource *)(((unsigned char *)pResource) + __nvoc_rtti_ExtendedGpuMemory_RsResource.offset));
127 }
128 
__nvoc_thunk_RsResource_egmmemAddAdditionalDependants(struct RsClient * pClient,struct ExtendedGpuMemory * pResource,RsResourceRef * pReference)129 static void __nvoc_thunk_RsResource_egmmemAddAdditionalDependants(struct RsClient *pClient, struct ExtendedGpuMemory *pResource, RsResourceRef *pReference) {
130     resAddAdditionalDependants(pClient, (struct RsResource *)(((unsigned char *)pResource) + __nvoc_rtti_ExtendedGpuMemory_RsResource.offset), pReference);
131 }
132 
__nvoc_thunk_RmResource_egmmemControl_Prologue(struct ExtendedGpuMemory * pResource,CALL_CONTEXT * pCallContext,struct RS_RES_CONTROL_PARAMS_INTERNAL * pParams)133 static NV_STATUS __nvoc_thunk_RmResource_egmmemControl_Prologue(struct ExtendedGpuMemory *pResource, CALL_CONTEXT *pCallContext, struct RS_RES_CONTROL_PARAMS_INTERNAL *pParams) {
134     return rmresControl_Prologue((struct RmResource *)(((unsigned char *)pResource) + __nvoc_rtti_ExtendedGpuMemory_RmResource.offset), pCallContext, pParams);
135 }
136 
__nvoc_thunk_Memory_egmmemIsGpuMapAllowed(struct ExtendedGpuMemory * pMemory,struct OBJGPU * pGpu)137 static NvBool __nvoc_thunk_Memory_egmmemIsGpuMapAllowed(struct ExtendedGpuMemory *pMemory, struct OBJGPU *pGpu) {
138     return memIsGpuMapAllowed((struct Memory *)(((unsigned char *)pMemory) + __nvoc_rtti_ExtendedGpuMemory_Memory.offset), pGpu);
139 }
140 
__nvoc_thunk_RsResource_egmmemUnmapFrom(struct ExtendedGpuMemory * pResource,RS_RES_UNMAP_FROM_PARAMS * pParams)141 static NV_STATUS __nvoc_thunk_RsResource_egmmemUnmapFrom(struct ExtendedGpuMemory *pResource, RS_RES_UNMAP_FROM_PARAMS *pParams) {
142     return resUnmapFrom((struct RsResource *)(((unsigned char *)pResource) + __nvoc_rtti_ExtendedGpuMemory_RsResource.offset), pParams);
143 }
144 
__nvoc_thunk_RmResource_egmmemControl_Epilogue(struct ExtendedGpuMemory * pResource,CALL_CONTEXT * pCallContext,struct RS_RES_CONTROL_PARAMS_INTERNAL * pParams)145 static void __nvoc_thunk_RmResource_egmmemControl_Epilogue(struct ExtendedGpuMemory *pResource, CALL_CONTEXT *pCallContext, struct RS_RES_CONTROL_PARAMS_INTERNAL *pParams) {
146     rmresControl_Epilogue((struct RmResource *)(((unsigned char *)pResource) + __nvoc_rtti_ExtendedGpuMemory_RmResource.offset), pCallContext, pParams);
147 }
148 
__nvoc_thunk_Memory_egmmemControl(struct ExtendedGpuMemory * pMemory,CALL_CONTEXT * pCallContext,struct RS_RES_CONTROL_PARAMS_INTERNAL * pParams)149 static NV_STATUS __nvoc_thunk_Memory_egmmemControl(struct ExtendedGpuMemory *pMemory, CALL_CONTEXT *pCallContext, struct RS_RES_CONTROL_PARAMS_INTERNAL *pParams) {
150     return memControl((struct Memory *)(((unsigned char *)pMemory) + __nvoc_rtti_ExtendedGpuMemory_Memory.offset), pCallContext, pParams);
151 }
152 
__nvoc_thunk_Memory_egmmemUnmap(struct ExtendedGpuMemory * pMemory,CALL_CONTEXT * pCallContext,RsCpuMapping * pCpuMapping)153 static NV_STATUS __nvoc_thunk_Memory_egmmemUnmap(struct ExtendedGpuMemory *pMemory, CALL_CONTEXT *pCallContext, RsCpuMapping *pCpuMapping) {
154     return memUnmap((struct Memory *)(((unsigned char *)pMemory) + __nvoc_rtti_ExtendedGpuMemory_Memory.offset), pCallContext, pCpuMapping);
155 }
156 
__nvoc_thunk_Memory_egmmemGetMemInterMapParams(struct ExtendedGpuMemory * pMemory,RMRES_MEM_INTER_MAP_PARAMS * pParams)157 static NV_STATUS __nvoc_thunk_Memory_egmmemGetMemInterMapParams(struct ExtendedGpuMemory *pMemory, RMRES_MEM_INTER_MAP_PARAMS *pParams) {
158     return memGetMemInterMapParams((struct Memory *)(((unsigned char *)pMemory) + __nvoc_rtti_ExtendedGpuMemory_Memory.offset), pParams);
159 }
160 
__nvoc_thunk_Memory_egmmemGetMemoryMappingDescriptor(struct ExtendedGpuMemory * pMemory,MEMORY_DESCRIPTOR ** ppMemDesc)161 static NV_STATUS __nvoc_thunk_Memory_egmmemGetMemoryMappingDescriptor(struct ExtendedGpuMemory *pMemory, MEMORY_DESCRIPTOR **ppMemDesc) {
162     return memGetMemoryMappingDescriptor((struct Memory *)(((unsigned char *)pMemory) + __nvoc_rtti_ExtendedGpuMemory_Memory.offset), ppMemDesc);
163 }
164 
__nvoc_thunk_RsResource_egmmemControlFilter(struct ExtendedGpuMemory * pResource,struct CALL_CONTEXT * pCallContext,struct RS_RES_CONTROL_PARAMS_INTERNAL * pParams)165 static NV_STATUS __nvoc_thunk_RsResource_egmmemControlFilter(struct ExtendedGpuMemory *pResource, struct CALL_CONTEXT *pCallContext, struct RS_RES_CONTROL_PARAMS_INTERNAL *pParams) {
166     return resControlFilter((struct RsResource *)(((unsigned char *)pResource) + __nvoc_rtti_ExtendedGpuMemory_RsResource.offset), pCallContext, pParams);
167 }
168 
__nvoc_thunk_RmResource_egmmemControlSerialization_Prologue(struct ExtendedGpuMemory * pResource,CALL_CONTEXT * pCallContext,struct RS_RES_CONTROL_PARAMS_INTERNAL * pParams)169 static NV_STATUS __nvoc_thunk_RmResource_egmmemControlSerialization_Prologue(struct ExtendedGpuMemory *pResource, CALL_CONTEXT *pCallContext, struct RS_RES_CONTROL_PARAMS_INTERNAL *pParams) {
170     return rmresControlSerialization_Prologue((struct RmResource *)(((unsigned char *)pResource) + __nvoc_rtti_ExtendedGpuMemory_RmResource.offset), pCallContext, pParams);
171 }
172 
__nvoc_thunk_StandardMemory_egmmemCanCopy(struct ExtendedGpuMemory * pStandardMemory)173 static NvBool __nvoc_thunk_StandardMemory_egmmemCanCopy(struct ExtendedGpuMemory *pStandardMemory) {
174     return stdmemCanCopy((struct StandardMemory *)(((unsigned char *)pStandardMemory) + __nvoc_rtti_ExtendedGpuMemory_StandardMemory.offset));
175 }
176 
__nvoc_thunk_RsResource_egmmemIsPartialUnmapSupported(struct ExtendedGpuMemory * pResource)177 static NvBool __nvoc_thunk_RsResource_egmmemIsPartialUnmapSupported(struct ExtendedGpuMemory *pResource) {
178     return resIsPartialUnmapSupported((struct RsResource *)(((unsigned char *)pResource) + __nvoc_rtti_ExtendedGpuMemory_RsResource.offset));
179 }
180 
__nvoc_thunk_Memory_egmmemIsReady(struct ExtendedGpuMemory * pMemory,NvBool bCopyConstructorContext)181 static NV_STATUS __nvoc_thunk_Memory_egmmemIsReady(struct ExtendedGpuMemory *pMemory, NvBool bCopyConstructorContext) {
182     return memIsReady((struct Memory *)(((unsigned char *)pMemory) + __nvoc_rtti_ExtendedGpuMemory_Memory.offset), bCopyConstructorContext);
183 }
184 
__nvoc_thunk_Memory_egmmemCheckCopyPermissions(struct ExtendedGpuMemory * pMemory,struct OBJGPU * pDstGpu,struct Device * pDstDevice)185 static NV_STATUS __nvoc_thunk_Memory_egmmemCheckCopyPermissions(struct ExtendedGpuMemory *pMemory, struct OBJGPU *pDstGpu, struct Device *pDstDevice) {
186     return memCheckCopyPermissions((struct Memory *)(((unsigned char *)pMemory) + __nvoc_rtti_ExtendedGpuMemory_Memory.offset), pDstGpu, pDstDevice);
187 }
188 
__nvoc_thunk_RsResource_egmmemPreDestruct(struct ExtendedGpuMemory * pResource)189 static void __nvoc_thunk_RsResource_egmmemPreDestruct(struct ExtendedGpuMemory *pResource) {
190     resPreDestruct((struct RsResource *)(((unsigned char *)pResource) + __nvoc_rtti_ExtendedGpuMemory_RsResource.offset));
191 }
192 
__nvoc_thunk_Memory_egmmemIsDuplicate(struct ExtendedGpuMemory * pMemory,NvHandle hMemory,NvBool * pDuplicate)193 static NV_STATUS __nvoc_thunk_Memory_egmmemIsDuplicate(struct ExtendedGpuMemory *pMemory, NvHandle hMemory, NvBool *pDuplicate) {
194     return memIsDuplicate((struct Memory *)(((unsigned char *)pMemory) + __nvoc_rtti_ExtendedGpuMemory_Memory.offset), hMemory, pDuplicate);
195 }
196 
__nvoc_thunk_RmResource_egmmemControlSerialization_Epilogue(struct ExtendedGpuMemory * pResource,CALL_CONTEXT * pCallContext,struct RS_RES_CONTROL_PARAMS_INTERNAL * pParams)197 static void __nvoc_thunk_RmResource_egmmemControlSerialization_Epilogue(struct ExtendedGpuMemory *pResource, CALL_CONTEXT *pCallContext, struct RS_RES_CONTROL_PARAMS_INTERNAL *pParams) {
198     rmresControlSerialization_Epilogue((struct RmResource *)(((unsigned char *)pResource) + __nvoc_rtti_ExtendedGpuMemory_RmResource.offset), pCallContext, pParams);
199 }
200 
__nvoc_thunk_Memory_egmmemMap(struct ExtendedGpuMemory * pMemory,CALL_CONTEXT * pCallContext,struct RS_CPU_MAP_PARAMS * pParams,RsCpuMapping * pCpuMapping)201 static NV_STATUS __nvoc_thunk_Memory_egmmemMap(struct ExtendedGpuMemory *pMemory, CALL_CONTEXT *pCallContext, struct RS_CPU_MAP_PARAMS *pParams, RsCpuMapping *pCpuMapping) {
202     return memMap((struct Memory *)(((unsigned char *)pMemory) + __nvoc_rtti_ExtendedGpuMemory_Memory.offset), pCallContext, pParams, pCpuMapping);
203 }
204 
__nvoc_thunk_RmResource_egmmemAccessCallback(struct ExtendedGpuMemory * pResource,struct RsClient * pInvokingClient,void * pAllocParams,RsAccessRight accessRight)205 static NvBool __nvoc_thunk_RmResource_egmmemAccessCallback(struct ExtendedGpuMemory *pResource, struct RsClient *pInvokingClient, void *pAllocParams, RsAccessRight accessRight) {
206     return rmresAccessCallback((struct RmResource *)(((unsigned char *)pResource) + __nvoc_rtti_ExtendedGpuMemory_RmResource.offset), pInvokingClient, pAllocParams, accessRight);
207 }
208 
209 const struct NVOC_EXPORT_INFO __nvoc_export_info_ExtendedGpuMemory =
210 {
211     /*numEntries=*/     0,
212     /*pExportEntries=*/  0
213 };
214 
215 void __nvoc_dtor_StandardMemory(StandardMemory*);
__nvoc_dtor_ExtendedGpuMemory(ExtendedGpuMemory * pThis)216 void __nvoc_dtor_ExtendedGpuMemory(ExtendedGpuMemory *pThis) {
217     __nvoc_dtor_StandardMemory(&pThis->__nvoc_base_StandardMemory);
218     PORT_UNREFERENCED_VARIABLE(pThis);
219 }
220 
__nvoc_init_dataField_ExtendedGpuMemory(ExtendedGpuMemory * pThis)221 void __nvoc_init_dataField_ExtendedGpuMemory(ExtendedGpuMemory *pThis) {
222     PORT_UNREFERENCED_VARIABLE(pThis);
223 }
224 
225 NV_STATUS __nvoc_ctor_StandardMemory(StandardMemory* , CALL_CONTEXT *, struct RS_RES_ALLOC_PARAMS_INTERNAL *);
__nvoc_ctor_ExtendedGpuMemory(ExtendedGpuMemory * pThis,CALL_CONTEXT * arg_pCallContext,struct RS_RES_ALLOC_PARAMS_INTERNAL * arg_pParams)226 NV_STATUS __nvoc_ctor_ExtendedGpuMemory(ExtendedGpuMemory *pThis, CALL_CONTEXT * arg_pCallContext, struct RS_RES_ALLOC_PARAMS_INTERNAL * arg_pParams) {
227     NV_STATUS status = NV_OK;
228     status = __nvoc_ctor_StandardMemory(&pThis->__nvoc_base_StandardMemory, arg_pCallContext, arg_pParams);
229     if (status != NV_OK) goto __nvoc_ctor_ExtendedGpuMemory_fail_StandardMemory;
230     __nvoc_init_dataField_ExtendedGpuMemory(pThis);
231 
232     status = __nvoc_egmmemConstruct(pThis, arg_pCallContext, arg_pParams);
233     if (status != NV_OK) goto __nvoc_ctor_ExtendedGpuMemory_fail__init;
234     goto __nvoc_ctor_ExtendedGpuMemory_exit; // Success
235 
236 __nvoc_ctor_ExtendedGpuMemory_fail__init:
237     __nvoc_dtor_StandardMemory(&pThis->__nvoc_base_StandardMemory);
238 __nvoc_ctor_ExtendedGpuMemory_fail_StandardMemory:
239 __nvoc_ctor_ExtendedGpuMemory_exit:
240 
241     return status;
242 }
243 
__nvoc_init_funcTable_ExtendedGpuMemory_1(ExtendedGpuMemory * pThis)244 static void __nvoc_init_funcTable_ExtendedGpuMemory_1(ExtendedGpuMemory *pThis) {
245     PORT_UNREFERENCED_VARIABLE(pThis);
246 
247     pThis->__egmmemCheckMemInterUnmap__ = &__nvoc_thunk_Memory_egmmemCheckMemInterUnmap;
248 
249     pThis->__egmmemShareCallback__ = &__nvoc_thunk_RmResource_egmmemShareCallback;
250 
251     pThis->__egmmemMapTo__ = &__nvoc_thunk_RsResource_egmmemMapTo;
252 
253     pThis->__egmmemGetMapAddrSpace__ = &__nvoc_thunk_Memory_egmmemGetMapAddrSpace;
254 
255     pThis->__egmmemIsExportAllowed__ = &__nvoc_thunk_Memory_egmmemIsExportAllowed;
256 
257     pThis->__egmmemGetRefCount__ = &__nvoc_thunk_RsResource_egmmemGetRefCount;
258 
259     pThis->__egmmemAddAdditionalDependants__ = &__nvoc_thunk_RsResource_egmmemAddAdditionalDependants;
260 
261     pThis->__egmmemControl_Prologue__ = &__nvoc_thunk_RmResource_egmmemControl_Prologue;
262 
263     pThis->__egmmemIsGpuMapAllowed__ = &__nvoc_thunk_Memory_egmmemIsGpuMapAllowed;
264 
265     pThis->__egmmemUnmapFrom__ = &__nvoc_thunk_RsResource_egmmemUnmapFrom;
266 
267     pThis->__egmmemControl_Epilogue__ = &__nvoc_thunk_RmResource_egmmemControl_Epilogue;
268 
269     pThis->__egmmemControl__ = &__nvoc_thunk_Memory_egmmemControl;
270 
271     pThis->__egmmemUnmap__ = &__nvoc_thunk_Memory_egmmemUnmap;
272 
273     pThis->__egmmemGetMemInterMapParams__ = &__nvoc_thunk_Memory_egmmemGetMemInterMapParams;
274 
275     pThis->__egmmemGetMemoryMappingDescriptor__ = &__nvoc_thunk_Memory_egmmemGetMemoryMappingDescriptor;
276 
277     pThis->__egmmemControlFilter__ = &__nvoc_thunk_RsResource_egmmemControlFilter;
278 
279     pThis->__egmmemControlSerialization_Prologue__ = &__nvoc_thunk_RmResource_egmmemControlSerialization_Prologue;
280 
281     pThis->__egmmemCanCopy__ = &__nvoc_thunk_StandardMemory_egmmemCanCopy;
282 
283     pThis->__egmmemIsPartialUnmapSupported__ = &__nvoc_thunk_RsResource_egmmemIsPartialUnmapSupported;
284 
285     pThis->__egmmemIsReady__ = &__nvoc_thunk_Memory_egmmemIsReady;
286 
287     pThis->__egmmemCheckCopyPermissions__ = &__nvoc_thunk_Memory_egmmemCheckCopyPermissions;
288 
289     pThis->__egmmemPreDestruct__ = &__nvoc_thunk_RsResource_egmmemPreDestruct;
290 
291     pThis->__egmmemIsDuplicate__ = &__nvoc_thunk_Memory_egmmemIsDuplicate;
292 
293     pThis->__egmmemControlSerialization_Epilogue__ = &__nvoc_thunk_RmResource_egmmemControlSerialization_Epilogue;
294 
295     pThis->__egmmemMap__ = &__nvoc_thunk_Memory_egmmemMap;
296 
297     pThis->__egmmemAccessCallback__ = &__nvoc_thunk_RmResource_egmmemAccessCallback;
298 }
299 
__nvoc_init_funcTable_ExtendedGpuMemory(ExtendedGpuMemory * pThis)300 void __nvoc_init_funcTable_ExtendedGpuMemory(ExtendedGpuMemory *pThis) {
301     __nvoc_init_funcTable_ExtendedGpuMemory_1(pThis);
302 }
303 
304 void __nvoc_init_StandardMemory(StandardMemory*);
__nvoc_init_ExtendedGpuMemory(ExtendedGpuMemory * pThis)305 void __nvoc_init_ExtendedGpuMemory(ExtendedGpuMemory *pThis) {
306     pThis->__nvoc_pbase_ExtendedGpuMemory = pThis;
307     pThis->__nvoc_pbase_Object = &pThis->__nvoc_base_StandardMemory.__nvoc_base_Memory.__nvoc_base_RmResource.__nvoc_base_RsResource.__nvoc_base_Object;
308     pThis->__nvoc_pbase_RsResource = &pThis->__nvoc_base_StandardMemory.__nvoc_base_Memory.__nvoc_base_RmResource.__nvoc_base_RsResource;
309     pThis->__nvoc_pbase_RmResourceCommon = &pThis->__nvoc_base_StandardMemory.__nvoc_base_Memory.__nvoc_base_RmResource.__nvoc_base_RmResourceCommon;
310     pThis->__nvoc_pbase_RmResource = &pThis->__nvoc_base_StandardMemory.__nvoc_base_Memory.__nvoc_base_RmResource;
311     pThis->__nvoc_pbase_Memory = &pThis->__nvoc_base_StandardMemory.__nvoc_base_Memory;
312     pThis->__nvoc_pbase_StandardMemory = &pThis->__nvoc_base_StandardMemory;
313     __nvoc_init_StandardMemory(&pThis->__nvoc_base_StandardMemory);
314     __nvoc_init_funcTable_ExtendedGpuMemory(pThis);
315 }
316 
__nvoc_objCreate_ExtendedGpuMemory(ExtendedGpuMemory ** ppThis,Dynamic * pParent,NvU32 createFlags,CALL_CONTEXT * arg_pCallContext,struct RS_RES_ALLOC_PARAMS_INTERNAL * arg_pParams)317 NV_STATUS __nvoc_objCreate_ExtendedGpuMemory(ExtendedGpuMemory **ppThis, Dynamic *pParent, NvU32 createFlags, CALL_CONTEXT * arg_pCallContext, struct RS_RES_ALLOC_PARAMS_INTERNAL * arg_pParams)
318 {
319     NV_STATUS status;
320     Object *pParentObj = NULL;
321     ExtendedGpuMemory *pThis;
322 
323     // Assign `pThis`, allocating memory unless suppressed by flag.
324     status = __nvoc_handleObjCreateMemAlloc(createFlags, sizeof(ExtendedGpuMemory), (void**)&pThis, (void**)ppThis);
325     if (status != NV_OK)
326         return status;
327 
328     // Zero is the initial value for everything.
329     portMemSet(pThis, 0, sizeof(ExtendedGpuMemory));
330 
331     // Initialize runtime type information.
332     __nvoc_initRtti(staticCast(pThis, Dynamic), &__nvoc_class_def_ExtendedGpuMemory);
333 
334     pThis->__nvoc_base_StandardMemory.__nvoc_base_Memory.__nvoc_base_RmResource.__nvoc_base_RsResource.__nvoc_base_Object.createFlags = createFlags;
335 
336     // Link the child into the parent if there is one unless flagged not to do so.
337     if (pParent != NULL && !(createFlags & NVOC_OBJ_CREATE_FLAGS_PARENT_HALSPEC_ONLY))
338     {
339         pParentObj = dynamicCast(pParent, Object);
340         objAddChild(pParentObj, &pThis->__nvoc_base_StandardMemory.__nvoc_base_Memory.__nvoc_base_RmResource.__nvoc_base_RsResource.__nvoc_base_Object);
341     }
342     else
343     {
344         pThis->__nvoc_base_StandardMemory.__nvoc_base_Memory.__nvoc_base_RmResource.__nvoc_base_RsResource.__nvoc_base_Object.pParent = NULL;
345     }
346 
347     __nvoc_init_ExtendedGpuMemory(pThis);
348     status = __nvoc_ctor_ExtendedGpuMemory(pThis, arg_pCallContext, arg_pParams);
349     if (status != NV_OK) goto __nvoc_objCreate_ExtendedGpuMemory_cleanup;
350 
351     // Assignment has no effect if NVOC_OBJ_CREATE_FLAGS_IN_PLACE_CONSTRUCT is set.
352     *ppThis = pThis;
353 
354     return NV_OK;
355 
356 __nvoc_objCreate_ExtendedGpuMemory_cleanup:
357 
358     // Unlink the child from the parent if it was linked above.
359     if (pParentObj != NULL)
360         objRemoveChild(pParentObj, &pThis->__nvoc_base_StandardMemory.__nvoc_base_Memory.__nvoc_base_RmResource.__nvoc_base_RsResource.__nvoc_base_Object);
361 
362     // Do not call destructors here since the constructor already called them.
363     if (createFlags & NVOC_OBJ_CREATE_FLAGS_IN_PLACE_CONSTRUCT)
364         portMemSet(pThis, 0, sizeof(ExtendedGpuMemory));
365     else
366     {
367         portMemFree(pThis);
368         *ppThis = NULL;
369     }
370 
371     // coverity[leaked_storage:FALSE]
372     return status;
373 }
374 
__nvoc_objCreateDynamic_ExtendedGpuMemory(ExtendedGpuMemory ** ppThis,Dynamic * pParent,NvU32 createFlags,va_list args)375 NV_STATUS __nvoc_objCreateDynamic_ExtendedGpuMemory(ExtendedGpuMemory **ppThis, Dynamic *pParent, NvU32 createFlags, va_list args) {
376     NV_STATUS status;
377     CALL_CONTEXT * arg_pCallContext = va_arg(args, CALL_CONTEXT *);
378     struct RS_RES_ALLOC_PARAMS_INTERNAL * arg_pParams = va_arg(args, struct RS_RES_ALLOC_PARAMS_INTERNAL *);
379 
380     status = __nvoc_objCreate_ExtendedGpuMemory(ppThis, pParent, createFlags, arg_pCallContext, arg_pParams);
381 
382     return status;
383 }
384 
385