1 #ifndef _G_SYSTEM_MEM_NVOC_H_
2 #define _G_SYSTEM_MEM_NVOC_H_
3 #include "nvoc/runtime.h"
4 
5 #ifdef __cplusplus
6 extern "C" {
7 #endif
8 
9 /*
10  * SPDX-FileCopyrightText: Copyright (c) 2020-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
11  * SPDX-License-Identifier: MIT
12  *
13  * Permission is hereby granted, free of charge, to any person obtaining a
14  * copy of this software and associated documentation files (the "Software"),
15  * to deal in the Software without restriction, including without limitation
16  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
17  * and/or sell copies of the Software, and to permit persons to whom the
18  * Software is furnished to do so, subject to the following conditions:
19  *
20  * The above copyright notice and this permission notice shall be included in
21  * all copies or substantial portions of the Software.
22  *
23  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
24  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
26  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
28  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
29  * DEALINGS IN THE SOFTWARE.
30  */
31 
32 #include "g_system_mem_nvoc.h"
33 
34 #ifndef _SYSTEM_MEMORY_H_
35 #define _SYSTEM_MEMORY_H_
36 
37 #include "mem_mgr/standard_mem.h"
38 #include "gpu/mem_mgr/heap_base.h"
39 
40 
41 // Private field names are wrapped in PRIVATE_FIELD, which does nothing for
42 // the matching C source file, but causes diagnostics to be issued if another
43 // source file references the field.
44 #ifdef NVOC_SYSTEM_MEM_H_PRIVATE_ACCESS_ALLOWED
45 #define PRIVATE_FIELD(x) x
46 #else
47 #define PRIVATE_FIELD(x) NVOC_PRIVATE_FIELD(x)
48 #endif
49 
50 struct SystemMemory {
51     const struct NVOC_RTTI *__nvoc_rtti;
52     struct StandardMemory __nvoc_base_StandardMemory;
53     struct Object *__nvoc_pbase_Object;
54     struct RsResource *__nvoc_pbase_RsResource;
55     struct RmResourceCommon *__nvoc_pbase_RmResourceCommon;
56     struct RmResource *__nvoc_pbase_RmResource;
57     struct Memory *__nvoc_pbase_Memory;
58     struct StandardMemory *__nvoc_pbase_StandardMemory;
59     struct SystemMemory *__nvoc_pbase_SystemMemory;
60     NV_STATUS (*__sysmemCtrlCmdGetSurfaceNumPhysPages__)(struct SystemMemory *, NV003E_CTRL_GET_SURFACE_NUM_PHYS_PAGES_PARAMS *);
61     NV_STATUS (*__sysmemCtrlCmdGetSurfacePhysPages__)(struct SystemMemory *, NV003E_CTRL_GET_SURFACE_PHYS_PAGES_PARAMS *);
62     NV_STATUS (*__sysmemCheckMemInterUnmap__)(struct SystemMemory *, NvBool);
63     NvBool (*__sysmemShareCallback__)(struct SystemMemory *, struct RsClient *, struct RsResourceRef *, RS_SHARE_POLICY *);
64     NV_STATUS (*__sysmemMapTo__)(struct SystemMemory *, RS_RES_MAP_TO_PARAMS *);
65     NV_STATUS (*__sysmemGetMapAddrSpace__)(struct SystemMemory *, CALL_CONTEXT *, NvU32, NV_ADDRESS_SPACE *);
66     NvBool (*__sysmemIsExportAllowed__)(struct SystemMemory *);
67     NvU32 (*__sysmemGetRefCount__)(struct SystemMemory *);
68     void (*__sysmemAddAdditionalDependants__)(struct RsClient *, struct SystemMemory *, RsResourceRef *);
69     NV_STATUS (*__sysmemControl_Prologue__)(struct SystemMemory *, CALL_CONTEXT *, struct RS_RES_CONTROL_PARAMS_INTERNAL *);
70     NvBool (*__sysmemIsGpuMapAllowed__)(struct SystemMemory *, struct OBJGPU *);
71     NV_STATUS (*__sysmemUnmapFrom__)(struct SystemMemory *, RS_RES_UNMAP_FROM_PARAMS *);
72     void (*__sysmemControl_Epilogue__)(struct SystemMemory *, CALL_CONTEXT *, struct RS_RES_CONTROL_PARAMS_INTERNAL *);
73     NV_STATUS (*__sysmemControl__)(struct SystemMemory *, CALL_CONTEXT *, struct RS_RES_CONTROL_PARAMS_INTERNAL *);
74     NV_STATUS (*__sysmemUnmap__)(struct SystemMemory *, CALL_CONTEXT *, RsCpuMapping *);
75     NV_STATUS (*__sysmemGetMemInterMapParams__)(struct SystemMemory *, RMRES_MEM_INTER_MAP_PARAMS *);
76     NV_STATUS (*__sysmemGetMemoryMappingDescriptor__)(struct SystemMemory *, MEMORY_DESCRIPTOR **);
77     NV_STATUS (*__sysmemControlFilter__)(struct SystemMemory *, struct CALL_CONTEXT *, struct RS_RES_CONTROL_PARAMS_INTERNAL *);
78     NV_STATUS (*__sysmemControlSerialization_Prologue__)(struct SystemMemory *, CALL_CONTEXT *, struct RS_RES_CONTROL_PARAMS_INTERNAL *);
79     NvBool (*__sysmemCanCopy__)(struct SystemMemory *);
80     NvBool (*__sysmemIsPartialUnmapSupported__)(struct SystemMemory *);
81     NV_STATUS (*__sysmemIsReady__)(struct SystemMemory *, NvBool);
82     NV_STATUS (*__sysmemCheckCopyPermissions__)(struct SystemMemory *, struct OBJGPU *, struct Device *);
83     void (*__sysmemPreDestruct__)(struct SystemMemory *);
84     NV_STATUS (*__sysmemIsDuplicate__)(struct SystemMemory *, NvHandle, NvBool *);
85     void (*__sysmemControlSerialization_Epilogue__)(struct SystemMemory *, CALL_CONTEXT *, struct RS_RES_CONTROL_PARAMS_INTERNAL *);
86     NV_STATUS (*__sysmemMap__)(struct SystemMemory *, CALL_CONTEXT *, struct RS_CPU_MAP_PARAMS *, RsCpuMapping *);
87     NvBool (*__sysmemAccessCallback__)(struct SystemMemory *, struct RsClient *, void *, RsAccessRight);
88 };
89 
90 #ifndef __NVOC_CLASS_SystemMemory_TYPEDEF__
91 #define __NVOC_CLASS_SystemMemory_TYPEDEF__
92 typedef struct SystemMemory SystemMemory;
93 #endif /* __NVOC_CLASS_SystemMemory_TYPEDEF__ */
94 
95 #ifndef __nvoc_class_id_SystemMemory
96 #define __nvoc_class_id_SystemMemory 0x007a98
97 #endif /* __nvoc_class_id_SystemMemory */
98 
99 extern const struct NVOC_CLASS_DEF __nvoc_class_def_SystemMemory;
100 
101 #define __staticCast_SystemMemory(pThis) \
102     ((pThis)->__nvoc_pbase_SystemMemory)
103 
104 #ifdef __nvoc_system_mem_h_disabled
105 #define __dynamicCast_SystemMemory(pThis) ((SystemMemory*)NULL)
106 #else //__nvoc_system_mem_h_disabled
107 #define __dynamicCast_SystemMemory(pThis) \
108     ((SystemMemory*)__nvoc_dynamicCast(staticCast((pThis), Dynamic), classInfo(SystemMemory)))
109 #endif //__nvoc_system_mem_h_disabled
110 
111 
112 NV_STATUS __nvoc_objCreateDynamic_SystemMemory(SystemMemory**, Dynamic*, NvU32, va_list);
113 
114 NV_STATUS __nvoc_objCreate_SystemMemory(SystemMemory**, Dynamic*, NvU32, CALL_CONTEXT * arg_pCallContext, struct RS_RES_ALLOC_PARAMS_INTERNAL * arg_pParams);
115 #define __objCreate_SystemMemory(ppNewObj, pParent, createFlags, arg_pCallContext, arg_pParams) \
116     __nvoc_objCreate_SystemMemory((ppNewObj), staticCast((pParent), Dynamic), (createFlags), arg_pCallContext, arg_pParams)
117 
118 #define sysmemCtrlCmdGetSurfaceNumPhysPages(pStandardMemory, pParams) sysmemCtrlCmdGetSurfaceNumPhysPages_DISPATCH(pStandardMemory, pParams)
119 #define sysmemCtrlCmdGetSurfacePhysPages(pStandardMemory, pParams) sysmemCtrlCmdGetSurfacePhysPages_DISPATCH(pStandardMemory, pParams)
120 #define sysmemCheckMemInterUnmap(pMemory, bSubdeviceHandleProvided) sysmemCheckMemInterUnmap_DISPATCH(pMemory, bSubdeviceHandleProvided)
121 #define sysmemShareCallback(pResource, pInvokingClient, pParentRef, pSharePolicy) sysmemShareCallback_DISPATCH(pResource, pInvokingClient, pParentRef, pSharePolicy)
122 #define sysmemMapTo(pResource, pParams) sysmemMapTo_DISPATCH(pResource, pParams)
123 #define sysmemGetMapAddrSpace(pMemory, pCallContext, mapFlags, pAddrSpace) sysmemGetMapAddrSpace_DISPATCH(pMemory, pCallContext, mapFlags, pAddrSpace)
124 #define sysmemIsExportAllowed(pMemory) sysmemIsExportAllowed_DISPATCH(pMemory)
125 #define sysmemGetRefCount(pResource) sysmemGetRefCount_DISPATCH(pResource)
126 #define sysmemAddAdditionalDependants(pClient, pResource, pReference) sysmemAddAdditionalDependants_DISPATCH(pClient, pResource, pReference)
127 #define sysmemControl_Prologue(pResource, pCallContext, pParams) sysmemControl_Prologue_DISPATCH(pResource, pCallContext, pParams)
128 #define sysmemIsGpuMapAllowed(pMemory, pGpu) sysmemIsGpuMapAllowed_DISPATCH(pMemory, pGpu)
129 #define sysmemUnmapFrom(pResource, pParams) sysmemUnmapFrom_DISPATCH(pResource, pParams)
130 #define sysmemControl_Epilogue(pResource, pCallContext, pParams) sysmemControl_Epilogue_DISPATCH(pResource, pCallContext, pParams)
131 #define sysmemControl(pMemory, pCallContext, pParams) sysmemControl_DISPATCH(pMemory, pCallContext, pParams)
132 #define sysmemUnmap(pMemory, pCallContext, pCpuMapping) sysmemUnmap_DISPATCH(pMemory, pCallContext, pCpuMapping)
133 #define sysmemGetMemInterMapParams(pMemory, pParams) sysmemGetMemInterMapParams_DISPATCH(pMemory, pParams)
134 #define sysmemGetMemoryMappingDescriptor(pMemory, ppMemDesc) sysmemGetMemoryMappingDescriptor_DISPATCH(pMemory, ppMemDesc)
135 #define sysmemControlFilter(pResource, pCallContext, pParams) sysmemControlFilter_DISPATCH(pResource, pCallContext, pParams)
136 #define sysmemControlSerialization_Prologue(pResource, pCallContext, pParams) sysmemControlSerialization_Prologue_DISPATCH(pResource, pCallContext, pParams)
137 #define sysmemCanCopy(pStandardMemory) sysmemCanCopy_DISPATCH(pStandardMemory)
138 #define sysmemIsPartialUnmapSupported(pResource) sysmemIsPartialUnmapSupported_DISPATCH(pResource)
139 #define sysmemIsReady(pMemory, bCopyConstructorContext) sysmemIsReady_DISPATCH(pMemory, bCopyConstructorContext)
140 #define sysmemCheckCopyPermissions(pMemory, pDstGpu, pDstDevice) sysmemCheckCopyPermissions_DISPATCH(pMemory, pDstGpu, pDstDevice)
141 #define sysmemPreDestruct(pResource) sysmemPreDestruct_DISPATCH(pResource)
142 #define sysmemIsDuplicate(pMemory, hMemory, pDuplicate) sysmemIsDuplicate_DISPATCH(pMemory, hMemory, pDuplicate)
143 #define sysmemControlSerialization_Epilogue(pResource, pCallContext, pParams) sysmemControlSerialization_Epilogue_DISPATCH(pResource, pCallContext, pParams)
144 #define sysmemMap(pMemory, pCallContext, pParams, pCpuMapping) sysmemMap_DISPATCH(pMemory, pCallContext, pParams, pCpuMapping)
145 #define sysmemAccessCallback(pResource, pInvokingClient, pAllocParams, accessRight) sysmemAccessCallback_DISPATCH(pResource, pInvokingClient, pAllocParams, accessRight)
146 NV_STATUS sysmemInitAllocRequest_HMM(struct OBJGPU *pGpu, struct SystemMemory *pSystemMemory, MEMORY_ALLOCATION_REQUEST *pAllocRequest);
147 
148 
149 #ifdef __nvoc_system_mem_h_disabled
sysmemInitAllocRequest(struct OBJGPU * pGpu,struct SystemMemory * pSystemMemory,MEMORY_ALLOCATION_REQUEST * pAllocRequest)150 static inline NV_STATUS sysmemInitAllocRequest(struct OBJGPU *pGpu, struct SystemMemory *pSystemMemory, MEMORY_ALLOCATION_REQUEST *pAllocRequest) {
151     NV_ASSERT_FAILED_PRECOMP("SystemMemory was disabled!");
152     return NV_ERR_NOT_SUPPORTED;
153 }
154 #else //__nvoc_system_mem_h_disabled
155 #define sysmemInitAllocRequest(pGpu, pSystemMemory, pAllocRequest) sysmemInitAllocRequest_HMM(pGpu, pSystemMemory, pAllocRequest)
156 #endif //__nvoc_system_mem_h_disabled
157 
158 #define sysmemInitAllocRequest_HAL(pGpu, pSystemMemory, pAllocRequest) sysmemInitAllocRequest(pGpu, pSystemMemory, pAllocRequest)
159 
160 NV_STATUS sysmemCtrlCmdGetSurfaceNumPhysPages_IMPL(struct SystemMemory *pStandardMemory, NV003E_CTRL_GET_SURFACE_NUM_PHYS_PAGES_PARAMS *pParams);
161 
sysmemCtrlCmdGetSurfaceNumPhysPages_DISPATCH(struct SystemMemory * pStandardMemory,NV003E_CTRL_GET_SURFACE_NUM_PHYS_PAGES_PARAMS * pParams)162 static inline NV_STATUS sysmemCtrlCmdGetSurfaceNumPhysPages_DISPATCH(struct SystemMemory *pStandardMemory, NV003E_CTRL_GET_SURFACE_NUM_PHYS_PAGES_PARAMS *pParams) {
163     return pStandardMemory->__sysmemCtrlCmdGetSurfaceNumPhysPages__(pStandardMemory, pParams);
164 }
165 
166 NV_STATUS sysmemCtrlCmdGetSurfacePhysPages_IMPL(struct SystemMemory *pStandardMemory, NV003E_CTRL_GET_SURFACE_PHYS_PAGES_PARAMS *pParams);
167 
sysmemCtrlCmdGetSurfacePhysPages_DISPATCH(struct SystemMemory * pStandardMemory,NV003E_CTRL_GET_SURFACE_PHYS_PAGES_PARAMS * pParams)168 static inline NV_STATUS sysmemCtrlCmdGetSurfacePhysPages_DISPATCH(struct SystemMemory *pStandardMemory, NV003E_CTRL_GET_SURFACE_PHYS_PAGES_PARAMS *pParams) {
169     return pStandardMemory->__sysmemCtrlCmdGetSurfacePhysPages__(pStandardMemory, pParams);
170 }
171 
sysmemCheckMemInterUnmap_DISPATCH(struct SystemMemory * pMemory,NvBool bSubdeviceHandleProvided)172 static inline NV_STATUS sysmemCheckMemInterUnmap_DISPATCH(struct SystemMemory *pMemory, NvBool bSubdeviceHandleProvided) {
173     return pMemory->__sysmemCheckMemInterUnmap__(pMemory, bSubdeviceHandleProvided);
174 }
175 
sysmemShareCallback_DISPATCH(struct SystemMemory * pResource,struct RsClient * pInvokingClient,struct RsResourceRef * pParentRef,RS_SHARE_POLICY * pSharePolicy)176 static inline NvBool sysmemShareCallback_DISPATCH(struct SystemMemory *pResource, struct RsClient *pInvokingClient, struct RsResourceRef *pParentRef, RS_SHARE_POLICY *pSharePolicy) {
177     return pResource->__sysmemShareCallback__(pResource, pInvokingClient, pParentRef, pSharePolicy);
178 }
179 
sysmemMapTo_DISPATCH(struct SystemMemory * pResource,RS_RES_MAP_TO_PARAMS * pParams)180 static inline NV_STATUS sysmemMapTo_DISPATCH(struct SystemMemory *pResource, RS_RES_MAP_TO_PARAMS *pParams) {
181     return pResource->__sysmemMapTo__(pResource, pParams);
182 }
183 
sysmemGetMapAddrSpace_DISPATCH(struct SystemMemory * pMemory,CALL_CONTEXT * pCallContext,NvU32 mapFlags,NV_ADDRESS_SPACE * pAddrSpace)184 static inline NV_STATUS sysmemGetMapAddrSpace_DISPATCH(struct SystemMemory *pMemory, CALL_CONTEXT *pCallContext, NvU32 mapFlags, NV_ADDRESS_SPACE *pAddrSpace) {
185     return pMemory->__sysmemGetMapAddrSpace__(pMemory, pCallContext, mapFlags, pAddrSpace);
186 }
187 
sysmemIsExportAllowed_DISPATCH(struct SystemMemory * pMemory)188 static inline NvBool sysmemIsExportAllowed_DISPATCH(struct SystemMemory *pMemory) {
189     return pMemory->__sysmemIsExportAllowed__(pMemory);
190 }
191 
sysmemGetRefCount_DISPATCH(struct SystemMemory * pResource)192 static inline NvU32 sysmemGetRefCount_DISPATCH(struct SystemMemory *pResource) {
193     return pResource->__sysmemGetRefCount__(pResource);
194 }
195 
sysmemAddAdditionalDependants_DISPATCH(struct RsClient * pClient,struct SystemMemory * pResource,RsResourceRef * pReference)196 static inline void sysmemAddAdditionalDependants_DISPATCH(struct RsClient *pClient, struct SystemMemory *pResource, RsResourceRef *pReference) {
197     pResource->__sysmemAddAdditionalDependants__(pClient, pResource, pReference);
198 }
199 
sysmemControl_Prologue_DISPATCH(struct SystemMemory * pResource,CALL_CONTEXT * pCallContext,struct RS_RES_CONTROL_PARAMS_INTERNAL * pParams)200 static inline NV_STATUS sysmemControl_Prologue_DISPATCH(struct SystemMemory *pResource, CALL_CONTEXT *pCallContext, struct RS_RES_CONTROL_PARAMS_INTERNAL *pParams) {
201     return pResource->__sysmemControl_Prologue__(pResource, pCallContext, pParams);
202 }
203 
sysmemIsGpuMapAllowed_DISPATCH(struct SystemMemory * pMemory,struct OBJGPU * pGpu)204 static inline NvBool sysmemIsGpuMapAllowed_DISPATCH(struct SystemMemory *pMemory, struct OBJGPU *pGpu) {
205     return pMemory->__sysmemIsGpuMapAllowed__(pMemory, pGpu);
206 }
207 
sysmemUnmapFrom_DISPATCH(struct SystemMemory * pResource,RS_RES_UNMAP_FROM_PARAMS * pParams)208 static inline NV_STATUS sysmemUnmapFrom_DISPATCH(struct SystemMemory *pResource, RS_RES_UNMAP_FROM_PARAMS *pParams) {
209     return pResource->__sysmemUnmapFrom__(pResource, pParams);
210 }
211 
sysmemControl_Epilogue_DISPATCH(struct SystemMemory * pResource,CALL_CONTEXT * pCallContext,struct RS_RES_CONTROL_PARAMS_INTERNAL * pParams)212 static inline void sysmemControl_Epilogue_DISPATCH(struct SystemMemory *pResource, CALL_CONTEXT *pCallContext, struct RS_RES_CONTROL_PARAMS_INTERNAL *pParams) {
213     pResource->__sysmemControl_Epilogue__(pResource, pCallContext, pParams);
214 }
215 
sysmemControl_DISPATCH(struct SystemMemory * pMemory,CALL_CONTEXT * pCallContext,struct RS_RES_CONTROL_PARAMS_INTERNAL * pParams)216 static inline NV_STATUS sysmemControl_DISPATCH(struct SystemMemory *pMemory, CALL_CONTEXT *pCallContext, struct RS_RES_CONTROL_PARAMS_INTERNAL *pParams) {
217     return pMemory->__sysmemControl__(pMemory, pCallContext, pParams);
218 }
219 
sysmemUnmap_DISPATCH(struct SystemMemory * pMemory,CALL_CONTEXT * pCallContext,RsCpuMapping * pCpuMapping)220 static inline NV_STATUS sysmemUnmap_DISPATCH(struct SystemMemory *pMemory, CALL_CONTEXT *pCallContext, RsCpuMapping *pCpuMapping) {
221     return pMemory->__sysmemUnmap__(pMemory, pCallContext, pCpuMapping);
222 }
223 
sysmemGetMemInterMapParams_DISPATCH(struct SystemMemory * pMemory,RMRES_MEM_INTER_MAP_PARAMS * pParams)224 static inline NV_STATUS sysmemGetMemInterMapParams_DISPATCH(struct SystemMemory *pMemory, RMRES_MEM_INTER_MAP_PARAMS *pParams) {
225     return pMemory->__sysmemGetMemInterMapParams__(pMemory, pParams);
226 }
227 
sysmemGetMemoryMappingDescriptor_DISPATCH(struct SystemMemory * pMemory,MEMORY_DESCRIPTOR ** ppMemDesc)228 static inline NV_STATUS sysmemGetMemoryMappingDescriptor_DISPATCH(struct SystemMemory *pMemory, MEMORY_DESCRIPTOR **ppMemDesc) {
229     return pMemory->__sysmemGetMemoryMappingDescriptor__(pMemory, ppMemDesc);
230 }
231 
sysmemControlFilter_DISPATCH(struct SystemMemory * pResource,struct CALL_CONTEXT * pCallContext,struct RS_RES_CONTROL_PARAMS_INTERNAL * pParams)232 static inline NV_STATUS sysmemControlFilter_DISPATCH(struct SystemMemory *pResource, struct CALL_CONTEXT *pCallContext, struct RS_RES_CONTROL_PARAMS_INTERNAL *pParams) {
233     return pResource->__sysmemControlFilter__(pResource, pCallContext, pParams);
234 }
235 
sysmemControlSerialization_Prologue_DISPATCH(struct SystemMemory * pResource,CALL_CONTEXT * pCallContext,struct RS_RES_CONTROL_PARAMS_INTERNAL * pParams)236 static inline NV_STATUS sysmemControlSerialization_Prologue_DISPATCH(struct SystemMemory *pResource, CALL_CONTEXT *pCallContext, struct RS_RES_CONTROL_PARAMS_INTERNAL *pParams) {
237     return pResource->__sysmemControlSerialization_Prologue__(pResource, pCallContext, pParams);
238 }
239 
sysmemCanCopy_DISPATCH(struct SystemMemory * pStandardMemory)240 static inline NvBool sysmemCanCopy_DISPATCH(struct SystemMemory *pStandardMemory) {
241     return pStandardMemory->__sysmemCanCopy__(pStandardMemory);
242 }
243 
sysmemIsPartialUnmapSupported_DISPATCH(struct SystemMemory * pResource)244 static inline NvBool sysmemIsPartialUnmapSupported_DISPATCH(struct SystemMemory *pResource) {
245     return pResource->__sysmemIsPartialUnmapSupported__(pResource);
246 }
247 
sysmemIsReady_DISPATCH(struct SystemMemory * pMemory,NvBool bCopyConstructorContext)248 static inline NV_STATUS sysmemIsReady_DISPATCH(struct SystemMemory *pMemory, NvBool bCopyConstructorContext) {
249     return pMemory->__sysmemIsReady__(pMemory, bCopyConstructorContext);
250 }
251 
sysmemCheckCopyPermissions_DISPATCH(struct SystemMemory * pMemory,struct OBJGPU * pDstGpu,struct Device * pDstDevice)252 static inline NV_STATUS sysmemCheckCopyPermissions_DISPATCH(struct SystemMemory *pMemory, struct OBJGPU *pDstGpu, struct Device *pDstDevice) {
253     return pMemory->__sysmemCheckCopyPermissions__(pMemory, pDstGpu, pDstDevice);
254 }
255 
sysmemPreDestruct_DISPATCH(struct SystemMemory * pResource)256 static inline void sysmemPreDestruct_DISPATCH(struct SystemMemory *pResource) {
257     pResource->__sysmemPreDestruct__(pResource);
258 }
259 
sysmemIsDuplicate_DISPATCH(struct SystemMemory * pMemory,NvHandle hMemory,NvBool * pDuplicate)260 static inline NV_STATUS sysmemIsDuplicate_DISPATCH(struct SystemMemory *pMemory, NvHandle hMemory, NvBool *pDuplicate) {
261     return pMemory->__sysmemIsDuplicate__(pMemory, hMemory, pDuplicate);
262 }
263 
sysmemControlSerialization_Epilogue_DISPATCH(struct SystemMemory * pResource,CALL_CONTEXT * pCallContext,struct RS_RES_CONTROL_PARAMS_INTERNAL * pParams)264 static inline void sysmemControlSerialization_Epilogue_DISPATCH(struct SystemMemory *pResource, CALL_CONTEXT *pCallContext, struct RS_RES_CONTROL_PARAMS_INTERNAL *pParams) {
265     pResource->__sysmemControlSerialization_Epilogue__(pResource, pCallContext, pParams);
266 }
267 
sysmemMap_DISPATCH(struct SystemMemory * pMemory,CALL_CONTEXT * pCallContext,struct RS_CPU_MAP_PARAMS * pParams,RsCpuMapping * pCpuMapping)268 static inline NV_STATUS sysmemMap_DISPATCH(struct SystemMemory *pMemory, CALL_CONTEXT *pCallContext, struct RS_CPU_MAP_PARAMS *pParams, RsCpuMapping *pCpuMapping) {
269     return pMemory->__sysmemMap__(pMemory, pCallContext, pParams, pCpuMapping);
270 }
271 
sysmemAccessCallback_DISPATCH(struct SystemMemory * pResource,struct RsClient * pInvokingClient,void * pAllocParams,RsAccessRight accessRight)272 static inline NvBool sysmemAccessCallback_DISPATCH(struct SystemMemory *pResource, struct RsClient *pInvokingClient, void *pAllocParams, RsAccessRight accessRight) {
273     return pResource->__sysmemAccessCallback__(pResource, pInvokingClient, pAllocParams, accessRight);
274 }
275 
276 NV_STATUS sysmemConstruct_IMPL(struct SystemMemory *arg_pStandardMemory, CALL_CONTEXT *arg_pCallContext, struct RS_RES_ALLOC_PARAMS_INTERNAL *arg_pParams);
277 
278 #define __nvoc_sysmemConstruct(arg_pStandardMemory, arg_pCallContext, arg_pParams) sysmemConstruct_IMPL(arg_pStandardMemory, arg_pCallContext, arg_pParams)
279 #undef PRIVATE_FIELD
280 
281 
282 NV_STATUS sysmemAllocResources(OBJGPU *pGpu, struct MemoryManager *pMemoryManager,
283                                MEMORY_ALLOCATION_REQUEST *pAllocRequest, FB_ALLOC_INFO *pFbAllocInfo,
284                                struct SystemMemory *pSystemMemory);
285 
286 #endif
287 
288 #ifdef __cplusplus
289 } // extern "C"
290 #endif
291 
292 #endif // _G_SYSTEM_MEM_NVOC_H_
293