1
2 #ifndef _G_VASPACE_API_NVOC_H_
3 #define _G_VASPACE_API_NVOC_H_
4 #include "nvoc/runtime.h"
5
6 // Version of generated metadata structures
7 #ifdef NVOC_METADATA_VERSION
8 #undef NVOC_METADATA_VERSION
9 #endif
10 #define NVOC_METADATA_VERSION 1
11
12 #ifdef __cplusplus
13 extern "C" {
14 #endif
15
16 /*
17 * SPDX-FileCopyrightText: Copyright (c) 1993-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
18 * SPDX-License-Identifier: MIT
19 *
20 * Permission is hereby granted, free of charge, to any person obtaining a
21 * copy of this software and associated documentation files (the "Software"),
22 * to deal in the Software without restriction, including without limitation
23 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
24 * and/or sell copies of the Software, and to permit persons to whom the
25 * Software is furnished to do so, subject to the following conditions:
26 *
27 * The above copyright notice and this permission notice shall be included in
28 * all copies or substantial portions of the Software.
29 *
30 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
31 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
32 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
33 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
34 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
35 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
36 * DEALINGS IN THE SOFTWARE.
37 */
38
39 #pragma once
40 #include "g_vaspace_api_nvoc.h"
41
42 #ifndef VASPACE_API_H
43 #define VASPACE_API_H
44
45 #include "core/core.h"
46 #include "mem_mgr/vaspace.h"
47 #include "rmapi/client.h"
48 #include "gpu/gpu_resource.h"
49 #include "ctrl/ctrl90f1.h"
50 #include "rmapi/control.h" // for macro RMCTRL_EXPORT etc.
51
52 #define RM_INVALID_VASPACE_HANDLE 0xFFFFFFFF
53
54 /*!
55 * Actions to manage the Server RM page levels (only used by Split VAS mechanism)
56 */
57 typedef enum
58 {
59 VASPACEAPI_MANAGE_PAGE_LEVELS_RESERVE,
60 VASPACEAPI_MANAGE_PAGE_LEVELS_RELEASE,
61 VASPACEAPI_MANAGE_PAGE_LEVELS_TRIM,
62 } VASPACEAPI_MANAGE_PAGE_LEVELS_ACTION;
63
64
65 // Private field names are wrapped in PRIVATE_FIELD, which does nothing for
66 // the matching C source file, but causes diagnostics to be issued if another
67 // source file references the field.
68 #ifdef NVOC_VASPACE_API_H_PRIVATE_ACCESS_ALLOWED
69 #define PRIVATE_FIELD(x) x
70 #else
71 #define PRIVATE_FIELD(x) NVOC_PRIVATE_FIELD(x)
72 #endif
73
74
75 // Metadata including vtable
76 struct NVOC_VTABLE__VaSpaceApi;
77
78
79 struct VaSpaceApi {
80
81 // Metadata
82 const struct NVOC_RTTI *__nvoc_rtti;
83 const struct NVOC_VTABLE__VaSpaceApi *__nvoc_vtable;
84
85 // Parent (i.e. superclass or base class) object pointers
86 struct GpuResource __nvoc_base_GpuResource;
87
88 // Ancestor object pointers for `staticCast` feature
89 struct Object *__nvoc_pbase_Object; // obj super^4
90 struct RsResource *__nvoc_pbase_RsResource; // res super^3
91 struct RmResourceCommon *__nvoc_pbase_RmResourceCommon; // rmrescmn super^3
92 struct RmResource *__nvoc_pbase_RmResource; // rmres super^2
93 struct GpuResource *__nvoc_pbase_GpuResource; // gpures super
94 struct VaSpaceApi *__nvoc_pbase_VaSpaceApi; // vaspaceapi
95
96 // Vtable with 6 per-object function pointers
97 NV_STATUS (*__vaspaceapiCtrlCmdVaspaceGetGmmuFormat__)(struct VaSpaceApi * /*this*/, NV90F1_CTRL_VASPACE_GET_GMMU_FORMAT_PARAMS *); // exported (id=0x90f10101)
98 NV_STATUS (*__vaspaceapiCtrlCmdVaspaceGetPageLevelInfo__)(struct VaSpaceApi * /*this*/, NV90F1_CTRL_VASPACE_GET_PAGE_LEVEL_INFO_PARAMS *); // exported (id=0x90f10102)
99 NV_STATUS (*__vaspaceapiCtrlCmdVaspaceReserveEntries__)(struct VaSpaceApi * /*this*/, NV90F1_CTRL_VASPACE_RESERVE_ENTRIES_PARAMS *); // exported (id=0x90f10103)
100 NV_STATUS (*__vaspaceapiCtrlCmdVaspaceReleaseEntries__)(struct VaSpaceApi * /*this*/, NV90F1_CTRL_VASPACE_RELEASE_ENTRIES_PARAMS *); // exported (id=0x90f10104)
101 NV_STATUS (*__vaspaceapiCtrlCmdVaspaceCopyServerReservedPdes__)(struct VaSpaceApi * /*this*/, NV90F1_CTRL_VASPACE_COPY_SERVER_RESERVED_PDES_PARAMS *); // exported (id=0x90f10106)
102 NV_STATUS (*__vaspaceapiCtrlCmdVaspaceGetHostRmManagedSize__)(struct VaSpaceApi * /*this*/, NV90F1_CTRL_VASPACE_GET_HOST_RM_MANAGED_SIZE_PARAMS *); // exported (id=0x90f10107)
103
104 // Data members
105 struct OBJVASPACE *pVASpace;
106 };
107
108
109 // Metadata including vtable with 25 function pointers plus superclass metadata
110 struct NVOC_VTABLE__VaSpaceApi {
111 const struct NVOC_VTABLE__GpuResource GpuResource; // (gpures) 25 function pointers
112
113 NvBool (*__vaspaceapiCanCopy__)(struct VaSpaceApi * /*this*/); // virtual override (res) base (gpures)
114 NV_STATUS (*__vaspaceapiControl__)(struct VaSpaceApi * /*this*/, struct CALL_CONTEXT *, struct RS_RES_CONTROL_PARAMS_INTERNAL *); // virtual inherited (gpures) base (gpures)
115 NV_STATUS (*__vaspaceapiMap__)(struct VaSpaceApi * /*this*/, struct CALL_CONTEXT *, struct RS_CPU_MAP_PARAMS *, struct RsCpuMapping *); // virtual inherited (gpures) base (gpures)
116 NV_STATUS (*__vaspaceapiUnmap__)(struct VaSpaceApi * /*this*/, struct CALL_CONTEXT *, struct RsCpuMapping *); // virtual inherited (gpures) base (gpures)
117 NvBool (*__vaspaceapiShareCallback__)(struct VaSpaceApi * /*this*/, struct RsClient *, struct RsResourceRef *, RS_SHARE_POLICY *); // virtual inherited (gpures) base (gpures)
118 NV_STATUS (*__vaspaceapiGetRegBaseOffsetAndSize__)(struct VaSpaceApi * /*this*/, struct OBJGPU *, NvU32 *, NvU32 *); // virtual inherited (gpures) base (gpures)
119 NV_STATUS (*__vaspaceapiGetMapAddrSpace__)(struct VaSpaceApi * /*this*/, struct CALL_CONTEXT *, NvU32, NV_ADDRESS_SPACE *); // virtual inherited (gpures) base (gpures)
120 NV_STATUS (*__vaspaceapiInternalControlForward__)(struct VaSpaceApi * /*this*/, NvU32, void *, NvU32); // virtual inherited (gpures) base (gpures)
121 NvHandle (*__vaspaceapiGetInternalObjectHandle__)(struct VaSpaceApi * /*this*/); // virtual inherited (gpures) base (gpures)
122 NvBool (*__vaspaceapiAccessCallback__)(struct VaSpaceApi * /*this*/, struct RsClient *, void *, RsAccessRight); // virtual inherited (rmres) base (gpures)
123 NV_STATUS (*__vaspaceapiGetMemInterMapParams__)(struct VaSpaceApi * /*this*/, RMRES_MEM_INTER_MAP_PARAMS *); // virtual inherited (rmres) base (gpures)
124 NV_STATUS (*__vaspaceapiCheckMemInterUnmap__)(struct VaSpaceApi * /*this*/, NvBool); // virtual inherited (rmres) base (gpures)
125 NV_STATUS (*__vaspaceapiGetMemoryMappingDescriptor__)(struct VaSpaceApi * /*this*/, struct MEMORY_DESCRIPTOR **); // virtual inherited (rmres) base (gpures)
126 NV_STATUS (*__vaspaceapiControlSerialization_Prologue__)(struct VaSpaceApi * /*this*/, struct CALL_CONTEXT *, struct RS_RES_CONTROL_PARAMS_INTERNAL *); // virtual inherited (rmres) base (gpures)
127 void (*__vaspaceapiControlSerialization_Epilogue__)(struct VaSpaceApi * /*this*/, struct CALL_CONTEXT *, struct RS_RES_CONTROL_PARAMS_INTERNAL *); // virtual inherited (rmres) base (gpures)
128 NV_STATUS (*__vaspaceapiControl_Prologue__)(struct VaSpaceApi * /*this*/, struct CALL_CONTEXT *, struct RS_RES_CONTROL_PARAMS_INTERNAL *); // virtual inherited (rmres) base (gpures)
129 void (*__vaspaceapiControl_Epilogue__)(struct VaSpaceApi * /*this*/, struct CALL_CONTEXT *, struct RS_RES_CONTROL_PARAMS_INTERNAL *); // virtual inherited (rmres) base (gpures)
130 NV_STATUS (*__vaspaceapiIsDuplicate__)(struct VaSpaceApi * /*this*/, NvHandle, NvBool *); // virtual inherited (res) base (gpures)
131 void (*__vaspaceapiPreDestruct__)(struct VaSpaceApi * /*this*/); // virtual inherited (res) base (gpures)
132 NV_STATUS (*__vaspaceapiControlFilter__)(struct VaSpaceApi * /*this*/, struct CALL_CONTEXT *, struct RS_RES_CONTROL_PARAMS_INTERNAL *); // virtual inherited (res) base (gpures)
133 NvBool (*__vaspaceapiIsPartialUnmapSupported__)(struct VaSpaceApi * /*this*/); // inline virtual inherited (res) base (gpures) body
134 NV_STATUS (*__vaspaceapiMapTo__)(struct VaSpaceApi * /*this*/, RS_RES_MAP_TO_PARAMS *); // virtual inherited (res) base (gpures)
135 NV_STATUS (*__vaspaceapiUnmapFrom__)(struct VaSpaceApi * /*this*/, RS_RES_UNMAP_FROM_PARAMS *); // virtual inherited (res) base (gpures)
136 NvU32 (*__vaspaceapiGetRefCount__)(struct VaSpaceApi * /*this*/); // virtual inherited (res) base (gpures)
137 void (*__vaspaceapiAddAdditionalDependants__)(struct RsClient *, struct VaSpaceApi * /*this*/, RsResourceRef *); // virtual inherited (res) base (gpures)
138 };
139
140 #ifndef __NVOC_CLASS_VaSpaceApi_TYPEDEF__
141 #define __NVOC_CLASS_VaSpaceApi_TYPEDEF__
142 typedef struct VaSpaceApi VaSpaceApi;
143 #endif /* __NVOC_CLASS_VaSpaceApi_TYPEDEF__ */
144
145 #ifndef __nvoc_class_id_VaSpaceApi
146 #define __nvoc_class_id_VaSpaceApi 0xcd048b
147 #endif /* __nvoc_class_id_VaSpaceApi */
148
149 // Casting support
150 extern const struct NVOC_CLASS_DEF __nvoc_class_def_VaSpaceApi;
151
152 #define __staticCast_VaSpaceApi(pThis) \
153 ((pThis)->__nvoc_pbase_VaSpaceApi)
154
155 #ifdef __nvoc_vaspace_api_h_disabled
156 #define __dynamicCast_VaSpaceApi(pThis) ((VaSpaceApi*)NULL)
157 #else //__nvoc_vaspace_api_h_disabled
158 #define __dynamicCast_VaSpaceApi(pThis) \
159 ((VaSpaceApi*)__nvoc_dynamicCast(staticCast((pThis), Dynamic), classInfo(VaSpaceApi)))
160 #endif //__nvoc_vaspace_api_h_disabled
161
162 NV_STATUS __nvoc_objCreateDynamic_VaSpaceApi(VaSpaceApi**, Dynamic*, NvU32, va_list);
163
164 NV_STATUS __nvoc_objCreate_VaSpaceApi(VaSpaceApi**, Dynamic*, NvU32, struct CALL_CONTEXT * arg_pCallContext, struct RS_RES_ALLOC_PARAMS_INTERNAL * arg_pParams);
165 #define __objCreate_VaSpaceApi(ppNewObj, pParent, createFlags, arg_pCallContext, arg_pParams) \
166 __nvoc_objCreate_VaSpaceApi((ppNewObj), staticCast((pParent), Dynamic), (createFlags), arg_pCallContext, arg_pParams)
167
168
169 // Wrapper macros
170 #define vaspaceapiCanCopy_FNPTR(pResource) pResource->__nvoc_vtable->__vaspaceapiCanCopy__
171 #define vaspaceapiCanCopy(pResource) vaspaceapiCanCopy_DISPATCH(pResource)
172 #define vaspaceapiCtrlCmdVaspaceGetGmmuFormat_FNPTR(pVaspaceApi) pVaspaceApi->__vaspaceapiCtrlCmdVaspaceGetGmmuFormat__
173 #define vaspaceapiCtrlCmdVaspaceGetGmmuFormat(pVaspaceApi, pGmmuFormatParams) vaspaceapiCtrlCmdVaspaceGetGmmuFormat_DISPATCH(pVaspaceApi, pGmmuFormatParams)
174 #define vaspaceapiCtrlCmdVaspaceGetPageLevelInfo_FNPTR(pVaspaceApi) pVaspaceApi->__vaspaceapiCtrlCmdVaspaceGetPageLevelInfo__
175 #define vaspaceapiCtrlCmdVaspaceGetPageLevelInfo(pVaspaceApi, pPageLevelInfoParams) vaspaceapiCtrlCmdVaspaceGetPageLevelInfo_DISPATCH(pVaspaceApi, pPageLevelInfoParams)
176 #define vaspaceapiCtrlCmdVaspaceReserveEntries_FNPTR(pVaspaceApi) pVaspaceApi->__vaspaceapiCtrlCmdVaspaceReserveEntries__
177 #define vaspaceapiCtrlCmdVaspaceReserveEntries(pVaspaceApi, pReserveEntriesParams) vaspaceapiCtrlCmdVaspaceReserveEntries_DISPATCH(pVaspaceApi, pReserveEntriesParams)
178 #define vaspaceapiCtrlCmdVaspaceReleaseEntries_FNPTR(pVaspaceApi) pVaspaceApi->__vaspaceapiCtrlCmdVaspaceReleaseEntries__
179 #define vaspaceapiCtrlCmdVaspaceReleaseEntries(pVaspaceApi, pReleaseEntriesParams) vaspaceapiCtrlCmdVaspaceReleaseEntries_DISPATCH(pVaspaceApi, pReleaseEntriesParams)
180 #define vaspaceapiCtrlCmdVaspaceCopyServerReservedPdes_FNPTR(pVaspaceApi) pVaspaceApi->__vaspaceapiCtrlCmdVaspaceCopyServerReservedPdes__
181 #define vaspaceapiCtrlCmdVaspaceCopyServerReservedPdes(pVaspaceApi, pCopyServerReservedPdesParams) vaspaceapiCtrlCmdVaspaceCopyServerReservedPdes_DISPATCH(pVaspaceApi, pCopyServerReservedPdesParams)
182 #define vaspaceapiCtrlCmdVaspaceGetHostRmManagedSize_FNPTR(pVaspaceApi) pVaspaceApi->__vaspaceapiCtrlCmdVaspaceGetHostRmManagedSize__
183 #define vaspaceapiCtrlCmdVaspaceGetHostRmManagedSize(pVaspaceApi, pVaspaceGetHostRmManagedSizeParams) vaspaceapiCtrlCmdVaspaceGetHostRmManagedSize_DISPATCH(pVaspaceApi, pVaspaceGetHostRmManagedSizeParams)
184 #define vaspaceapiControl_FNPTR(pGpuResource) pGpuResource->__nvoc_base_GpuResource.__nvoc_vtable->__gpuresControl__
185 #define vaspaceapiControl(pGpuResource, pCallContext, pParams) vaspaceapiControl_DISPATCH(pGpuResource, pCallContext, pParams)
186 #define vaspaceapiMap_FNPTR(pGpuResource) pGpuResource->__nvoc_base_GpuResource.__nvoc_vtable->__gpuresMap__
187 #define vaspaceapiMap(pGpuResource, pCallContext, pParams, pCpuMapping) vaspaceapiMap_DISPATCH(pGpuResource, pCallContext, pParams, pCpuMapping)
188 #define vaspaceapiUnmap_FNPTR(pGpuResource) pGpuResource->__nvoc_base_GpuResource.__nvoc_vtable->__gpuresUnmap__
189 #define vaspaceapiUnmap(pGpuResource, pCallContext, pCpuMapping) vaspaceapiUnmap_DISPATCH(pGpuResource, pCallContext, pCpuMapping)
190 #define vaspaceapiShareCallback_FNPTR(pGpuResource) pGpuResource->__nvoc_base_GpuResource.__nvoc_vtable->__gpuresShareCallback__
191 #define vaspaceapiShareCallback(pGpuResource, pInvokingClient, pParentRef, pSharePolicy) vaspaceapiShareCallback_DISPATCH(pGpuResource, pInvokingClient, pParentRef, pSharePolicy)
192 #define vaspaceapiGetRegBaseOffsetAndSize_FNPTR(pGpuResource) pGpuResource->__nvoc_base_GpuResource.__nvoc_vtable->__gpuresGetRegBaseOffsetAndSize__
193 #define vaspaceapiGetRegBaseOffsetAndSize(pGpuResource, pGpu, pOffset, pSize) vaspaceapiGetRegBaseOffsetAndSize_DISPATCH(pGpuResource, pGpu, pOffset, pSize)
194 #define vaspaceapiGetMapAddrSpace_FNPTR(pGpuResource) pGpuResource->__nvoc_base_GpuResource.__nvoc_vtable->__gpuresGetMapAddrSpace__
195 #define vaspaceapiGetMapAddrSpace(pGpuResource, pCallContext, mapFlags, pAddrSpace) vaspaceapiGetMapAddrSpace_DISPATCH(pGpuResource, pCallContext, mapFlags, pAddrSpace)
196 #define vaspaceapiInternalControlForward_FNPTR(pGpuResource) pGpuResource->__nvoc_base_GpuResource.__nvoc_vtable->__gpuresInternalControlForward__
197 #define vaspaceapiInternalControlForward(pGpuResource, command, pParams, size) vaspaceapiInternalControlForward_DISPATCH(pGpuResource, command, pParams, size)
198 #define vaspaceapiGetInternalObjectHandle_FNPTR(pGpuResource) pGpuResource->__nvoc_base_GpuResource.__nvoc_vtable->__gpuresGetInternalObjectHandle__
199 #define vaspaceapiGetInternalObjectHandle(pGpuResource) vaspaceapiGetInternalObjectHandle_DISPATCH(pGpuResource)
200 #define vaspaceapiAccessCallback_FNPTR(pResource) pResource->__nvoc_base_GpuResource.__nvoc_base_RmResource.__nvoc_vtable->__rmresAccessCallback__
201 #define vaspaceapiAccessCallback(pResource, pInvokingClient, pAllocParams, accessRight) vaspaceapiAccessCallback_DISPATCH(pResource, pInvokingClient, pAllocParams, accessRight)
202 #define vaspaceapiGetMemInterMapParams_FNPTR(pRmResource) pRmResource->__nvoc_base_GpuResource.__nvoc_base_RmResource.__nvoc_vtable->__rmresGetMemInterMapParams__
203 #define vaspaceapiGetMemInterMapParams(pRmResource, pParams) vaspaceapiGetMemInterMapParams_DISPATCH(pRmResource, pParams)
204 #define vaspaceapiCheckMemInterUnmap_FNPTR(pRmResource) pRmResource->__nvoc_base_GpuResource.__nvoc_base_RmResource.__nvoc_vtable->__rmresCheckMemInterUnmap__
205 #define vaspaceapiCheckMemInterUnmap(pRmResource, bSubdeviceHandleProvided) vaspaceapiCheckMemInterUnmap_DISPATCH(pRmResource, bSubdeviceHandleProvided)
206 #define vaspaceapiGetMemoryMappingDescriptor_FNPTR(pRmResource) pRmResource->__nvoc_base_GpuResource.__nvoc_base_RmResource.__nvoc_vtable->__rmresGetMemoryMappingDescriptor__
207 #define vaspaceapiGetMemoryMappingDescriptor(pRmResource, ppMemDesc) vaspaceapiGetMemoryMappingDescriptor_DISPATCH(pRmResource, ppMemDesc)
208 #define vaspaceapiControlSerialization_Prologue_FNPTR(pResource) pResource->__nvoc_base_GpuResource.__nvoc_base_RmResource.__nvoc_vtable->__rmresControlSerialization_Prologue__
209 #define vaspaceapiControlSerialization_Prologue(pResource, pCallContext, pParams) vaspaceapiControlSerialization_Prologue_DISPATCH(pResource, pCallContext, pParams)
210 #define vaspaceapiControlSerialization_Epilogue_FNPTR(pResource) pResource->__nvoc_base_GpuResource.__nvoc_base_RmResource.__nvoc_vtable->__rmresControlSerialization_Epilogue__
211 #define vaspaceapiControlSerialization_Epilogue(pResource, pCallContext, pParams) vaspaceapiControlSerialization_Epilogue_DISPATCH(pResource, pCallContext, pParams)
212 #define vaspaceapiControl_Prologue_FNPTR(pResource) pResource->__nvoc_base_GpuResource.__nvoc_base_RmResource.__nvoc_vtable->__rmresControl_Prologue__
213 #define vaspaceapiControl_Prologue(pResource, pCallContext, pParams) vaspaceapiControl_Prologue_DISPATCH(pResource, pCallContext, pParams)
214 #define vaspaceapiControl_Epilogue_FNPTR(pResource) pResource->__nvoc_base_GpuResource.__nvoc_base_RmResource.__nvoc_vtable->__rmresControl_Epilogue__
215 #define vaspaceapiControl_Epilogue(pResource, pCallContext, pParams) vaspaceapiControl_Epilogue_DISPATCH(pResource, pCallContext, pParams)
216 #define vaspaceapiIsDuplicate_FNPTR(pResource) pResource->__nvoc_base_GpuResource.__nvoc_base_RmResource.__nvoc_base_RsResource.__nvoc_vtable->__resIsDuplicate__
217 #define vaspaceapiIsDuplicate(pResource, hMemory, pDuplicate) vaspaceapiIsDuplicate_DISPATCH(pResource, hMemory, pDuplicate)
218 #define vaspaceapiPreDestruct_FNPTR(pResource) pResource->__nvoc_base_GpuResource.__nvoc_base_RmResource.__nvoc_base_RsResource.__nvoc_vtable->__resPreDestruct__
219 #define vaspaceapiPreDestruct(pResource) vaspaceapiPreDestruct_DISPATCH(pResource)
220 #define vaspaceapiControlFilter_FNPTR(pResource) pResource->__nvoc_base_GpuResource.__nvoc_base_RmResource.__nvoc_base_RsResource.__nvoc_vtable->__resControlFilter__
221 #define vaspaceapiControlFilter(pResource, pCallContext, pParams) vaspaceapiControlFilter_DISPATCH(pResource, pCallContext, pParams)
222 #define vaspaceapiIsPartialUnmapSupported_FNPTR(pResource) pResource->__nvoc_base_GpuResource.__nvoc_base_RmResource.__nvoc_base_RsResource.__nvoc_vtable->__resIsPartialUnmapSupported__
223 #define vaspaceapiIsPartialUnmapSupported(pResource) vaspaceapiIsPartialUnmapSupported_DISPATCH(pResource)
224 #define vaspaceapiMapTo_FNPTR(pResource) pResource->__nvoc_base_GpuResource.__nvoc_base_RmResource.__nvoc_base_RsResource.__nvoc_vtable->__resMapTo__
225 #define vaspaceapiMapTo(pResource, pParams) vaspaceapiMapTo_DISPATCH(pResource, pParams)
226 #define vaspaceapiUnmapFrom_FNPTR(pResource) pResource->__nvoc_base_GpuResource.__nvoc_base_RmResource.__nvoc_base_RsResource.__nvoc_vtable->__resUnmapFrom__
227 #define vaspaceapiUnmapFrom(pResource, pParams) vaspaceapiUnmapFrom_DISPATCH(pResource, pParams)
228 #define vaspaceapiGetRefCount_FNPTR(pResource) pResource->__nvoc_base_GpuResource.__nvoc_base_RmResource.__nvoc_base_RsResource.__nvoc_vtable->__resGetRefCount__
229 #define vaspaceapiGetRefCount(pResource) vaspaceapiGetRefCount_DISPATCH(pResource)
230 #define vaspaceapiAddAdditionalDependants_FNPTR(pResource) pResource->__nvoc_base_GpuResource.__nvoc_base_RmResource.__nvoc_base_RsResource.__nvoc_vtable->__resAddAdditionalDependants__
231 #define vaspaceapiAddAdditionalDependants(pClient, pResource, pReference) vaspaceapiAddAdditionalDependants_DISPATCH(pClient, pResource, pReference)
232
233 // Dispatch functions
vaspaceapiCanCopy_DISPATCH(struct VaSpaceApi * pResource)234 static inline NvBool vaspaceapiCanCopy_DISPATCH(struct VaSpaceApi *pResource) {
235 return pResource->__nvoc_vtable->__vaspaceapiCanCopy__(pResource);
236 }
237
vaspaceapiCtrlCmdVaspaceGetGmmuFormat_DISPATCH(struct VaSpaceApi * pVaspaceApi,NV90F1_CTRL_VASPACE_GET_GMMU_FORMAT_PARAMS * pGmmuFormatParams)238 static inline NV_STATUS vaspaceapiCtrlCmdVaspaceGetGmmuFormat_DISPATCH(struct VaSpaceApi *pVaspaceApi, NV90F1_CTRL_VASPACE_GET_GMMU_FORMAT_PARAMS *pGmmuFormatParams) {
239 return pVaspaceApi->__vaspaceapiCtrlCmdVaspaceGetGmmuFormat__(pVaspaceApi, pGmmuFormatParams);
240 }
241
vaspaceapiCtrlCmdVaspaceGetPageLevelInfo_DISPATCH(struct VaSpaceApi * pVaspaceApi,NV90F1_CTRL_VASPACE_GET_PAGE_LEVEL_INFO_PARAMS * pPageLevelInfoParams)242 static inline NV_STATUS vaspaceapiCtrlCmdVaspaceGetPageLevelInfo_DISPATCH(struct VaSpaceApi *pVaspaceApi, NV90F1_CTRL_VASPACE_GET_PAGE_LEVEL_INFO_PARAMS *pPageLevelInfoParams) {
243 return pVaspaceApi->__vaspaceapiCtrlCmdVaspaceGetPageLevelInfo__(pVaspaceApi, pPageLevelInfoParams);
244 }
245
vaspaceapiCtrlCmdVaspaceReserveEntries_DISPATCH(struct VaSpaceApi * pVaspaceApi,NV90F1_CTRL_VASPACE_RESERVE_ENTRIES_PARAMS * pReserveEntriesParams)246 static inline NV_STATUS vaspaceapiCtrlCmdVaspaceReserveEntries_DISPATCH(struct VaSpaceApi *pVaspaceApi, NV90F1_CTRL_VASPACE_RESERVE_ENTRIES_PARAMS *pReserveEntriesParams) {
247 return pVaspaceApi->__vaspaceapiCtrlCmdVaspaceReserveEntries__(pVaspaceApi, pReserveEntriesParams);
248 }
249
vaspaceapiCtrlCmdVaspaceReleaseEntries_DISPATCH(struct VaSpaceApi * pVaspaceApi,NV90F1_CTRL_VASPACE_RELEASE_ENTRIES_PARAMS * pReleaseEntriesParams)250 static inline NV_STATUS vaspaceapiCtrlCmdVaspaceReleaseEntries_DISPATCH(struct VaSpaceApi *pVaspaceApi, NV90F1_CTRL_VASPACE_RELEASE_ENTRIES_PARAMS *pReleaseEntriesParams) {
251 return pVaspaceApi->__vaspaceapiCtrlCmdVaspaceReleaseEntries__(pVaspaceApi, pReleaseEntriesParams);
252 }
253
vaspaceapiCtrlCmdVaspaceCopyServerReservedPdes_DISPATCH(struct VaSpaceApi * pVaspaceApi,NV90F1_CTRL_VASPACE_COPY_SERVER_RESERVED_PDES_PARAMS * pCopyServerReservedPdesParams)254 static inline NV_STATUS vaspaceapiCtrlCmdVaspaceCopyServerReservedPdes_DISPATCH(struct VaSpaceApi *pVaspaceApi, NV90F1_CTRL_VASPACE_COPY_SERVER_RESERVED_PDES_PARAMS *pCopyServerReservedPdesParams) {
255 return pVaspaceApi->__vaspaceapiCtrlCmdVaspaceCopyServerReservedPdes__(pVaspaceApi, pCopyServerReservedPdesParams);
256 }
257
vaspaceapiCtrlCmdVaspaceGetHostRmManagedSize_DISPATCH(struct VaSpaceApi * pVaspaceApi,NV90F1_CTRL_VASPACE_GET_HOST_RM_MANAGED_SIZE_PARAMS * pVaspaceGetHostRmManagedSizeParams)258 static inline NV_STATUS vaspaceapiCtrlCmdVaspaceGetHostRmManagedSize_DISPATCH(struct VaSpaceApi *pVaspaceApi, NV90F1_CTRL_VASPACE_GET_HOST_RM_MANAGED_SIZE_PARAMS *pVaspaceGetHostRmManagedSizeParams) {
259 return pVaspaceApi->__vaspaceapiCtrlCmdVaspaceGetHostRmManagedSize__(pVaspaceApi, pVaspaceGetHostRmManagedSizeParams);
260 }
261
vaspaceapiControl_DISPATCH(struct VaSpaceApi * pGpuResource,struct CALL_CONTEXT * pCallContext,struct RS_RES_CONTROL_PARAMS_INTERNAL * pParams)262 static inline NV_STATUS vaspaceapiControl_DISPATCH(struct VaSpaceApi *pGpuResource, struct CALL_CONTEXT *pCallContext, struct RS_RES_CONTROL_PARAMS_INTERNAL *pParams) {
263 return pGpuResource->__nvoc_vtable->__vaspaceapiControl__(pGpuResource, pCallContext, pParams);
264 }
265
vaspaceapiMap_DISPATCH(struct VaSpaceApi * pGpuResource,struct CALL_CONTEXT * pCallContext,struct RS_CPU_MAP_PARAMS * pParams,struct RsCpuMapping * pCpuMapping)266 static inline NV_STATUS vaspaceapiMap_DISPATCH(struct VaSpaceApi *pGpuResource, struct CALL_CONTEXT *pCallContext, struct RS_CPU_MAP_PARAMS *pParams, struct RsCpuMapping *pCpuMapping) {
267 return pGpuResource->__nvoc_vtable->__vaspaceapiMap__(pGpuResource, pCallContext, pParams, pCpuMapping);
268 }
269
vaspaceapiUnmap_DISPATCH(struct VaSpaceApi * pGpuResource,struct CALL_CONTEXT * pCallContext,struct RsCpuMapping * pCpuMapping)270 static inline NV_STATUS vaspaceapiUnmap_DISPATCH(struct VaSpaceApi *pGpuResource, struct CALL_CONTEXT *pCallContext, struct RsCpuMapping *pCpuMapping) {
271 return pGpuResource->__nvoc_vtable->__vaspaceapiUnmap__(pGpuResource, pCallContext, pCpuMapping);
272 }
273
vaspaceapiShareCallback_DISPATCH(struct VaSpaceApi * pGpuResource,struct RsClient * pInvokingClient,struct RsResourceRef * pParentRef,RS_SHARE_POLICY * pSharePolicy)274 static inline NvBool vaspaceapiShareCallback_DISPATCH(struct VaSpaceApi *pGpuResource, struct RsClient *pInvokingClient, struct RsResourceRef *pParentRef, RS_SHARE_POLICY *pSharePolicy) {
275 return pGpuResource->__nvoc_vtable->__vaspaceapiShareCallback__(pGpuResource, pInvokingClient, pParentRef, pSharePolicy);
276 }
277
vaspaceapiGetRegBaseOffsetAndSize_DISPATCH(struct VaSpaceApi * pGpuResource,struct OBJGPU * pGpu,NvU32 * pOffset,NvU32 * pSize)278 static inline NV_STATUS vaspaceapiGetRegBaseOffsetAndSize_DISPATCH(struct VaSpaceApi *pGpuResource, struct OBJGPU *pGpu, NvU32 *pOffset, NvU32 *pSize) {
279 return pGpuResource->__nvoc_vtable->__vaspaceapiGetRegBaseOffsetAndSize__(pGpuResource, pGpu, pOffset, pSize);
280 }
281
vaspaceapiGetMapAddrSpace_DISPATCH(struct VaSpaceApi * pGpuResource,struct CALL_CONTEXT * pCallContext,NvU32 mapFlags,NV_ADDRESS_SPACE * pAddrSpace)282 static inline NV_STATUS vaspaceapiGetMapAddrSpace_DISPATCH(struct VaSpaceApi *pGpuResource, struct CALL_CONTEXT *pCallContext, NvU32 mapFlags, NV_ADDRESS_SPACE *pAddrSpace) {
283 return pGpuResource->__nvoc_vtable->__vaspaceapiGetMapAddrSpace__(pGpuResource, pCallContext, mapFlags, pAddrSpace);
284 }
285
vaspaceapiInternalControlForward_DISPATCH(struct VaSpaceApi * pGpuResource,NvU32 command,void * pParams,NvU32 size)286 static inline NV_STATUS vaspaceapiInternalControlForward_DISPATCH(struct VaSpaceApi *pGpuResource, NvU32 command, void *pParams, NvU32 size) {
287 return pGpuResource->__nvoc_vtable->__vaspaceapiInternalControlForward__(pGpuResource, command, pParams, size);
288 }
289
vaspaceapiGetInternalObjectHandle_DISPATCH(struct VaSpaceApi * pGpuResource)290 static inline NvHandle vaspaceapiGetInternalObjectHandle_DISPATCH(struct VaSpaceApi *pGpuResource) {
291 return pGpuResource->__nvoc_vtable->__vaspaceapiGetInternalObjectHandle__(pGpuResource);
292 }
293
vaspaceapiAccessCallback_DISPATCH(struct VaSpaceApi * pResource,struct RsClient * pInvokingClient,void * pAllocParams,RsAccessRight accessRight)294 static inline NvBool vaspaceapiAccessCallback_DISPATCH(struct VaSpaceApi *pResource, struct RsClient *pInvokingClient, void *pAllocParams, RsAccessRight accessRight) {
295 return pResource->__nvoc_vtable->__vaspaceapiAccessCallback__(pResource, pInvokingClient, pAllocParams, accessRight);
296 }
297
vaspaceapiGetMemInterMapParams_DISPATCH(struct VaSpaceApi * pRmResource,RMRES_MEM_INTER_MAP_PARAMS * pParams)298 static inline NV_STATUS vaspaceapiGetMemInterMapParams_DISPATCH(struct VaSpaceApi *pRmResource, RMRES_MEM_INTER_MAP_PARAMS *pParams) {
299 return pRmResource->__nvoc_vtable->__vaspaceapiGetMemInterMapParams__(pRmResource, pParams);
300 }
301
vaspaceapiCheckMemInterUnmap_DISPATCH(struct VaSpaceApi * pRmResource,NvBool bSubdeviceHandleProvided)302 static inline NV_STATUS vaspaceapiCheckMemInterUnmap_DISPATCH(struct VaSpaceApi *pRmResource, NvBool bSubdeviceHandleProvided) {
303 return pRmResource->__nvoc_vtable->__vaspaceapiCheckMemInterUnmap__(pRmResource, bSubdeviceHandleProvided);
304 }
305
vaspaceapiGetMemoryMappingDescriptor_DISPATCH(struct VaSpaceApi * pRmResource,struct MEMORY_DESCRIPTOR ** ppMemDesc)306 static inline NV_STATUS vaspaceapiGetMemoryMappingDescriptor_DISPATCH(struct VaSpaceApi *pRmResource, struct MEMORY_DESCRIPTOR **ppMemDesc) {
307 return pRmResource->__nvoc_vtable->__vaspaceapiGetMemoryMappingDescriptor__(pRmResource, ppMemDesc);
308 }
309
vaspaceapiControlSerialization_Prologue_DISPATCH(struct VaSpaceApi * pResource,struct CALL_CONTEXT * pCallContext,struct RS_RES_CONTROL_PARAMS_INTERNAL * pParams)310 static inline NV_STATUS vaspaceapiControlSerialization_Prologue_DISPATCH(struct VaSpaceApi *pResource, struct CALL_CONTEXT *pCallContext, struct RS_RES_CONTROL_PARAMS_INTERNAL *pParams) {
311 return pResource->__nvoc_vtable->__vaspaceapiControlSerialization_Prologue__(pResource, pCallContext, pParams);
312 }
313
vaspaceapiControlSerialization_Epilogue_DISPATCH(struct VaSpaceApi * pResource,struct CALL_CONTEXT * pCallContext,struct RS_RES_CONTROL_PARAMS_INTERNAL * pParams)314 static inline void vaspaceapiControlSerialization_Epilogue_DISPATCH(struct VaSpaceApi *pResource, struct CALL_CONTEXT *pCallContext, struct RS_RES_CONTROL_PARAMS_INTERNAL *pParams) {
315 pResource->__nvoc_vtable->__vaspaceapiControlSerialization_Epilogue__(pResource, pCallContext, pParams);
316 }
317
vaspaceapiControl_Prologue_DISPATCH(struct VaSpaceApi * pResource,struct CALL_CONTEXT * pCallContext,struct RS_RES_CONTROL_PARAMS_INTERNAL * pParams)318 static inline NV_STATUS vaspaceapiControl_Prologue_DISPATCH(struct VaSpaceApi *pResource, struct CALL_CONTEXT *pCallContext, struct RS_RES_CONTROL_PARAMS_INTERNAL *pParams) {
319 return pResource->__nvoc_vtable->__vaspaceapiControl_Prologue__(pResource, pCallContext, pParams);
320 }
321
vaspaceapiControl_Epilogue_DISPATCH(struct VaSpaceApi * pResource,struct CALL_CONTEXT * pCallContext,struct RS_RES_CONTROL_PARAMS_INTERNAL * pParams)322 static inline void vaspaceapiControl_Epilogue_DISPATCH(struct VaSpaceApi *pResource, struct CALL_CONTEXT *pCallContext, struct RS_RES_CONTROL_PARAMS_INTERNAL *pParams) {
323 pResource->__nvoc_vtable->__vaspaceapiControl_Epilogue__(pResource, pCallContext, pParams);
324 }
325
vaspaceapiIsDuplicate_DISPATCH(struct VaSpaceApi * pResource,NvHandle hMemory,NvBool * pDuplicate)326 static inline NV_STATUS vaspaceapiIsDuplicate_DISPATCH(struct VaSpaceApi *pResource, NvHandle hMemory, NvBool *pDuplicate) {
327 return pResource->__nvoc_vtable->__vaspaceapiIsDuplicate__(pResource, hMemory, pDuplicate);
328 }
329
vaspaceapiPreDestruct_DISPATCH(struct VaSpaceApi * pResource)330 static inline void vaspaceapiPreDestruct_DISPATCH(struct VaSpaceApi *pResource) {
331 pResource->__nvoc_vtable->__vaspaceapiPreDestruct__(pResource);
332 }
333
vaspaceapiControlFilter_DISPATCH(struct VaSpaceApi * pResource,struct CALL_CONTEXT * pCallContext,struct RS_RES_CONTROL_PARAMS_INTERNAL * pParams)334 static inline NV_STATUS vaspaceapiControlFilter_DISPATCH(struct VaSpaceApi *pResource, struct CALL_CONTEXT *pCallContext, struct RS_RES_CONTROL_PARAMS_INTERNAL *pParams) {
335 return pResource->__nvoc_vtable->__vaspaceapiControlFilter__(pResource, pCallContext, pParams);
336 }
337
vaspaceapiIsPartialUnmapSupported_DISPATCH(struct VaSpaceApi * pResource)338 static inline NvBool vaspaceapiIsPartialUnmapSupported_DISPATCH(struct VaSpaceApi *pResource) {
339 return pResource->__nvoc_vtable->__vaspaceapiIsPartialUnmapSupported__(pResource);
340 }
341
vaspaceapiMapTo_DISPATCH(struct VaSpaceApi * pResource,RS_RES_MAP_TO_PARAMS * pParams)342 static inline NV_STATUS vaspaceapiMapTo_DISPATCH(struct VaSpaceApi *pResource, RS_RES_MAP_TO_PARAMS *pParams) {
343 return pResource->__nvoc_vtable->__vaspaceapiMapTo__(pResource, pParams);
344 }
345
vaspaceapiUnmapFrom_DISPATCH(struct VaSpaceApi * pResource,RS_RES_UNMAP_FROM_PARAMS * pParams)346 static inline NV_STATUS vaspaceapiUnmapFrom_DISPATCH(struct VaSpaceApi *pResource, RS_RES_UNMAP_FROM_PARAMS *pParams) {
347 return pResource->__nvoc_vtable->__vaspaceapiUnmapFrom__(pResource, pParams);
348 }
349
vaspaceapiGetRefCount_DISPATCH(struct VaSpaceApi * pResource)350 static inline NvU32 vaspaceapiGetRefCount_DISPATCH(struct VaSpaceApi *pResource) {
351 return pResource->__nvoc_vtable->__vaspaceapiGetRefCount__(pResource);
352 }
353
vaspaceapiAddAdditionalDependants_DISPATCH(struct RsClient * pClient,struct VaSpaceApi * pResource,RsResourceRef * pReference)354 static inline void vaspaceapiAddAdditionalDependants_DISPATCH(struct RsClient *pClient, struct VaSpaceApi *pResource, RsResourceRef *pReference) {
355 pResource->__nvoc_vtable->__vaspaceapiAddAdditionalDependants__(pClient, pResource, pReference);
356 }
357
358 NvBool vaspaceapiCanCopy_IMPL(struct VaSpaceApi *pResource);
359
360 NV_STATUS vaspaceapiCtrlCmdVaspaceGetGmmuFormat_IMPL(struct VaSpaceApi *pVaspaceApi, NV90F1_CTRL_VASPACE_GET_GMMU_FORMAT_PARAMS *pGmmuFormatParams);
361
362 NV_STATUS vaspaceapiCtrlCmdVaspaceGetPageLevelInfo_IMPL(struct VaSpaceApi *pVaspaceApi, NV90F1_CTRL_VASPACE_GET_PAGE_LEVEL_INFO_PARAMS *pPageLevelInfoParams);
363
364 NV_STATUS vaspaceapiCtrlCmdVaspaceReserveEntries_IMPL(struct VaSpaceApi *pVaspaceApi, NV90F1_CTRL_VASPACE_RESERVE_ENTRIES_PARAMS *pReserveEntriesParams);
365
366 NV_STATUS vaspaceapiCtrlCmdVaspaceReleaseEntries_IMPL(struct VaSpaceApi *pVaspaceApi, NV90F1_CTRL_VASPACE_RELEASE_ENTRIES_PARAMS *pReleaseEntriesParams);
367
368 NV_STATUS vaspaceapiCtrlCmdVaspaceCopyServerReservedPdes_IMPL(struct VaSpaceApi *pVaspaceApi, NV90F1_CTRL_VASPACE_COPY_SERVER_RESERVED_PDES_PARAMS *pCopyServerReservedPdesParams);
369
370 NV_STATUS vaspaceapiCtrlCmdVaspaceGetHostRmManagedSize_IMPL(struct VaSpaceApi *pVaspaceApi, NV90F1_CTRL_VASPACE_GET_HOST_RM_MANAGED_SIZE_PARAMS *pVaspaceGetHostRmManagedSizeParams);
371
372 NV_STATUS vaspaceapiConstruct_IMPL(struct VaSpaceApi *arg_pResource, struct CALL_CONTEXT *arg_pCallContext, struct RS_RES_ALLOC_PARAMS_INTERNAL *arg_pParams);
373
374 #define __nvoc_vaspaceapiConstruct(arg_pResource, arg_pCallContext, arg_pParams) vaspaceapiConstruct_IMPL(arg_pResource, arg_pCallContext, arg_pParams)
375 NV_STATUS vaspaceapiCopyConstruct_IMPL(struct VaSpaceApi *pResource, struct CALL_CONTEXT *pCallContext, struct RS_RES_ALLOC_PARAMS_INTERNAL *pParams);
376
377 #ifdef __nvoc_vaspace_api_h_disabled
vaspaceapiCopyConstruct(struct VaSpaceApi * pResource,struct CALL_CONTEXT * pCallContext,struct RS_RES_ALLOC_PARAMS_INTERNAL * pParams)378 static inline NV_STATUS vaspaceapiCopyConstruct(struct VaSpaceApi *pResource, struct CALL_CONTEXT *pCallContext, struct RS_RES_ALLOC_PARAMS_INTERNAL *pParams) {
379 NV_ASSERT_FAILED_PRECOMP("VaSpaceApi was disabled!");
380 return NV_ERR_NOT_SUPPORTED;
381 }
382 #else //__nvoc_vaspace_api_h_disabled
383 #define vaspaceapiCopyConstruct(pResource, pCallContext, pParams) vaspaceapiCopyConstruct_IMPL(pResource, pCallContext, pParams)
384 #endif //__nvoc_vaspace_api_h_disabled
385
386 void vaspaceapiDestruct_IMPL(struct VaSpaceApi *pResource);
387
388 #define __nvoc_vaspaceapiDestruct(pResource) vaspaceapiDestruct_IMPL(pResource)
389 #undef PRIVATE_FIELD
390
391
392 #endif // VASPACE_API_H
393
394 #ifdef __cplusplus
395 } // extern "C"
396 #endif
397
398 #endif // _G_VASPACE_API_NVOC_H_
399