1 #define NVOC_KERNEL_CE_CONTEXT_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_kernel_ce_context_nvoc.h"
9
10 #ifdef DEBUG
11 char __nvoc_class_id_uniqueness_check_0x2d0ee9 = 1;
12 #endif
13
14 extern const struct NVOC_CLASS_DEF __nvoc_class_def_KernelCeContext;
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_GpuResource;
25
26 extern const struct NVOC_CLASS_DEF __nvoc_class_def_INotifier;
27
28 extern const struct NVOC_CLASS_DEF __nvoc_class_def_Notifier;
29
30 extern const struct NVOC_CLASS_DEF __nvoc_class_def_ChannelDescendant;
31
32 void __nvoc_init_KernelCeContext(KernelCeContext*, RmHalspecOwner* );
33 void __nvoc_init_funcTable_KernelCeContext(KernelCeContext*);
34 NV_STATUS __nvoc_ctor_KernelCeContext(KernelCeContext*, RmHalspecOwner* , CALL_CONTEXT * arg_pCallContext, struct RS_RES_ALLOC_PARAMS_INTERNAL * arg_pParams);
35 void __nvoc_init_dataField_KernelCeContext(KernelCeContext*);
36 void __nvoc_dtor_KernelCeContext(KernelCeContext*);
37 extern const struct NVOC_EXPORT_INFO __nvoc_export_info_KernelCeContext;
38
39 static const struct NVOC_RTTI __nvoc_rtti_KernelCeContext_KernelCeContext = {
40 /*pClassDef=*/ &__nvoc_class_def_KernelCeContext,
41 /*dtor=*/ (NVOC_DYNAMIC_DTOR) &__nvoc_dtor_KernelCeContext,
42 /*offset=*/ 0,
43 };
44
45 static const struct NVOC_RTTI __nvoc_rtti_KernelCeContext_Object = {
46 /*pClassDef=*/ &__nvoc_class_def_Object,
47 /*dtor=*/ &__nvoc_destructFromBase,
48 /*offset=*/ NV_OFFSETOF(KernelCeContext, __nvoc_base_ChannelDescendant.__nvoc_base_GpuResource.__nvoc_base_RmResource.__nvoc_base_RsResource.__nvoc_base_Object),
49 };
50
51 static const struct NVOC_RTTI __nvoc_rtti_KernelCeContext_RsResource = {
52 /*pClassDef=*/ &__nvoc_class_def_RsResource,
53 /*dtor=*/ &__nvoc_destructFromBase,
54 /*offset=*/ NV_OFFSETOF(KernelCeContext, __nvoc_base_ChannelDescendant.__nvoc_base_GpuResource.__nvoc_base_RmResource.__nvoc_base_RsResource),
55 };
56
57 static const struct NVOC_RTTI __nvoc_rtti_KernelCeContext_RmResourceCommon = {
58 /*pClassDef=*/ &__nvoc_class_def_RmResourceCommon,
59 /*dtor=*/ &__nvoc_destructFromBase,
60 /*offset=*/ NV_OFFSETOF(KernelCeContext, __nvoc_base_ChannelDescendant.__nvoc_base_GpuResource.__nvoc_base_RmResource.__nvoc_base_RmResourceCommon),
61 };
62
63 static const struct NVOC_RTTI __nvoc_rtti_KernelCeContext_RmResource = {
64 /*pClassDef=*/ &__nvoc_class_def_RmResource,
65 /*dtor=*/ &__nvoc_destructFromBase,
66 /*offset=*/ NV_OFFSETOF(KernelCeContext, __nvoc_base_ChannelDescendant.__nvoc_base_GpuResource.__nvoc_base_RmResource),
67 };
68
69 static const struct NVOC_RTTI __nvoc_rtti_KernelCeContext_GpuResource = {
70 /*pClassDef=*/ &__nvoc_class_def_GpuResource,
71 /*dtor=*/ &__nvoc_destructFromBase,
72 /*offset=*/ NV_OFFSETOF(KernelCeContext, __nvoc_base_ChannelDescendant.__nvoc_base_GpuResource),
73 };
74
75 static const struct NVOC_RTTI __nvoc_rtti_KernelCeContext_INotifier = {
76 /*pClassDef=*/ &__nvoc_class_def_INotifier,
77 /*dtor=*/ &__nvoc_destructFromBase,
78 /*offset=*/ NV_OFFSETOF(KernelCeContext, __nvoc_base_ChannelDescendant.__nvoc_base_Notifier.__nvoc_base_INotifier),
79 };
80
81 static const struct NVOC_RTTI __nvoc_rtti_KernelCeContext_Notifier = {
82 /*pClassDef=*/ &__nvoc_class_def_Notifier,
83 /*dtor=*/ &__nvoc_destructFromBase,
84 /*offset=*/ NV_OFFSETOF(KernelCeContext, __nvoc_base_ChannelDescendant.__nvoc_base_Notifier),
85 };
86
87 static const struct NVOC_RTTI __nvoc_rtti_KernelCeContext_ChannelDescendant = {
88 /*pClassDef=*/ &__nvoc_class_def_ChannelDescendant,
89 /*dtor=*/ &__nvoc_destructFromBase,
90 /*offset=*/ NV_OFFSETOF(KernelCeContext, __nvoc_base_ChannelDescendant),
91 };
92
93 static const struct NVOC_CASTINFO __nvoc_castinfo_KernelCeContext = {
94 /*numRelatives=*/ 9,
95 /*relatives=*/ {
96 &__nvoc_rtti_KernelCeContext_KernelCeContext,
97 &__nvoc_rtti_KernelCeContext_ChannelDescendant,
98 &__nvoc_rtti_KernelCeContext_Notifier,
99 &__nvoc_rtti_KernelCeContext_INotifier,
100 &__nvoc_rtti_KernelCeContext_GpuResource,
101 &__nvoc_rtti_KernelCeContext_RmResource,
102 &__nvoc_rtti_KernelCeContext_RmResourceCommon,
103 &__nvoc_rtti_KernelCeContext_RsResource,
104 &__nvoc_rtti_KernelCeContext_Object,
105 },
106 };
107
108 const struct NVOC_CLASS_DEF __nvoc_class_def_KernelCeContext =
109 {
110 /*classInfo=*/ {
111 /*size=*/ sizeof(KernelCeContext),
112 /*classId=*/ classId(KernelCeContext),
113 /*providerId=*/ &__nvoc_rtti_provider,
114 #if NV_PRINTF_STRINGS_ALLOWED
115 /*name=*/ "KernelCeContext",
116 #endif
117 },
118 /*objCreatefn=*/ (NVOC_DYNAMIC_OBJ_CREATE) &__nvoc_objCreateDynamic_KernelCeContext,
119 /*pCastInfo=*/ &__nvoc_castinfo_KernelCeContext,
120 /*pExportInfo=*/ &__nvoc_export_info_KernelCeContext
121 };
122
__nvoc_thunk_ChannelDescendant_kcectxCheckMemInterUnmap(struct KernelCeContext * pChannelDescendant,NvBool bSubdeviceHandleProvided)123 static NV_STATUS __nvoc_thunk_ChannelDescendant_kcectxCheckMemInterUnmap(struct KernelCeContext *pChannelDescendant, NvBool bSubdeviceHandleProvided) {
124 return chandesCheckMemInterUnmap((struct ChannelDescendant *)(((unsigned char *)pChannelDescendant) + __nvoc_rtti_KernelCeContext_ChannelDescendant.offset), bSubdeviceHandleProvided);
125 }
126
__nvoc_thunk_GpuResource_kcectxShareCallback(struct KernelCeContext * pGpuResource,struct RsClient * pInvokingClient,struct RsResourceRef * pParentRef,RS_SHARE_POLICY * pSharePolicy)127 static NvBool __nvoc_thunk_GpuResource_kcectxShareCallback(struct KernelCeContext *pGpuResource, struct RsClient *pInvokingClient, struct RsResourceRef *pParentRef, RS_SHARE_POLICY *pSharePolicy) {
128 return gpuresShareCallback((struct GpuResource *)(((unsigned char *)pGpuResource) + __nvoc_rtti_KernelCeContext_GpuResource.offset), pInvokingClient, pParentRef, pSharePolicy);
129 }
130
__nvoc_thunk_RmResource_kcectxAccessCallback(struct KernelCeContext * pResource,struct RsClient * pInvokingClient,void * pAllocParams,RsAccessRight accessRight)131 static NvBool __nvoc_thunk_RmResource_kcectxAccessCallback(struct KernelCeContext *pResource, struct RsClient *pInvokingClient, void *pAllocParams, RsAccessRight accessRight) {
132 return rmresAccessCallback((struct RmResource *)(((unsigned char *)pResource) + __nvoc_rtti_KernelCeContext_RmResource.offset), pInvokingClient, pAllocParams, accessRight);
133 }
134
__nvoc_thunk_RsResource_kcectxMapTo(struct KernelCeContext * pResource,RS_RES_MAP_TO_PARAMS * pParams)135 static NV_STATUS __nvoc_thunk_RsResource_kcectxMapTo(struct KernelCeContext *pResource, RS_RES_MAP_TO_PARAMS *pParams) {
136 return resMapTo((struct RsResource *)(((unsigned char *)pResource) + __nvoc_rtti_KernelCeContext_RsResource.offset), pParams);
137 }
138
__nvoc_thunk_GpuResource_kcectxGetMapAddrSpace(struct KernelCeContext * pGpuResource,struct CALL_CONTEXT * pCallContext,NvU32 mapFlags,NV_ADDRESS_SPACE * pAddrSpace)139 static NV_STATUS __nvoc_thunk_GpuResource_kcectxGetMapAddrSpace(struct KernelCeContext *pGpuResource, struct CALL_CONTEXT *pCallContext, NvU32 mapFlags, NV_ADDRESS_SPACE *pAddrSpace) {
140 return gpuresGetMapAddrSpace((struct GpuResource *)(((unsigned char *)pGpuResource) + __nvoc_rtti_KernelCeContext_GpuResource.offset), pCallContext, mapFlags, pAddrSpace);
141 }
142
__nvoc_thunk_Notifier_kcectxSetNotificationShare(struct KernelCeContext * pNotifier,struct NotifShare * pNotifShare)143 static void __nvoc_thunk_Notifier_kcectxSetNotificationShare(struct KernelCeContext *pNotifier, struct NotifShare *pNotifShare) {
144 notifySetNotificationShare((struct Notifier *)(((unsigned char *)pNotifier) + __nvoc_rtti_KernelCeContext_Notifier.offset), pNotifShare);
145 }
146
__nvoc_thunk_RsResource_kcectxGetRefCount(struct KernelCeContext * pResource)147 static NvU32 __nvoc_thunk_RsResource_kcectxGetRefCount(struct KernelCeContext *pResource) {
148 return resGetRefCount((struct RsResource *)(((unsigned char *)pResource) + __nvoc_rtti_KernelCeContext_RsResource.offset));
149 }
150
__nvoc_thunk_RsResource_kcectxAddAdditionalDependants(struct RsClient * pClient,struct KernelCeContext * pResource,RsResourceRef * pReference)151 static void __nvoc_thunk_RsResource_kcectxAddAdditionalDependants(struct RsClient *pClient, struct KernelCeContext *pResource, RsResourceRef *pReference) {
152 resAddAdditionalDependants(pClient, (struct RsResource *)(((unsigned char *)pResource) + __nvoc_rtti_KernelCeContext_RsResource.offset), pReference);
153 }
154
__nvoc_thunk_RmResource_kcectxControl_Prologue(struct KernelCeContext * pResource,struct CALL_CONTEXT * pCallContext,struct RS_RES_CONTROL_PARAMS_INTERNAL * pParams)155 static NV_STATUS __nvoc_thunk_RmResource_kcectxControl_Prologue(struct KernelCeContext *pResource, struct CALL_CONTEXT *pCallContext, struct RS_RES_CONTROL_PARAMS_INTERNAL *pParams) {
156 return rmresControl_Prologue((struct RmResource *)(((unsigned char *)pResource) + __nvoc_rtti_KernelCeContext_RmResource.offset), pCallContext, pParams);
157 }
158
__nvoc_thunk_GpuResource_kcectxGetRegBaseOffsetAndSize(struct KernelCeContext * pGpuResource,struct OBJGPU * pGpu,NvU32 * pOffset,NvU32 * pSize)159 static NV_STATUS __nvoc_thunk_GpuResource_kcectxGetRegBaseOffsetAndSize(struct KernelCeContext *pGpuResource, struct OBJGPU *pGpu, NvU32 *pOffset, NvU32 *pSize) {
160 return gpuresGetRegBaseOffsetAndSize((struct GpuResource *)(((unsigned char *)pGpuResource) + __nvoc_rtti_KernelCeContext_GpuResource.offset), pGpu, pOffset, pSize);
161 }
162
__nvoc_thunk_GpuResource_kcectxInternalControlForward(struct KernelCeContext * pGpuResource,NvU32 command,void * pParams,NvU32 size)163 static NV_STATUS __nvoc_thunk_GpuResource_kcectxInternalControlForward(struct KernelCeContext *pGpuResource, NvU32 command, void *pParams, NvU32 size) {
164 return gpuresInternalControlForward((struct GpuResource *)(((unsigned char *)pGpuResource) + __nvoc_rtti_KernelCeContext_GpuResource.offset), command, pParams, size);
165 }
166
__nvoc_thunk_RsResource_kcectxUnmapFrom(struct KernelCeContext * pResource,RS_RES_UNMAP_FROM_PARAMS * pParams)167 static NV_STATUS __nvoc_thunk_RsResource_kcectxUnmapFrom(struct KernelCeContext *pResource, RS_RES_UNMAP_FROM_PARAMS *pParams) {
168 return resUnmapFrom((struct RsResource *)(((unsigned char *)pResource) + __nvoc_rtti_KernelCeContext_RsResource.offset), pParams);
169 }
170
__nvoc_thunk_RmResource_kcectxControl_Epilogue(struct KernelCeContext * pResource,struct CALL_CONTEXT * pCallContext,struct RS_RES_CONTROL_PARAMS_INTERNAL * pParams)171 static void __nvoc_thunk_RmResource_kcectxControl_Epilogue(struct KernelCeContext *pResource, struct CALL_CONTEXT *pCallContext, struct RS_RES_CONTROL_PARAMS_INTERNAL *pParams) {
172 rmresControl_Epilogue((struct RmResource *)(((unsigned char *)pResource) + __nvoc_rtti_KernelCeContext_RmResource.offset), pCallContext, pParams);
173 }
174
__nvoc_thunk_ChannelDescendant_kcectxGetSwMethods(struct KernelCeContext * pChannelDescendant,const METHOD ** ppMethods,NvU32 * pNumMethods)175 static NV_STATUS __nvoc_thunk_ChannelDescendant_kcectxGetSwMethods(struct KernelCeContext *pChannelDescendant, const METHOD **ppMethods, NvU32 *pNumMethods) {
176 return chandesGetSwMethods((struct ChannelDescendant *)(((unsigned char *)pChannelDescendant) + __nvoc_rtti_KernelCeContext_ChannelDescendant.offset), ppMethods, pNumMethods);
177 }
178
__nvoc_thunk_GpuResource_kcectxGetInternalObjectHandle(struct KernelCeContext * pGpuResource)179 static NvHandle __nvoc_thunk_GpuResource_kcectxGetInternalObjectHandle(struct KernelCeContext *pGpuResource) {
180 return gpuresGetInternalObjectHandle((struct GpuResource *)(((unsigned char *)pGpuResource) + __nvoc_rtti_KernelCeContext_GpuResource.offset));
181 }
182
__nvoc_thunk_GpuResource_kcectxControl(struct KernelCeContext * pGpuResource,struct CALL_CONTEXT * pCallContext,struct RS_RES_CONTROL_PARAMS_INTERNAL * pParams)183 static NV_STATUS __nvoc_thunk_GpuResource_kcectxControl(struct KernelCeContext *pGpuResource, struct CALL_CONTEXT *pCallContext, struct RS_RES_CONTROL_PARAMS_INTERNAL *pParams) {
184 return gpuresControl((struct GpuResource *)(((unsigned char *)pGpuResource) + __nvoc_rtti_KernelCeContext_GpuResource.offset), pCallContext, pParams);
185 }
186
__nvoc_thunk_GpuResource_kcectxUnmap(struct KernelCeContext * pGpuResource,struct CALL_CONTEXT * pCallContext,struct RsCpuMapping * pCpuMapping)187 static NV_STATUS __nvoc_thunk_GpuResource_kcectxUnmap(struct KernelCeContext *pGpuResource, struct CALL_CONTEXT *pCallContext, struct RsCpuMapping *pCpuMapping) {
188 return gpuresUnmap((struct GpuResource *)(((unsigned char *)pGpuResource) + __nvoc_rtti_KernelCeContext_GpuResource.offset), pCallContext, pCpuMapping);
189 }
190
__nvoc_thunk_RmResource_kcectxGetMemInterMapParams(struct KernelCeContext * pRmResource,RMRES_MEM_INTER_MAP_PARAMS * pParams)191 static NV_STATUS __nvoc_thunk_RmResource_kcectxGetMemInterMapParams(struct KernelCeContext *pRmResource, RMRES_MEM_INTER_MAP_PARAMS *pParams) {
192 return rmresGetMemInterMapParams((struct RmResource *)(((unsigned char *)pRmResource) + __nvoc_rtti_KernelCeContext_RmResource.offset), pParams);
193 }
194
__nvoc_thunk_RmResource_kcectxGetMemoryMappingDescriptor(struct KernelCeContext * pRmResource,struct MEMORY_DESCRIPTOR ** ppMemDesc)195 static NV_STATUS __nvoc_thunk_RmResource_kcectxGetMemoryMappingDescriptor(struct KernelCeContext *pRmResource, struct MEMORY_DESCRIPTOR **ppMemDesc) {
196 return rmresGetMemoryMappingDescriptor((struct RmResource *)(((unsigned char *)pRmResource) + __nvoc_rtti_KernelCeContext_RmResource.offset), ppMemDesc);
197 }
198
__nvoc_thunk_ChannelDescendant_kcectxIsSwMethodStalling(struct KernelCeContext * pChannelDescendant,NvU32 hHandle)199 static NvBool __nvoc_thunk_ChannelDescendant_kcectxIsSwMethodStalling(struct KernelCeContext *pChannelDescendant, NvU32 hHandle) {
200 return chandesIsSwMethodStalling((struct ChannelDescendant *)(((unsigned char *)pChannelDescendant) + __nvoc_rtti_KernelCeContext_ChannelDescendant.offset), hHandle);
201 }
202
__nvoc_thunk_RsResource_kcectxControlFilter(struct KernelCeContext * pResource,struct CALL_CONTEXT * pCallContext,struct RS_RES_CONTROL_PARAMS_INTERNAL * pParams)203 static NV_STATUS __nvoc_thunk_RsResource_kcectxControlFilter(struct KernelCeContext *pResource, struct CALL_CONTEXT *pCallContext, struct RS_RES_CONTROL_PARAMS_INTERNAL *pParams) {
204 return resControlFilter((struct RsResource *)(((unsigned char *)pResource) + __nvoc_rtti_KernelCeContext_RsResource.offset), pCallContext, pParams);
205 }
206
__nvoc_thunk_Notifier_kcectxUnregisterEvent(struct KernelCeContext * pNotifier,NvHandle hNotifierClient,NvHandle hNotifierResource,NvHandle hEventClient,NvHandle hEvent)207 static NV_STATUS __nvoc_thunk_Notifier_kcectxUnregisterEvent(struct KernelCeContext *pNotifier, NvHandle hNotifierClient, NvHandle hNotifierResource, NvHandle hEventClient, NvHandle hEvent) {
208 return notifyUnregisterEvent((struct Notifier *)(((unsigned char *)pNotifier) + __nvoc_rtti_KernelCeContext_Notifier.offset), hNotifierClient, hNotifierResource, hEventClient, hEvent);
209 }
210
__nvoc_thunk_RmResource_kcectxControlSerialization_Prologue(struct KernelCeContext * pResource,struct CALL_CONTEXT * pCallContext,struct RS_RES_CONTROL_PARAMS_INTERNAL * pParams)211 static NV_STATUS __nvoc_thunk_RmResource_kcectxControlSerialization_Prologue(struct KernelCeContext *pResource, struct CALL_CONTEXT *pCallContext, struct RS_RES_CONTROL_PARAMS_INTERNAL *pParams) {
212 return rmresControlSerialization_Prologue((struct RmResource *)(((unsigned char *)pResource) + __nvoc_rtti_KernelCeContext_RmResource.offset), pCallContext, pParams);
213 }
214
__nvoc_thunk_RsResource_kcectxCanCopy(struct KernelCeContext * pResource)215 static NvBool __nvoc_thunk_RsResource_kcectxCanCopy(struct KernelCeContext *pResource) {
216 return resCanCopy((struct RsResource *)(((unsigned char *)pResource) + __nvoc_rtti_KernelCeContext_RsResource.offset));
217 }
218
__nvoc_thunk_RsResource_kcectxIsPartialUnmapSupported(struct KernelCeContext * pResource)219 static NvBool __nvoc_thunk_RsResource_kcectxIsPartialUnmapSupported(struct KernelCeContext *pResource) {
220 return resIsPartialUnmapSupported((struct RsResource *)(((unsigned char *)pResource) + __nvoc_rtti_KernelCeContext_RsResource.offset));
221 }
222
__nvoc_thunk_RsResource_kcectxPreDestruct(struct KernelCeContext * pResource)223 static void __nvoc_thunk_RsResource_kcectxPreDestruct(struct KernelCeContext *pResource) {
224 resPreDestruct((struct RsResource *)(((unsigned char *)pResource) + __nvoc_rtti_KernelCeContext_RsResource.offset));
225 }
226
__nvoc_thunk_RsResource_kcectxIsDuplicate(struct KernelCeContext * pResource,NvHandle hMemory,NvBool * pDuplicate)227 static NV_STATUS __nvoc_thunk_RsResource_kcectxIsDuplicate(struct KernelCeContext *pResource, NvHandle hMemory, NvBool *pDuplicate) {
228 return resIsDuplicate((struct RsResource *)(((unsigned char *)pResource) + __nvoc_rtti_KernelCeContext_RsResource.offset), hMemory, pDuplicate);
229 }
230
__nvoc_thunk_RmResource_kcectxControlSerialization_Epilogue(struct KernelCeContext * pResource,struct CALL_CONTEXT * pCallContext,struct RS_RES_CONTROL_PARAMS_INTERNAL * pParams)231 static void __nvoc_thunk_RmResource_kcectxControlSerialization_Epilogue(struct KernelCeContext *pResource, struct CALL_CONTEXT *pCallContext, struct RS_RES_CONTROL_PARAMS_INTERNAL *pParams) {
232 rmresControlSerialization_Epilogue((struct RmResource *)(((unsigned char *)pResource) + __nvoc_rtti_KernelCeContext_RmResource.offset), pCallContext, pParams);
233 }
234
__nvoc_thunk_Notifier_kcectxGetNotificationListPtr(struct KernelCeContext * pNotifier)235 static PEVENTNOTIFICATION *__nvoc_thunk_Notifier_kcectxGetNotificationListPtr(struct KernelCeContext *pNotifier) {
236 return notifyGetNotificationListPtr((struct Notifier *)(((unsigned char *)pNotifier) + __nvoc_rtti_KernelCeContext_Notifier.offset));
237 }
238
__nvoc_thunk_Notifier_kcectxGetNotificationShare(struct KernelCeContext * pNotifier)239 static struct NotifShare *__nvoc_thunk_Notifier_kcectxGetNotificationShare(struct KernelCeContext *pNotifier) {
240 return notifyGetNotificationShare((struct Notifier *)(((unsigned char *)pNotifier) + __nvoc_rtti_KernelCeContext_Notifier.offset));
241 }
242
__nvoc_thunk_GpuResource_kcectxMap(struct KernelCeContext * pGpuResource,struct CALL_CONTEXT * pCallContext,struct RS_CPU_MAP_PARAMS * pParams,struct RsCpuMapping * pCpuMapping)243 static NV_STATUS __nvoc_thunk_GpuResource_kcectxMap(struct KernelCeContext *pGpuResource, struct CALL_CONTEXT *pCallContext, struct RS_CPU_MAP_PARAMS *pParams, struct RsCpuMapping *pCpuMapping) {
244 return gpuresMap((struct GpuResource *)(((unsigned char *)pGpuResource) + __nvoc_rtti_KernelCeContext_GpuResource.offset), pCallContext, pParams, pCpuMapping);
245 }
246
__nvoc_thunk_Notifier_kcectxGetOrAllocNotifShare(struct KernelCeContext * pNotifier,NvHandle hNotifierClient,NvHandle hNotifierResource,struct NotifShare ** ppNotifShare)247 static NV_STATUS __nvoc_thunk_Notifier_kcectxGetOrAllocNotifShare(struct KernelCeContext *pNotifier, NvHandle hNotifierClient, NvHandle hNotifierResource, struct NotifShare **ppNotifShare) {
248 return notifyGetOrAllocNotifShare((struct Notifier *)(((unsigned char *)pNotifier) + __nvoc_rtti_KernelCeContext_Notifier.offset), hNotifierClient, hNotifierResource, ppNotifShare);
249 }
250
251 const struct NVOC_EXPORT_INFO __nvoc_export_info_KernelCeContext =
252 {
253 /*numEntries=*/ 0,
254 /*pExportEntries=*/ 0
255 };
256
257 void __nvoc_dtor_ChannelDescendant(ChannelDescendant*);
__nvoc_dtor_KernelCeContext(KernelCeContext * pThis)258 void __nvoc_dtor_KernelCeContext(KernelCeContext *pThis) {
259 __nvoc_kcectxDestruct(pThis);
260 __nvoc_dtor_ChannelDescendant(&pThis->__nvoc_base_ChannelDescendant);
261 PORT_UNREFERENCED_VARIABLE(pThis);
262 }
263
__nvoc_init_dataField_KernelCeContext(KernelCeContext * pThis)264 void __nvoc_init_dataField_KernelCeContext(KernelCeContext *pThis) {
265 PORT_UNREFERENCED_VARIABLE(pThis);
266 }
267
268 NV_STATUS __nvoc_ctor_ChannelDescendant(ChannelDescendant* , RmHalspecOwner* , CALL_CONTEXT *, struct RS_RES_ALLOC_PARAMS_INTERNAL *, ENGDESCRIPTOR (*)(struct OBJGPU *, NvU32, void *));
__nvoc_ctor_KernelCeContext(KernelCeContext * pThis,RmHalspecOwner * pRmhalspecowner,CALL_CONTEXT * arg_pCallContext,struct RS_RES_ALLOC_PARAMS_INTERNAL * arg_pParams)269 NV_STATUS __nvoc_ctor_KernelCeContext(KernelCeContext *pThis, RmHalspecOwner *pRmhalspecowner, CALL_CONTEXT * arg_pCallContext, struct RS_RES_ALLOC_PARAMS_INTERNAL * arg_pParams) {
270 NV_STATUS status = NV_OK;
271 status = __nvoc_ctor_ChannelDescendant(&pThis->__nvoc_base_ChannelDescendant, pRmhalspecowner, arg_pCallContext, arg_pParams, kceGetEngineDescFromAllocParams);
272 if (status != NV_OK) goto __nvoc_ctor_KernelCeContext_fail_ChannelDescendant;
273 __nvoc_init_dataField_KernelCeContext(pThis);
274
275 status = __nvoc_kcectxConstruct(pThis, arg_pCallContext, arg_pParams);
276 if (status != NV_OK) goto __nvoc_ctor_KernelCeContext_fail__init;
277 goto __nvoc_ctor_KernelCeContext_exit; // Success
278
279 __nvoc_ctor_KernelCeContext_fail__init:
280 __nvoc_dtor_ChannelDescendant(&pThis->__nvoc_base_ChannelDescendant);
281 __nvoc_ctor_KernelCeContext_fail_ChannelDescendant:
282 __nvoc_ctor_KernelCeContext_exit:
283
284 return status;
285 }
286
__nvoc_init_funcTable_KernelCeContext_1(KernelCeContext * pThis)287 static void __nvoc_init_funcTable_KernelCeContext_1(KernelCeContext *pThis) {
288 PORT_UNREFERENCED_VARIABLE(pThis);
289
290 pThis->__kcectxCheckMemInterUnmap__ = &__nvoc_thunk_ChannelDescendant_kcectxCheckMemInterUnmap;
291
292 pThis->__kcectxShareCallback__ = &__nvoc_thunk_GpuResource_kcectxShareCallback;
293
294 pThis->__kcectxAccessCallback__ = &__nvoc_thunk_RmResource_kcectxAccessCallback;
295
296 pThis->__kcectxMapTo__ = &__nvoc_thunk_RsResource_kcectxMapTo;
297
298 pThis->__kcectxGetMapAddrSpace__ = &__nvoc_thunk_GpuResource_kcectxGetMapAddrSpace;
299
300 pThis->__kcectxSetNotificationShare__ = &__nvoc_thunk_Notifier_kcectxSetNotificationShare;
301
302 pThis->__kcectxGetRefCount__ = &__nvoc_thunk_RsResource_kcectxGetRefCount;
303
304 pThis->__kcectxAddAdditionalDependants__ = &__nvoc_thunk_RsResource_kcectxAddAdditionalDependants;
305
306 pThis->__kcectxControl_Prologue__ = &__nvoc_thunk_RmResource_kcectxControl_Prologue;
307
308 pThis->__kcectxGetRegBaseOffsetAndSize__ = &__nvoc_thunk_GpuResource_kcectxGetRegBaseOffsetAndSize;
309
310 pThis->__kcectxInternalControlForward__ = &__nvoc_thunk_GpuResource_kcectxInternalControlForward;
311
312 pThis->__kcectxUnmapFrom__ = &__nvoc_thunk_RsResource_kcectxUnmapFrom;
313
314 pThis->__kcectxControl_Epilogue__ = &__nvoc_thunk_RmResource_kcectxControl_Epilogue;
315
316 pThis->__kcectxGetSwMethods__ = &__nvoc_thunk_ChannelDescendant_kcectxGetSwMethods;
317
318 pThis->__kcectxGetInternalObjectHandle__ = &__nvoc_thunk_GpuResource_kcectxGetInternalObjectHandle;
319
320 pThis->__kcectxControl__ = &__nvoc_thunk_GpuResource_kcectxControl;
321
322 pThis->__kcectxUnmap__ = &__nvoc_thunk_GpuResource_kcectxUnmap;
323
324 pThis->__kcectxGetMemInterMapParams__ = &__nvoc_thunk_RmResource_kcectxGetMemInterMapParams;
325
326 pThis->__kcectxGetMemoryMappingDescriptor__ = &__nvoc_thunk_RmResource_kcectxGetMemoryMappingDescriptor;
327
328 pThis->__kcectxIsSwMethodStalling__ = &__nvoc_thunk_ChannelDescendant_kcectxIsSwMethodStalling;
329
330 pThis->__kcectxControlFilter__ = &__nvoc_thunk_RsResource_kcectxControlFilter;
331
332 pThis->__kcectxUnregisterEvent__ = &__nvoc_thunk_Notifier_kcectxUnregisterEvent;
333
334 pThis->__kcectxControlSerialization_Prologue__ = &__nvoc_thunk_RmResource_kcectxControlSerialization_Prologue;
335
336 pThis->__kcectxCanCopy__ = &__nvoc_thunk_RsResource_kcectxCanCopy;
337
338 pThis->__kcectxIsPartialUnmapSupported__ = &__nvoc_thunk_RsResource_kcectxIsPartialUnmapSupported;
339
340 pThis->__kcectxPreDestruct__ = &__nvoc_thunk_RsResource_kcectxPreDestruct;
341
342 pThis->__kcectxIsDuplicate__ = &__nvoc_thunk_RsResource_kcectxIsDuplicate;
343
344 pThis->__kcectxControlSerialization_Epilogue__ = &__nvoc_thunk_RmResource_kcectxControlSerialization_Epilogue;
345
346 pThis->__kcectxGetNotificationListPtr__ = &__nvoc_thunk_Notifier_kcectxGetNotificationListPtr;
347
348 pThis->__kcectxGetNotificationShare__ = &__nvoc_thunk_Notifier_kcectxGetNotificationShare;
349
350 pThis->__kcectxMap__ = &__nvoc_thunk_GpuResource_kcectxMap;
351
352 pThis->__kcectxGetOrAllocNotifShare__ = &__nvoc_thunk_Notifier_kcectxGetOrAllocNotifShare;
353 }
354
__nvoc_init_funcTable_KernelCeContext(KernelCeContext * pThis)355 void __nvoc_init_funcTable_KernelCeContext(KernelCeContext *pThis) {
356 __nvoc_init_funcTable_KernelCeContext_1(pThis);
357 }
358
359 void __nvoc_init_ChannelDescendant(ChannelDescendant*, RmHalspecOwner* );
__nvoc_init_KernelCeContext(KernelCeContext * pThis,RmHalspecOwner * pRmhalspecowner)360 void __nvoc_init_KernelCeContext(KernelCeContext *pThis, RmHalspecOwner *pRmhalspecowner) {
361 pThis->__nvoc_pbase_KernelCeContext = pThis;
362 pThis->__nvoc_pbase_Object = &pThis->__nvoc_base_ChannelDescendant.__nvoc_base_GpuResource.__nvoc_base_RmResource.__nvoc_base_RsResource.__nvoc_base_Object;
363 pThis->__nvoc_pbase_RsResource = &pThis->__nvoc_base_ChannelDescendant.__nvoc_base_GpuResource.__nvoc_base_RmResource.__nvoc_base_RsResource;
364 pThis->__nvoc_pbase_RmResourceCommon = &pThis->__nvoc_base_ChannelDescendant.__nvoc_base_GpuResource.__nvoc_base_RmResource.__nvoc_base_RmResourceCommon;
365 pThis->__nvoc_pbase_RmResource = &pThis->__nvoc_base_ChannelDescendant.__nvoc_base_GpuResource.__nvoc_base_RmResource;
366 pThis->__nvoc_pbase_GpuResource = &pThis->__nvoc_base_ChannelDescendant.__nvoc_base_GpuResource;
367 pThis->__nvoc_pbase_INotifier = &pThis->__nvoc_base_ChannelDescendant.__nvoc_base_Notifier.__nvoc_base_INotifier;
368 pThis->__nvoc_pbase_Notifier = &pThis->__nvoc_base_ChannelDescendant.__nvoc_base_Notifier;
369 pThis->__nvoc_pbase_ChannelDescendant = &pThis->__nvoc_base_ChannelDescendant;
370 __nvoc_init_ChannelDescendant(&pThis->__nvoc_base_ChannelDescendant, pRmhalspecowner);
371 __nvoc_init_funcTable_KernelCeContext(pThis);
372 }
373
__nvoc_objCreate_KernelCeContext(KernelCeContext ** ppThis,Dynamic * pParent,NvU32 createFlags,CALL_CONTEXT * arg_pCallContext,struct RS_RES_ALLOC_PARAMS_INTERNAL * arg_pParams)374 NV_STATUS __nvoc_objCreate_KernelCeContext(KernelCeContext **ppThis, Dynamic *pParent, NvU32 createFlags, CALL_CONTEXT * arg_pCallContext, struct RS_RES_ALLOC_PARAMS_INTERNAL * arg_pParams)
375 {
376 NV_STATUS status;
377 Object *pParentObj = NULL;
378 KernelCeContext *pThis;
379 RmHalspecOwner *pRmhalspecowner;
380
381 // Assign `pThis`, allocating memory unless suppressed by flag.
382 status = __nvoc_handleObjCreateMemAlloc(createFlags, sizeof(KernelCeContext), (void**)&pThis, (void**)ppThis);
383 if (status != NV_OK)
384 return status;
385
386 // Zero is the initial value for everything.
387 portMemSet(pThis, 0, sizeof(KernelCeContext));
388
389 // Initialize runtime type information.
390 __nvoc_initRtti(staticCast(pThis, Dynamic), &__nvoc_class_def_KernelCeContext);
391
392 pThis->__nvoc_base_ChannelDescendant.__nvoc_base_GpuResource.__nvoc_base_RmResource.__nvoc_base_RsResource.__nvoc_base_Object.createFlags = createFlags;
393
394 // pParent must be a valid object that derives from a halspec owner class.
395 NV_ASSERT_OR_RETURN(pParent != NULL, NV_ERR_INVALID_ARGUMENT);
396
397 // Link the child into the parent unless flagged not to do so.
398 if (!(createFlags & NVOC_OBJ_CREATE_FLAGS_PARENT_HALSPEC_ONLY))
399 {
400 pParentObj = dynamicCast(pParent, Object);
401 objAddChild(pParentObj, &pThis->__nvoc_base_ChannelDescendant.__nvoc_base_GpuResource.__nvoc_base_RmResource.__nvoc_base_RsResource.__nvoc_base_Object);
402 }
403 else
404 {
405 pThis->__nvoc_base_ChannelDescendant.__nvoc_base_GpuResource.__nvoc_base_RmResource.__nvoc_base_RsResource.__nvoc_base_Object.pParent = NULL;
406 }
407
408 if ((pRmhalspecowner = dynamicCast(pParent, RmHalspecOwner)) == NULL)
409 pRmhalspecowner = objFindAncestorOfType(RmHalspecOwner, pParent);
410 NV_ASSERT_OR_RETURN(pRmhalspecowner != NULL, NV_ERR_INVALID_ARGUMENT);
411
412 __nvoc_init_KernelCeContext(pThis, pRmhalspecowner);
413 status = __nvoc_ctor_KernelCeContext(pThis, pRmhalspecowner, arg_pCallContext, arg_pParams);
414 if (status != NV_OK) goto __nvoc_objCreate_KernelCeContext_cleanup;
415
416 // Assignment has no effect if NVOC_OBJ_CREATE_FLAGS_IN_PLACE_CONSTRUCT is set.
417 *ppThis = pThis;
418
419 return NV_OK;
420
421 __nvoc_objCreate_KernelCeContext_cleanup:
422
423 // Unlink the child from the parent if it was linked above.
424 if (pParentObj != NULL)
425 objRemoveChild(pParentObj, &pThis->__nvoc_base_ChannelDescendant.__nvoc_base_GpuResource.__nvoc_base_RmResource.__nvoc_base_RsResource.__nvoc_base_Object);
426
427 // Do not call destructors here since the constructor already called them.
428 if (createFlags & NVOC_OBJ_CREATE_FLAGS_IN_PLACE_CONSTRUCT)
429 portMemSet(pThis, 0, sizeof(KernelCeContext));
430 else
431 {
432 portMemFree(pThis);
433 *ppThis = NULL;
434 }
435
436 // coverity[leaked_storage:FALSE]
437 return status;
438 }
439
__nvoc_objCreateDynamic_KernelCeContext(KernelCeContext ** ppThis,Dynamic * pParent,NvU32 createFlags,va_list args)440 NV_STATUS __nvoc_objCreateDynamic_KernelCeContext(KernelCeContext **ppThis, Dynamic *pParent, NvU32 createFlags, va_list args) {
441 NV_STATUS status;
442 CALL_CONTEXT * arg_pCallContext = va_arg(args, CALL_CONTEXT *);
443 struct RS_RES_ALLOC_PARAMS_INTERNAL * arg_pParams = va_arg(args, struct RS_RES_ALLOC_PARAMS_INTERNAL *);
444
445 status = __nvoc_objCreate_KernelCeContext(ppThis, pParent, createFlags, arg_pCallContext, arg_pParams);
446
447 return status;
448 }
449
450