1 #ifndef _G_GPU_RESOURCE_NVOC_H_
2 #define _G_GPU_RESOURCE_NVOC_H_
3 #include "nvoc/runtime.h"
4 
5 #ifdef __cplusplus
6 extern "C" {
7 #endif
8 
9 /*
10  * SPDX-FileCopyrightText: Copyright (c) 2016-2021 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 #include "g_gpu_resource_nvoc.h"
32 
33 #ifndef _GPURESOURCE_H_
34 #define _GPURESOURCE_H_
35 
36 #include "core/core.h"
37 #include "gpu/mem_mgr/mem_desc.h"
38 
39 #include "rmapi/resource.h"
40 
41 struct OBJGPU;
42 
43 #ifndef __NVOC_CLASS_OBJGPU_TYPEDEF__
44 #define __NVOC_CLASS_OBJGPU_TYPEDEF__
45 typedef struct OBJGPU OBJGPU;
46 #endif /* __NVOC_CLASS_OBJGPU_TYPEDEF__ */
47 
48 #ifndef __nvoc_class_id_OBJGPU
49 #define __nvoc_class_id_OBJGPU 0x7ef3cb
50 #endif /* __nvoc_class_id_OBJGPU */
51 
52 
53 struct Device;
54 
55 #ifndef __NVOC_CLASS_Device_TYPEDEF__
56 #define __NVOC_CLASS_Device_TYPEDEF__
57 typedef struct Device Device;
58 #endif /* __NVOC_CLASS_Device_TYPEDEF__ */
59 
60 #ifndef __nvoc_class_id_Device
61 #define __nvoc_class_id_Device 0xe0ac20
62 #endif /* __nvoc_class_id_Device */
63 
64 
65 struct Subdevice;
66 
67 #ifndef __NVOC_CLASS_Subdevice_TYPEDEF__
68 #define __NVOC_CLASS_Subdevice_TYPEDEF__
69 typedef struct Subdevice Subdevice;
70 #endif /* __NVOC_CLASS_Subdevice_TYPEDEF__ */
71 
72 #ifndef __nvoc_class_id_Subdevice
73 #define __nvoc_class_id_Subdevice 0x4b01b3
74 #endif /* __nvoc_class_id_Subdevice */
75 
76 
77 
78 #define GPU_RES_GET_GPU(pRes) staticCastNoPtrCheck((pRes), GpuResource)->pGpu
79 #define GPU_RES_GET_GPUGRP(pRes) staticCastNoPtrCheck((pRes), GpuResource)->pGpuGrp
80 #define GPU_RES_GET_DEVICE(pRes) staticCastNoPtrCheck((pRes), GpuResource)->pDevice
81 #define GPU_RES_GET_SUBDEVICE(pRes) staticCastNoPtrCheck((pRes), GpuResource)->pSubdevice
82 
83 #define GPU_RES_SET_THREAD_BC_STATE(pRes) PORT_UNREFERENCED_VARIABLE(pRes)
84 
85 /*!
86  * Abstract base class for common CPU mapping operations
87  */
88 #ifdef NVOC_GPU_RESOURCE_H_PRIVATE_ACCESS_ALLOWED
89 #define PRIVATE_FIELD(x) x
90 #else
91 #define PRIVATE_FIELD(x) NVOC_PRIVATE_FIELD(x)
92 #endif
93 struct GpuResource {
94     const struct NVOC_RTTI *__nvoc_rtti;
95     struct RmResource __nvoc_base_RmResource;
96     struct Object *__nvoc_pbase_Object;
97     struct RsResource *__nvoc_pbase_RsResource;
98     struct RmResourceCommon *__nvoc_pbase_RmResourceCommon;
99     struct RmResource *__nvoc_pbase_RmResource;
100     struct GpuResource *__nvoc_pbase_GpuResource;
101     NV_STATUS (*__gpuresControl__)(struct GpuResource *, struct CALL_CONTEXT *, struct RS_RES_CONTROL_PARAMS_INTERNAL *);
102     NV_STATUS (*__gpuresMap__)(struct GpuResource *, struct CALL_CONTEXT *, struct RS_CPU_MAP_PARAMS *, struct RsCpuMapping *);
103     NV_STATUS (*__gpuresUnmap__)(struct GpuResource *, struct CALL_CONTEXT *, struct RsCpuMapping *);
104     NvBool (*__gpuresShareCallback__)(struct GpuResource *, struct RsClient *, struct RsResourceRef *, RS_SHARE_POLICY *);
105     NV_STATUS (*__gpuresGetRegBaseOffsetAndSize__)(struct GpuResource *, struct OBJGPU *, NvU32 *, NvU32 *);
106     NV_STATUS (*__gpuresGetMapAddrSpace__)(struct GpuResource *, struct CALL_CONTEXT *, NvU32, NV_ADDRESS_SPACE *);
107     NV_STATUS (*__gpuresInternalControlForward__)(struct GpuResource *, NvU32, void *, NvU32);
108     NvHandle (*__gpuresGetInternalObjectHandle__)(struct GpuResource *);
109     NV_STATUS (*__gpuresCheckMemInterUnmap__)(struct GpuResource *, NvBool);
110     NV_STATUS (*__gpuresGetMemInterMapParams__)(struct GpuResource *, RMRES_MEM_INTER_MAP_PARAMS *);
111     NV_STATUS (*__gpuresGetMemoryMappingDescriptor__)(struct GpuResource *, struct MEMORY_DESCRIPTOR **);
112     NvU32 (*__gpuresGetRefCount__)(struct GpuResource *);
113     NV_STATUS (*__gpuresControlFilter__)(struct GpuResource *, struct CALL_CONTEXT *, struct RS_RES_CONTROL_PARAMS_INTERNAL *);
114     void (*__gpuresAddAdditionalDependants__)(struct RsClient *, struct GpuResource *, RsResourceRef *);
115     NV_STATUS (*__gpuresUnmapFrom__)(struct GpuResource *, RS_RES_UNMAP_FROM_PARAMS *);
116     NV_STATUS (*__gpuresControlSerialization_Prologue__)(struct GpuResource *, struct CALL_CONTEXT *, struct RS_RES_CONTROL_PARAMS_INTERNAL *);
117     NV_STATUS (*__gpuresControl_Prologue__)(struct GpuResource *, struct CALL_CONTEXT *, struct RS_RES_CONTROL_PARAMS_INTERNAL *);
118     NvBool (*__gpuresCanCopy__)(struct GpuResource *);
119     void (*__gpuresPreDestruct__)(struct GpuResource *);
120     NV_STATUS (*__gpuresMapTo__)(struct GpuResource *, RS_RES_MAP_TO_PARAMS *);
121     NV_STATUS (*__gpuresIsDuplicate__)(struct GpuResource *, NvHandle, NvBool *);
122     void (*__gpuresControlSerialization_Epilogue__)(struct GpuResource *, struct CALL_CONTEXT *, struct RS_RES_CONTROL_PARAMS_INTERNAL *);
123     void (*__gpuresControl_Epilogue__)(struct GpuResource *, struct CALL_CONTEXT *, struct RS_RES_CONTROL_PARAMS_INTERNAL *);
124     NV_STATUS (*__gpuresControlLookup__)(struct GpuResource *, struct RS_RES_CONTROL_PARAMS_INTERNAL *, const struct NVOC_EXPORTED_METHOD_DEF **);
125     NvBool (*__gpuresAccessCallback__)(struct GpuResource *, struct RsClient *, void *, RsAccessRight);
126     struct OBJGPUGRP *pGpuGrp;
127     struct OBJGPU *pGpu;
128     struct Device *pDevice;
129     struct Subdevice *pSubdevice;
130     NvBool bBcResource;
131 };
132 
133 #ifndef __NVOC_CLASS_GpuResource_TYPEDEF__
134 #define __NVOC_CLASS_GpuResource_TYPEDEF__
135 typedef struct GpuResource GpuResource;
136 #endif /* __NVOC_CLASS_GpuResource_TYPEDEF__ */
137 
138 #ifndef __nvoc_class_id_GpuResource
139 #define __nvoc_class_id_GpuResource 0x5d5d9f
140 #endif /* __nvoc_class_id_GpuResource */
141 
142 extern const struct NVOC_CLASS_DEF __nvoc_class_def_GpuResource;
143 
144 #define __staticCast_GpuResource(pThis) \
145     ((pThis)->__nvoc_pbase_GpuResource)
146 
147 #ifdef __nvoc_gpu_resource_h_disabled
148 #define __dynamicCast_GpuResource(pThis) ((GpuResource*)NULL)
149 #else //__nvoc_gpu_resource_h_disabled
150 #define __dynamicCast_GpuResource(pThis) \
151     ((GpuResource*)__nvoc_dynamicCast(staticCast((pThis), Dynamic), classInfo(GpuResource)))
152 #endif //__nvoc_gpu_resource_h_disabled
153 
154 
155 NV_STATUS __nvoc_objCreateDynamic_GpuResource(GpuResource**, Dynamic*, NvU32, va_list);
156 
157 NV_STATUS __nvoc_objCreate_GpuResource(GpuResource**, Dynamic*, NvU32, struct CALL_CONTEXT * arg_pCallContext, struct RS_RES_ALLOC_PARAMS_INTERNAL * arg_pParams);
158 #define __objCreate_GpuResource(ppNewObj, pParent, createFlags, arg_pCallContext, arg_pParams) \
159     __nvoc_objCreate_GpuResource((ppNewObj), staticCast((pParent), Dynamic), (createFlags), arg_pCallContext, arg_pParams)
160 
161 #define gpuresControl(pGpuResource, pCallContext, pParams) gpuresControl_DISPATCH(pGpuResource, pCallContext, pParams)
162 #define gpuresMap(pGpuResource, pCallContext, pParams, pCpuMapping) gpuresMap_DISPATCH(pGpuResource, pCallContext, pParams, pCpuMapping)
163 #define gpuresUnmap(pGpuResource, pCallContext, pCpuMapping) gpuresUnmap_DISPATCH(pGpuResource, pCallContext, pCpuMapping)
164 #define gpuresShareCallback(pGpuResource, pInvokingClient, pParentRef, pSharePolicy) gpuresShareCallback_DISPATCH(pGpuResource, pInvokingClient, pParentRef, pSharePolicy)
165 #define gpuresGetRegBaseOffsetAndSize(pGpuResource, pGpu, pOffset, pSize) gpuresGetRegBaseOffsetAndSize_DISPATCH(pGpuResource, pGpu, pOffset, pSize)
166 #define gpuresGetMapAddrSpace(pGpuResource, pCallContext, mapFlags, pAddrSpace) gpuresGetMapAddrSpace_DISPATCH(pGpuResource, pCallContext, mapFlags, pAddrSpace)
167 #define gpuresInternalControlForward(pGpuResource, command, pParams, size) gpuresInternalControlForward_DISPATCH(pGpuResource, command, pParams, size)
168 #define gpuresGetInternalObjectHandle(pGpuResource) gpuresGetInternalObjectHandle_DISPATCH(pGpuResource)
169 #define gpuresCheckMemInterUnmap(pRmResource, bSubdeviceHandleProvided) gpuresCheckMemInterUnmap_DISPATCH(pRmResource, bSubdeviceHandleProvided)
170 #define gpuresGetMemInterMapParams(pRmResource, pParams) gpuresGetMemInterMapParams_DISPATCH(pRmResource, pParams)
171 #define gpuresGetMemoryMappingDescriptor(pRmResource, ppMemDesc) gpuresGetMemoryMappingDescriptor_DISPATCH(pRmResource, ppMemDesc)
172 #define gpuresGetRefCount(pResource) gpuresGetRefCount_DISPATCH(pResource)
173 #define gpuresControlFilter(pResource, pCallContext, pParams) gpuresControlFilter_DISPATCH(pResource, pCallContext, pParams)
174 #define gpuresAddAdditionalDependants(pClient, pResource, pReference) gpuresAddAdditionalDependants_DISPATCH(pClient, pResource, pReference)
175 #define gpuresUnmapFrom(pResource, pParams) gpuresUnmapFrom_DISPATCH(pResource, pParams)
176 #define gpuresControlSerialization_Prologue(pResource, pCallContext, pParams) gpuresControlSerialization_Prologue_DISPATCH(pResource, pCallContext, pParams)
177 #define gpuresControl_Prologue(pResource, pCallContext, pParams) gpuresControl_Prologue_DISPATCH(pResource, pCallContext, pParams)
178 #define gpuresCanCopy(pResource) gpuresCanCopy_DISPATCH(pResource)
179 #define gpuresPreDestruct(pResource) gpuresPreDestruct_DISPATCH(pResource)
180 #define gpuresMapTo(pResource, pParams) gpuresMapTo_DISPATCH(pResource, pParams)
181 #define gpuresIsDuplicate(pResource, hMemory, pDuplicate) gpuresIsDuplicate_DISPATCH(pResource, hMemory, pDuplicate)
182 #define gpuresControlSerialization_Epilogue(pResource, pCallContext, pParams) gpuresControlSerialization_Epilogue_DISPATCH(pResource, pCallContext, pParams)
183 #define gpuresControl_Epilogue(pResource, pCallContext, pParams) gpuresControl_Epilogue_DISPATCH(pResource, pCallContext, pParams)
184 #define gpuresControlLookup(pResource, pParams, ppEntry) gpuresControlLookup_DISPATCH(pResource, pParams, ppEntry)
185 #define gpuresAccessCallback(pResource, pInvokingClient, pAllocParams, accessRight) gpuresAccessCallback_DISPATCH(pResource, pInvokingClient, pAllocParams, accessRight)
186 NV_STATUS gpuresControl_IMPL(struct GpuResource *pGpuResource, struct CALL_CONTEXT *pCallContext, struct RS_RES_CONTROL_PARAMS_INTERNAL *pParams);
187 
188 static inline NV_STATUS gpuresControl_DISPATCH(struct GpuResource *pGpuResource, struct CALL_CONTEXT *pCallContext, struct RS_RES_CONTROL_PARAMS_INTERNAL *pParams) {
189     return pGpuResource->__gpuresControl__(pGpuResource, pCallContext, pParams);
190 }
191 
192 NV_STATUS gpuresMap_IMPL(struct GpuResource *pGpuResource, struct CALL_CONTEXT *pCallContext, struct RS_CPU_MAP_PARAMS *pParams, struct RsCpuMapping *pCpuMapping);
193 
194 static inline NV_STATUS gpuresMap_DISPATCH(struct GpuResource *pGpuResource, struct CALL_CONTEXT *pCallContext, struct RS_CPU_MAP_PARAMS *pParams, struct RsCpuMapping *pCpuMapping) {
195     return pGpuResource->__gpuresMap__(pGpuResource, pCallContext, pParams, pCpuMapping);
196 }
197 
198 NV_STATUS gpuresUnmap_IMPL(struct GpuResource *pGpuResource, struct CALL_CONTEXT *pCallContext, struct RsCpuMapping *pCpuMapping);
199 
200 static inline NV_STATUS gpuresUnmap_DISPATCH(struct GpuResource *pGpuResource, struct CALL_CONTEXT *pCallContext, struct RsCpuMapping *pCpuMapping) {
201     return pGpuResource->__gpuresUnmap__(pGpuResource, pCallContext, pCpuMapping);
202 }
203 
204 NvBool gpuresShareCallback_IMPL(struct GpuResource *pGpuResource, struct RsClient *pInvokingClient, struct RsResourceRef *pParentRef, RS_SHARE_POLICY *pSharePolicy);
205 
206 static inline NvBool gpuresShareCallback_DISPATCH(struct GpuResource *pGpuResource, struct RsClient *pInvokingClient, struct RsResourceRef *pParentRef, RS_SHARE_POLICY *pSharePolicy) {
207     return pGpuResource->__gpuresShareCallback__(pGpuResource, pInvokingClient, pParentRef, pSharePolicy);
208 }
209 
210 NV_STATUS gpuresGetRegBaseOffsetAndSize_IMPL(struct GpuResource *pGpuResource, struct OBJGPU *pGpu, NvU32 *pOffset, NvU32 *pSize);
211 
212 static inline NV_STATUS gpuresGetRegBaseOffsetAndSize_DISPATCH(struct GpuResource *pGpuResource, struct OBJGPU *pGpu, NvU32 *pOffset, NvU32 *pSize) {
213     return pGpuResource->__gpuresGetRegBaseOffsetAndSize__(pGpuResource, pGpu, pOffset, pSize);
214 }
215 
216 NV_STATUS gpuresGetMapAddrSpace_IMPL(struct GpuResource *pGpuResource, struct CALL_CONTEXT *pCallContext, NvU32 mapFlags, NV_ADDRESS_SPACE *pAddrSpace);
217 
218 static inline NV_STATUS gpuresGetMapAddrSpace_DISPATCH(struct GpuResource *pGpuResource, struct CALL_CONTEXT *pCallContext, NvU32 mapFlags, NV_ADDRESS_SPACE *pAddrSpace) {
219     return pGpuResource->__gpuresGetMapAddrSpace__(pGpuResource, pCallContext, mapFlags, pAddrSpace);
220 }
221 
222 NV_STATUS gpuresInternalControlForward_IMPL(struct GpuResource *pGpuResource, NvU32 command, void *pParams, NvU32 size);
223 
224 static inline NV_STATUS gpuresInternalControlForward_DISPATCH(struct GpuResource *pGpuResource, NvU32 command, void *pParams, NvU32 size) {
225     return pGpuResource->__gpuresInternalControlForward__(pGpuResource, command, pParams, size);
226 }
227 
228 NvHandle gpuresGetInternalObjectHandle_IMPL(struct GpuResource *pGpuResource);
229 
230 static inline NvHandle gpuresGetInternalObjectHandle_DISPATCH(struct GpuResource *pGpuResource) {
231     return pGpuResource->__gpuresGetInternalObjectHandle__(pGpuResource);
232 }
233 
234 static inline NV_STATUS gpuresCheckMemInterUnmap_DISPATCH(struct GpuResource *pRmResource, NvBool bSubdeviceHandleProvided) {
235     return pRmResource->__gpuresCheckMemInterUnmap__(pRmResource, bSubdeviceHandleProvided);
236 }
237 
238 static inline NV_STATUS gpuresGetMemInterMapParams_DISPATCH(struct GpuResource *pRmResource, RMRES_MEM_INTER_MAP_PARAMS *pParams) {
239     return pRmResource->__gpuresGetMemInterMapParams__(pRmResource, pParams);
240 }
241 
242 static inline NV_STATUS gpuresGetMemoryMappingDescriptor_DISPATCH(struct GpuResource *pRmResource, struct MEMORY_DESCRIPTOR **ppMemDesc) {
243     return pRmResource->__gpuresGetMemoryMappingDescriptor__(pRmResource, ppMemDesc);
244 }
245 
246 static inline NvU32 gpuresGetRefCount_DISPATCH(struct GpuResource *pResource) {
247     return pResource->__gpuresGetRefCount__(pResource);
248 }
249 
250 static inline NV_STATUS gpuresControlFilter_DISPATCH(struct GpuResource *pResource, struct CALL_CONTEXT *pCallContext, struct RS_RES_CONTROL_PARAMS_INTERNAL *pParams) {
251     return pResource->__gpuresControlFilter__(pResource, pCallContext, pParams);
252 }
253 
254 static inline void gpuresAddAdditionalDependants_DISPATCH(struct RsClient *pClient, struct GpuResource *pResource, RsResourceRef *pReference) {
255     pResource->__gpuresAddAdditionalDependants__(pClient, pResource, pReference);
256 }
257 
258 static inline NV_STATUS gpuresUnmapFrom_DISPATCH(struct GpuResource *pResource, RS_RES_UNMAP_FROM_PARAMS *pParams) {
259     return pResource->__gpuresUnmapFrom__(pResource, pParams);
260 }
261 
262 static inline NV_STATUS gpuresControlSerialization_Prologue_DISPATCH(struct GpuResource *pResource, struct CALL_CONTEXT *pCallContext, struct RS_RES_CONTROL_PARAMS_INTERNAL *pParams) {
263     return pResource->__gpuresControlSerialization_Prologue__(pResource, pCallContext, pParams);
264 }
265 
266 static inline NV_STATUS gpuresControl_Prologue_DISPATCH(struct GpuResource *pResource, struct CALL_CONTEXT *pCallContext, struct RS_RES_CONTROL_PARAMS_INTERNAL *pParams) {
267     return pResource->__gpuresControl_Prologue__(pResource, pCallContext, pParams);
268 }
269 
270 static inline NvBool gpuresCanCopy_DISPATCH(struct GpuResource *pResource) {
271     return pResource->__gpuresCanCopy__(pResource);
272 }
273 
274 static inline void gpuresPreDestruct_DISPATCH(struct GpuResource *pResource) {
275     pResource->__gpuresPreDestruct__(pResource);
276 }
277 
278 static inline NV_STATUS gpuresMapTo_DISPATCH(struct GpuResource *pResource, RS_RES_MAP_TO_PARAMS *pParams) {
279     return pResource->__gpuresMapTo__(pResource, pParams);
280 }
281 
282 static inline NV_STATUS gpuresIsDuplicate_DISPATCH(struct GpuResource *pResource, NvHandle hMemory, NvBool *pDuplicate) {
283     return pResource->__gpuresIsDuplicate__(pResource, hMemory, pDuplicate);
284 }
285 
286 static inline void gpuresControlSerialization_Epilogue_DISPATCH(struct GpuResource *pResource, struct CALL_CONTEXT *pCallContext, struct RS_RES_CONTROL_PARAMS_INTERNAL *pParams) {
287     pResource->__gpuresControlSerialization_Epilogue__(pResource, pCallContext, pParams);
288 }
289 
290 static inline void gpuresControl_Epilogue_DISPATCH(struct GpuResource *pResource, struct CALL_CONTEXT *pCallContext, struct RS_RES_CONTROL_PARAMS_INTERNAL *pParams) {
291     pResource->__gpuresControl_Epilogue__(pResource, pCallContext, pParams);
292 }
293 
294 static inline NV_STATUS gpuresControlLookup_DISPATCH(struct GpuResource *pResource, struct RS_RES_CONTROL_PARAMS_INTERNAL *pParams, const struct NVOC_EXPORTED_METHOD_DEF **ppEntry) {
295     return pResource->__gpuresControlLookup__(pResource, pParams, ppEntry);
296 }
297 
298 static inline NvBool gpuresAccessCallback_DISPATCH(struct GpuResource *pResource, struct RsClient *pInvokingClient, void *pAllocParams, RsAccessRight accessRight) {
299     return pResource->__gpuresAccessCallback__(pResource, pInvokingClient, pAllocParams, accessRight);
300 }
301 
302 NV_STATUS gpuresConstruct_IMPL(struct GpuResource *arg_pGpuResource, struct CALL_CONTEXT *arg_pCallContext, struct RS_RES_ALLOC_PARAMS_INTERNAL *arg_pParams);
303 
304 #define __nvoc_gpuresConstruct(arg_pGpuResource, arg_pCallContext, arg_pParams) gpuresConstruct_IMPL(arg_pGpuResource, arg_pCallContext, arg_pParams)
305 NV_STATUS gpuresCopyConstruct_IMPL(struct GpuResource *pGpuResource, struct CALL_CONTEXT *pCallContext, struct RS_RES_ALLOC_PARAMS_INTERNAL *pParams);
306 
307 #ifdef __nvoc_gpu_resource_h_disabled
308 static inline NV_STATUS gpuresCopyConstruct(struct GpuResource *pGpuResource, struct CALL_CONTEXT *pCallContext, struct RS_RES_ALLOC_PARAMS_INTERNAL *pParams) {
309     NV_ASSERT_FAILED_PRECOMP("GpuResource was disabled!");
310     return NV_ERR_NOT_SUPPORTED;
311 }
312 #else //__nvoc_gpu_resource_h_disabled
313 #define gpuresCopyConstruct(pGpuResource, pCallContext, pParams) gpuresCopyConstruct_IMPL(pGpuResource, pCallContext, pParams)
314 #endif //__nvoc_gpu_resource_h_disabled
315 
316 void gpuresSetGpu_IMPL(struct GpuResource *pGpuResource, struct OBJGPU *pGpu, NvBool bBcResource);
317 
318 #ifdef __nvoc_gpu_resource_h_disabled
319 static inline void gpuresSetGpu(struct GpuResource *pGpuResource, struct OBJGPU *pGpu, NvBool bBcResource) {
320     NV_ASSERT_FAILED_PRECOMP("GpuResource was disabled!");
321 }
322 #else //__nvoc_gpu_resource_h_disabled
323 #define gpuresSetGpu(pGpuResource, pGpu, bBcResource) gpuresSetGpu_IMPL(pGpuResource, pGpu, bBcResource)
324 #endif //__nvoc_gpu_resource_h_disabled
325 
326 void gpuresControlSetup_IMPL(struct RS_RES_CONTROL_PARAMS_INTERNAL *pParams, struct GpuResource *pGpuResource);
327 
328 #ifdef __nvoc_gpu_resource_h_disabled
329 static inline void gpuresControlSetup(struct RS_RES_CONTROL_PARAMS_INTERNAL *pParams, struct GpuResource *pGpuResource) {
330     NV_ASSERT_FAILED_PRECOMP("GpuResource was disabled!");
331 }
332 #else //__nvoc_gpu_resource_h_disabled
333 #define gpuresControlSetup(pParams, pGpuResource) gpuresControlSetup_IMPL(pParams, pGpuResource)
334 #endif //__nvoc_gpu_resource_h_disabled
335 
336 NV_STATUS gpuresGetByHandle_IMPL(struct RsClient *pClient, NvHandle hResource, struct GpuResource **ppGpuResource);
337 
338 #define gpuresGetByHandle(pClient, hResource, ppGpuResource) gpuresGetByHandle_IMPL(pClient, hResource, ppGpuResource)
339 NV_STATUS gpuresGetByDeviceOrSubdeviceHandle_IMPL(struct RsClient *pClient, NvHandle hResource, struct GpuResource **ppGpuResource);
340 
341 #define gpuresGetByDeviceOrSubdeviceHandle(pClient, hResource, ppGpuResource) gpuresGetByDeviceOrSubdeviceHandle_IMPL(pClient, hResource, ppGpuResource)
342 #undef PRIVATE_FIELD
343 
344 
345 #endif // _GPURESOURCE_H_
346 
347 #ifdef __cplusplus
348 } // extern "C"
349 #endif
350 
351 #endif // _G_GPU_RESOURCE_NVOC_H_
352