1 #ifndef _G_KERNEL_RC_NVOC_H_
2 #define _G_KERNEL_RC_NVOC_H_
3 #include "nvoc/runtime.h"
4 
5 #ifdef __cplusplus
6 extern "C" {
7 #endif
8 
9 /*
10  * SPDX-FileCopyrightText: Copyright (c) 2021-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_kernel_rc_nvoc.h"
33 
34 #ifndef KERNEL_RC_H
35 #define KERNEL_RC_H 1
36 
37 #include "kernel/gpu/eng_desc.h"
38 #include "kernel/gpu/eng_state.h"
39 #include "kernel/gpu/fifo/kernel_channel.h"
40 #include "kernel/gpu/gpu.h"
41 #include "kernel/gpu/mmu/kern_gmmu.h"
42 #include "kernel/gpu/rc/kernel_rc_watchdog.h"
43 #include "kernel/gpu/rc/kernel_rc_watchdog_private.h"
44 #include "kernel/gpu/gpu_engine_type.h"
45 #include "kernel/rmapi/client_resource.h"
46 
47 #include "ctrl/ctrl2080/ctrl2080rc.h"
48 
49 struct Subdevice;
50 
51 #ifndef __NVOC_CLASS_Subdevice_TYPEDEF__
52 #define __NVOC_CLASS_Subdevice_TYPEDEF__
53 typedef struct Subdevice Subdevice;
54 #endif /* __NVOC_CLASS_Subdevice_TYPEDEF__ */
55 
56 #ifndef __nvoc_class_id_Subdevice
57 #define __nvoc_class_id_Subdevice 0x4b01b3
58 #endif /* __nvoc_class_id_Subdevice */
59 
60 
61 
62 typedef enum {
63     RC_NOTIFIER_SCOPE_CHANNEL = 0,
64     RC_NOTIFIER_SCOPE_TSG,
65 } RC_NOTIFIER_SCOPE;
66 
67 /*!
68  * Kernel interface for RC (Robust Channels) and Watchdog
69  */
70 
71 // Private field names are wrapped in PRIVATE_FIELD, which does nothing for
72 // the matching C source file, but causes diagnostics to be issued if another
73 // source file references the field.
74 #ifdef NVOC_KERNEL_RC_H_PRIVATE_ACCESS_ALLOWED
75 #define PRIVATE_FIELD(x) x
76 #else
77 #define PRIVATE_FIELD(x) NVOC_PRIVATE_FIELD(x)
78 #endif
79 
80 struct KernelRc {
81     const struct NVOC_RTTI *__nvoc_rtti;
82     struct OBJENGSTATE __nvoc_base_OBJENGSTATE;
83     struct Object *__nvoc_pbase_Object;
84     struct OBJENGSTATE *__nvoc_pbase_OBJENGSTATE;
85     struct KernelRc *__nvoc_pbase_KernelRc;
86     NV_STATUS (*__krcConstructEngine__)(struct OBJGPU *, struct KernelRc *, ENGDESCRIPTOR);
87     void (*__krcWatchdogRecovery__)(struct OBJGPU *, struct KernelRc *);
88     NV_STATUS (*__krcStateLoad__)(POBJGPU, struct KernelRc *, NvU32);
89     NV_STATUS (*__krcStateUnload__)(POBJGPU, struct KernelRc *, NvU32);
90     NV_STATUS (*__krcStateInitLocked__)(POBJGPU, struct KernelRc *);
91     NV_STATUS (*__krcStatePreLoad__)(POBJGPU, struct KernelRc *, NvU32);
92     NV_STATUS (*__krcStatePostUnload__)(POBJGPU, struct KernelRc *, NvU32);
93     void (*__krcStateDestroy__)(POBJGPU, struct KernelRc *);
94     NV_STATUS (*__krcStatePreUnload__)(POBJGPU, struct KernelRc *, NvU32);
95     NV_STATUS (*__krcStateInitUnlocked__)(POBJGPU, struct KernelRc *);
96     void (*__krcInitMissing__)(POBJGPU, struct KernelRc *);
97     NV_STATUS (*__krcStatePreInitLocked__)(POBJGPU, struct KernelRc *);
98     NV_STATUS (*__krcStatePreInitUnlocked__)(POBJGPU, struct KernelRc *);
99     NV_STATUS (*__krcStatePostLoad__)(POBJGPU, struct KernelRc *, NvU32);
100     NvBool (*__krcIsPresent__)(POBJGPU, struct KernelRc *);
101     NvBool bRobustChannelsEnabled;
102     NvBool bBreakOnRc;
103     NvBool bLogEvents;
104     struct KernelChannel *pPreviousChannelInError;
105     NvBool bRcOnBar2Fault;
106     NvBool bGpuUuidLoggedOnce;
107     KernelWatchdog watchdog;
108     KernelWatchdogPersistent watchdogPersistent;
109     KernelWatchdogChannelInfo watchdogChannelInfo;
110 };
111 
112 #ifndef __NVOC_CLASS_KernelRc_TYPEDEF__
113 #define __NVOC_CLASS_KernelRc_TYPEDEF__
114 typedef struct KernelRc KernelRc;
115 #endif /* __NVOC_CLASS_KernelRc_TYPEDEF__ */
116 
117 #ifndef __nvoc_class_id_KernelRc
118 #define __nvoc_class_id_KernelRc 0x4888db
119 #endif /* __nvoc_class_id_KernelRc */
120 
121 extern const struct NVOC_CLASS_DEF __nvoc_class_def_KernelRc;
122 
123 #define __staticCast_KernelRc(pThis) \
124     ((pThis)->__nvoc_pbase_KernelRc)
125 
126 #ifdef __nvoc_kernel_rc_h_disabled
127 #define __dynamicCast_KernelRc(pThis) ((KernelRc*)NULL)
128 #else //__nvoc_kernel_rc_h_disabled
129 #define __dynamicCast_KernelRc(pThis) \
130     ((KernelRc*)__nvoc_dynamicCast(staticCast((pThis), Dynamic), classInfo(KernelRc)))
131 #endif //__nvoc_kernel_rc_h_disabled
132 
133 #define PDB_PROP_KRC_IS_MISSING_BASE_CAST __nvoc_base_OBJENGSTATE.
134 #define PDB_PROP_KRC_IS_MISSING_BASE_NAME PDB_PROP_ENGSTATE_IS_MISSING
135 
136 NV_STATUS __nvoc_objCreateDynamic_KernelRc(KernelRc**, Dynamic*, NvU32, va_list);
137 
138 NV_STATUS __nvoc_objCreate_KernelRc(KernelRc**, Dynamic*, NvU32);
139 #define __objCreate_KernelRc(ppNewObj, pParent, createFlags) \
140     __nvoc_objCreate_KernelRc((ppNewObj), staticCast((pParent), Dynamic), (createFlags))
141 
142 #define krcConstructEngine(pGpu, pKernelRc, engDescriptor) krcConstructEngine_DISPATCH(pGpu, pKernelRc, engDescriptor)
143 #define krcWatchdogRecovery(pGpu, pKernelRc) krcWatchdogRecovery_DISPATCH(pGpu, pKernelRc)
144 #define krcWatchdogRecovery_HAL(pGpu, pKernelRc) krcWatchdogRecovery_DISPATCH(pGpu, pKernelRc)
145 #define krcStateLoad(pGpu, pEngstate, arg0) krcStateLoad_DISPATCH(pGpu, pEngstate, arg0)
146 #define krcStateUnload(pGpu, pEngstate, arg0) krcStateUnload_DISPATCH(pGpu, pEngstate, arg0)
147 #define krcStateInitLocked(pGpu, pEngstate) krcStateInitLocked_DISPATCH(pGpu, pEngstate)
148 #define krcStatePreLoad(pGpu, pEngstate, arg0) krcStatePreLoad_DISPATCH(pGpu, pEngstate, arg0)
149 #define krcStatePostUnload(pGpu, pEngstate, arg0) krcStatePostUnload_DISPATCH(pGpu, pEngstate, arg0)
150 #define krcStateDestroy(pGpu, pEngstate) krcStateDestroy_DISPATCH(pGpu, pEngstate)
151 #define krcStatePreUnload(pGpu, pEngstate, arg0) krcStatePreUnload_DISPATCH(pGpu, pEngstate, arg0)
152 #define krcStateInitUnlocked(pGpu, pEngstate) krcStateInitUnlocked_DISPATCH(pGpu, pEngstate)
153 #define krcInitMissing(pGpu, pEngstate) krcInitMissing_DISPATCH(pGpu, pEngstate)
154 #define krcStatePreInitLocked(pGpu, pEngstate) krcStatePreInitLocked_DISPATCH(pGpu, pEngstate)
155 #define krcStatePreInitUnlocked(pGpu, pEngstate) krcStatePreInitUnlocked_DISPATCH(pGpu, pEngstate)
156 #define krcStatePostLoad(pGpu, pEngstate, arg0) krcStatePostLoad_DISPATCH(pGpu, pEngstate, arg0)
157 #define krcIsPresent(pGpu, pEngstate) krcIsPresent_DISPATCH(pGpu, pEngstate)
158 NV_STATUS krcErrorWriteNotifier_CPU(struct OBJGPU *pGpu, struct KernelRc *pKernelRc, struct KernelChannel *pKernelChannel, NvU32 exceptType, RM_ENGINE_TYPE localRmEngineType, NV_STATUS notifierStatus, NvU32 *pFlushFlags);
159 
160 
161 #ifdef __nvoc_kernel_rc_h_disabled
krcErrorWriteNotifier(struct OBJGPU * pGpu,struct KernelRc * pKernelRc,struct KernelChannel * pKernelChannel,NvU32 exceptType,RM_ENGINE_TYPE localRmEngineType,NV_STATUS notifierStatus,NvU32 * pFlushFlags)162 static inline NV_STATUS krcErrorWriteNotifier(struct OBJGPU *pGpu, struct KernelRc *pKernelRc, struct KernelChannel *pKernelChannel, NvU32 exceptType, RM_ENGINE_TYPE localRmEngineType, NV_STATUS notifierStatus, NvU32 *pFlushFlags) {
163     NV_ASSERT_FAILED_PRECOMP("KernelRc was disabled!");
164     return NV_ERR_NOT_SUPPORTED;
165 }
166 #else //__nvoc_kernel_rc_h_disabled
167 #define krcErrorWriteNotifier(pGpu, pKernelRc, pKernelChannel, exceptType, localRmEngineType, notifierStatus, pFlushFlags) krcErrorWriteNotifier_CPU(pGpu, pKernelRc, pKernelChannel, exceptType, localRmEngineType, notifierStatus, pFlushFlags)
168 #endif //__nvoc_kernel_rc_h_disabled
169 
170 #define krcErrorWriteNotifier_HAL(pGpu, pKernelRc, pKernelChannel, exceptType, localRmEngineType, notifierStatus, pFlushFlags) krcErrorWriteNotifier(pGpu, pKernelRc, pKernelChannel, exceptType, localRmEngineType, notifierStatus, pFlushFlags)
171 
172 NV_STATUS krcErrorSendEventNotifications_KERNEL(struct OBJGPU *pGpu, struct KernelRc *pKernelRc, struct KernelChannel *pKernelChannel, RM_ENGINE_TYPE rmEngineType, NvU32 exceptType, RC_NOTIFIER_SCOPE scope, NvU16 partitionAttributionId);
173 
174 
175 #ifdef __nvoc_kernel_rc_h_disabled
krcErrorSendEventNotifications(struct OBJGPU * pGpu,struct KernelRc * pKernelRc,struct KernelChannel * pKernelChannel,RM_ENGINE_TYPE rmEngineType,NvU32 exceptType,RC_NOTIFIER_SCOPE scope,NvU16 partitionAttributionId)176 static inline NV_STATUS krcErrorSendEventNotifications(struct OBJGPU *pGpu, struct KernelRc *pKernelRc, struct KernelChannel *pKernelChannel, RM_ENGINE_TYPE rmEngineType, NvU32 exceptType, RC_NOTIFIER_SCOPE scope, NvU16 partitionAttributionId) {
177     NV_ASSERT_FAILED_PRECOMP("KernelRc was disabled!");
178     return NV_ERR_NOT_SUPPORTED;
179 }
180 #else //__nvoc_kernel_rc_h_disabled
181 #define krcErrorSendEventNotifications(pGpu, pKernelRc, pKernelChannel, rmEngineType, exceptType, scope, partitionAttributionId) krcErrorSendEventNotifications_KERNEL(pGpu, pKernelRc, pKernelChannel, rmEngineType, exceptType, scope, partitionAttributionId)
182 #endif //__nvoc_kernel_rc_h_disabled
183 
184 #define krcErrorSendEventNotifications_HAL(pGpu, pKernelRc, pKernelChannel, rmEngineType, exceptType, scope, partitionAttributionId) krcErrorSendEventNotifications(pGpu, pKernelRc, pKernelChannel, rmEngineType, exceptType, scope, partitionAttributionId)
185 
186 NV_STATUS krcErrorSendEventNotificationsCtxDma_FWCLIENT(struct OBJGPU *pGpu, struct KernelRc *pKernelRc, struct KernelChannel *pKernelChannel, RC_NOTIFIER_SCOPE scope);
187 
188 
189 #ifdef __nvoc_kernel_rc_h_disabled
krcErrorSendEventNotificationsCtxDma(struct OBJGPU * pGpu,struct KernelRc * pKernelRc,struct KernelChannel * pKernelChannel,RC_NOTIFIER_SCOPE scope)190 static inline NV_STATUS krcErrorSendEventNotificationsCtxDma(struct OBJGPU *pGpu, struct KernelRc *pKernelRc, struct KernelChannel *pKernelChannel, RC_NOTIFIER_SCOPE scope) {
191     NV_ASSERT_FAILED_PRECOMP("KernelRc was disabled!");
192     return NV_ERR_NOT_SUPPORTED;
193 }
194 #else //__nvoc_kernel_rc_h_disabled
195 #define krcErrorSendEventNotificationsCtxDma(pGpu, pKernelRc, pKernelChannel, scope) krcErrorSendEventNotificationsCtxDma_FWCLIENT(pGpu, pKernelRc, pKernelChannel, scope)
196 #endif //__nvoc_kernel_rc_h_disabled
197 
198 #define krcErrorSendEventNotificationsCtxDma_HAL(pGpu, pKernelRc, pKernelChannel, scope) krcErrorSendEventNotificationsCtxDma(pGpu, pKernelRc, pKernelChannel, scope)
199 
200 void krcGetMigAttributionForError_KERNEL(struct KernelRc *pKernelRc, NvU32 exceptType, NvU16 *pGpuPartitionId, NvU16 *pComputeInstanceId);
201 
202 
203 #ifdef __nvoc_kernel_rc_h_disabled
krcGetMigAttributionForError(struct KernelRc * pKernelRc,NvU32 exceptType,NvU16 * pGpuPartitionId,NvU16 * pComputeInstanceId)204 static inline void krcGetMigAttributionForError(struct KernelRc *pKernelRc, NvU32 exceptType, NvU16 *pGpuPartitionId, NvU16 *pComputeInstanceId) {
205     NV_ASSERT_FAILED_PRECOMP("KernelRc was disabled!");
206 }
207 #else //__nvoc_kernel_rc_h_disabled
208 #define krcGetMigAttributionForError(pKernelRc, exceptType, pGpuPartitionId, pComputeInstanceId) krcGetMigAttributionForError_KERNEL(pKernelRc, exceptType, pGpuPartitionId, pComputeInstanceId)
209 #endif //__nvoc_kernel_rc_h_disabled
210 
211 #define krcGetMigAttributionForError_HAL(pKernelRc, exceptType, pGpuPartitionId, pComputeInstanceId) krcGetMigAttributionForError(pKernelRc, exceptType, pGpuPartitionId, pComputeInstanceId)
212 
213 struct KernelChannel *krcGetChannelInError_FWCLIENT(struct KernelRc *pKernelRc);
214 
215 
216 #ifdef __nvoc_kernel_rc_h_disabled
krcGetChannelInError(struct KernelRc * pKernelRc)217 static inline struct KernelChannel *krcGetChannelInError(struct KernelRc *pKernelRc) {
218     NV_ASSERT_FAILED_PRECOMP("KernelRc was disabled!");
219     return NULL;
220 }
221 #else //__nvoc_kernel_rc_h_disabled
222 #define krcGetChannelInError(pKernelRc) krcGetChannelInError_FWCLIENT(pKernelRc)
223 #endif //__nvoc_kernel_rc_h_disabled
224 
225 #define krcGetChannelInError_HAL(pKernelRc) krcGetChannelInError(pKernelRc)
226 
227 NV_STATUS krcSubdeviceCtrlGetErrorInfoCheckPermissions_KERNEL(struct KernelRc *pKernelRc, struct Subdevice *pSubdevice);
228 
229 
230 #ifdef __nvoc_kernel_rc_h_disabled
krcSubdeviceCtrlGetErrorInfoCheckPermissions(struct KernelRc * pKernelRc,struct Subdevice * pSubdevice)231 static inline NV_STATUS krcSubdeviceCtrlGetErrorInfoCheckPermissions(struct KernelRc *pKernelRc, struct Subdevice *pSubdevice) {
232     NV_ASSERT_FAILED_PRECOMP("KernelRc was disabled!");
233     return NV_ERR_NOT_SUPPORTED;
234 }
235 #else //__nvoc_kernel_rc_h_disabled
236 #define krcSubdeviceCtrlGetErrorInfoCheckPermissions(pKernelRc, pSubdevice) krcSubdeviceCtrlGetErrorInfoCheckPermissions_KERNEL(pKernelRc, pSubdevice)
237 #endif //__nvoc_kernel_rc_h_disabled
238 
239 #define krcSubdeviceCtrlGetErrorInfoCheckPermissions_HAL(pKernelRc, pSubdevice) krcSubdeviceCtrlGetErrorInfoCheckPermissions(pKernelRc, pSubdevice)
240 
241 NV_STATUS krcCheckBusError_KERNEL(struct OBJGPU *pGpu, struct KernelRc *pKernelRc);
242 
243 
244 #ifdef __nvoc_kernel_rc_h_disabled
krcCheckBusError(struct OBJGPU * pGpu,struct KernelRc * pKernelRc)245 static inline NV_STATUS krcCheckBusError(struct OBJGPU *pGpu, struct KernelRc *pKernelRc) {
246     NV_ASSERT_FAILED_PRECOMP("KernelRc was disabled!");
247     return NV_ERR_NOT_SUPPORTED;
248 }
249 #else //__nvoc_kernel_rc_h_disabled
250 #define krcCheckBusError(pGpu, pKernelRc) krcCheckBusError_KERNEL(pGpu, pKernelRc)
251 #endif //__nvoc_kernel_rc_h_disabled
252 
253 #define krcCheckBusError_HAL(pGpu, pKernelRc) krcCheckBusError(pGpu, pKernelRc)
254 
255 NV_STATUS krcCliresCtrlNvdGetRcerrRptCheckPermissions_KERNEL(struct KernelRc *pKernelRc, struct RmClientResource *pRmCliRes, NV0000_CTRL_CMD_NVD_GET_RCERR_RPT_PARAMS *pReportParams);
256 
257 
258 #ifdef __nvoc_kernel_rc_h_disabled
krcCliresCtrlNvdGetRcerrRptCheckPermissions(struct KernelRc * pKernelRc,struct RmClientResource * pRmCliRes,NV0000_CTRL_CMD_NVD_GET_RCERR_RPT_PARAMS * pReportParams)259 static inline NV_STATUS krcCliresCtrlNvdGetRcerrRptCheckPermissions(struct KernelRc *pKernelRc, struct RmClientResource *pRmCliRes, NV0000_CTRL_CMD_NVD_GET_RCERR_RPT_PARAMS *pReportParams) {
260     NV_ASSERT_FAILED_PRECOMP("KernelRc was disabled!");
261     return NV_ERR_NOT_SUPPORTED;
262 }
263 #else //__nvoc_kernel_rc_h_disabled
264 #define krcCliresCtrlNvdGetRcerrRptCheckPermissions(pKernelRc, pRmCliRes, pReportParams) krcCliresCtrlNvdGetRcerrRptCheckPermissions_KERNEL(pKernelRc, pRmCliRes, pReportParams)
265 #endif //__nvoc_kernel_rc_h_disabled
266 
267 #define krcCliresCtrlNvdGetRcerrRptCheckPermissions_HAL(pKernelRc, pRmCliRes, pReportParams) krcCliresCtrlNvdGetRcerrRptCheckPermissions(pKernelRc, pRmCliRes, pReportParams)
268 
269 NV_STATUS krcWatchdogInit_IMPL(struct OBJGPU *pGpu, struct KernelRc *pKernelRc);
270 
271 
272 #ifdef __nvoc_kernel_rc_h_disabled
krcWatchdogInit(struct OBJGPU * pGpu,struct KernelRc * pKernelRc)273 static inline NV_STATUS krcWatchdogInit(struct OBJGPU *pGpu, struct KernelRc *pKernelRc) {
274     NV_ASSERT_FAILED_PRECOMP("KernelRc was disabled!");
275     return NV_ERR_NOT_SUPPORTED;
276 }
277 #else //__nvoc_kernel_rc_h_disabled
278 #define krcWatchdogInit(pGpu, pKernelRc) krcWatchdogInit_IMPL(pGpu, pKernelRc)
279 #endif //__nvoc_kernel_rc_h_disabled
280 
281 #define krcWatchdogInit_HAL(pGpu, pKernelRc) krcWatchdogInit(pGpu, pKernelRc)
282 
283 void krcWatchdogInitPushbuffer_IMPL(struct OBJGPU *pGpu, struct KernelRc *pKernelRc);
284 
285 
286 #ifdef __nvoc_kernel_rc_h_disabled
krcWatchdogInitPushbuffer(struct OBJGPU * pGpu,struct KernelRc * pKernelRc)287 static inline void krcWatchdogInitPushbuffer(struct OBJGPU *pGpu, struct KernelRc *pKernelRc) {
288     NV_ASSERT_FAILED_PRECOMP("KernelRc was disabled!");
289 }
290 #else //__nvoc_kernel_rc_h_disabled
291 #define krcWatchdogInitPushbuffer(pGpu, pKernelRc) krcWatchdogInitPushbuffer_IMPL(pGpu, pKernelRc)
292 #endif //__nvoc_kernel_rc_h_disabled
293 
294 #define krcWatchdogInitPushbuffer_HAL(pGpu, pKernelRc) krcWatchdogInitPushbuffer(pGpu, pKernelRc)
295 
296 void krcWatchdog_IMPL(struct OBJGPU *pGpu, struct KernelRc *pKernelRc);
297 
298 
299 #ifdef __nvoc_kernel_rc_h_disabled
krcWatchdog(struct OBJGPU * pGpu,struct KernelRc * pKernelRc)300 static inline void krcWatchdog(struct OBJGPU *pGpu, struct KernelRc *pKernelRc) {
301     NV_ASSERT_FAILED_PRECOMP("KernelRc was disabled!");
302 }
303 #else //__nvoc_kernel_rc_h_disabled
304 #define krcWatchdog(pGpu, pKernelRc) krcWatchdog_IMPL(pGpu, pKernelRc)
305 #endif //__nvoc_kernel_rc_h_disabled
306 
307 #define krcWatchdog_HAL(pGpu, pKernelRc) krcWatchdog(pGpu, pKernelRc)
308 
krcWatchdogCallbackPerf_b3696a(struct OBJGPU * pGpu,struct KernelRc * pKernelRc)309 static inline void krcWatchdogCallbackPerf_b3696a(struct OBJGPU *pGpu, struct KernelRc *pKernelRc) {
310     return;
311 }
312 
313 
314 #ifdef __nvoc_kernel_rc_h_disabled
krcWatchdogCallbackPerf(struct OBJGPU * pGpu,struct KernelRc * pKernelRc)315 static inline void krcWatchdogCallbackPerf(struct OBJGPU *pGpu, struct KernelRc *pKernelRc) {
316     NV_ASSERT_FAILED_PRECOMP("KernelRc was disabled!");
317 }
318 #else //__nvoc_kernel_rc_h_disabled
319 #define krcWatchdogCallbackPerf(pGpu, pKernelRc) krcWatchdogCallbackPerf_b3696a(pGpu, pKernelRc)
320 #endif //__nvoc_kernel_rc_h_disabled
321 
322 #define krcWatchdogCallbackPerf_HAL(pGpu, pKernelRc) krcWatchdogCallbackPerf(pGpu, pKernelRc)
323 
324 NV_STATUS krcConstructEngine_IMPL(struct OBJGPU *pGpu, struct KernelRc *pKernelRc, ENGDESCRIPTOR engDescriptor);
325 
krcConstructEngine_DISPATCH(struct OBJGPU * pGpu,struct KernelRc * pKernelRc,ENGDESCRIPTOR engDescriptor)326 static inline NV_STATUS krcConstructEngine_DISPATCH(struct OBJGPU *pGpu, struct KernelRc *pKernelRc, ENGDESCRIPTOR engDescriptor) {
327     return pKernelRc->__krcConstructEngine__(pGpu, pKernelRc, engDescriptor);
328 }
329 
krcWatchdogRecovery_f2d351(struct OBJGPU * pGpu,struct KernelRc * pKernelRc)330 static inline void krcWatchdogRecovery_f2d351(struct OBJGPU *pGpu, struct KernelRc *pKernelRc) {
331     NV_ASSERT_PRECOMP(0);
332 }
333 
334 void krcWatchdogRecovery_KERNEL(struct OBJGPU *pGpu, struct KernelRc *pKernelRc);
335 
krcWatchdogRecovery_DISPATCH(struct OBJGPU * pGpu,struct KernelRc * pKernelRc)336 static inline void krcWatchdogRecovery_DISPATCH(struct OBJGPU *pGpu, struct KernelRc *pKernelRc) {
337     pKernelRc->__krcWatchdogRecovery__(pGpu, pKernelRc);
338 }
339 
krcStateLoad_DISPATCH(POBJGPU pGpu,struct KernelRc * pEngstate,NvU32 arg0)340 static inline NV_STATUS krcStateLoad_DISPATCH(POBJGPU pGpu, struct KernelRc *pEngstate, NvU32 arg0) {
341     return pEngstate->__krcStateLoad__(pGpu, pEngstate, arg0);
342 }
343 
krcStateUnload_DISPATCH(POBJGPU pGpu,struct KernelRc * pEngstate,NvU32 arg0)344 static inline NV_STATUS krcStateUnload_DISPATCH(POBJGPU pGpu, struct KernelRc *pEngstate, NvU32 arg0) {
345     return pEngstate->__krcStateUnload__(pGpu, pEngstate, arg0);
346 }
347 
krcStateInitLocked_DISPATCH(POBJGPU pGpu,struct KernelRc * pEngstate)348 static inline NV_STATUS krcStateInitLocked_DISPATCH(POBJGPU pGpu, struct KernelRc *pEngstate) {
349     return pEngstate->__krcStateInitLocked__(pGpu, pEngstate);
350 }
351 
krcStatePreLoad_DISPATCH(POBJGPU pGpu,struct KernelRc * pEngstate,NvU32 arg0)352 static inline NV_STATUS krcStatePreLoad_DISPATCH(POBJGPU pGpu, struct KernelRc *pEngstate, NvU32 arg0) {
353     return pEngstate->__krcStatePreLoad__(pGpu, pEngstate, arg0);
354 }
355 
krcStatePostUnload_DISPATCH(POBJGPU pGpu,struct KernelRc * pEngstate,NvU32 arg0)356 static inline NV_STATUS krcStatePostUnload_DISPATCH(POBJGPU pGpu, struct KernelRc *pEngstate, NvU32 arg0) {
357     return pEngstate->__krcStatePostUnload__(pGpu, pEngstate, arg0);
358 }
359 
krcStateDestroy_DISPATCH(POBJGPU pGpu,struct KernelRc * pEngstate)360 static inline void krcStateDestroy_DISPATCH(POBJGPU pGpu, struct KernelRc *pEngstate) {
361     pEngstate->__krcStateDestroy__(pGpu, pEngstate);
362 }
363 
krcStatePreUnload_DISPATCH(POBJGPU pGpu,struct KernelRc * pEngstate,NvU32 arg0)364 static inline NV_STATUS krcStatePreUnload_DISPATCH(POBJGPU pGpu, struct KernelRc *pEngstate, NvU32 arg0) {
365     return pEngstate->__krcStatePreUnload__(pGpu, pEngstate, arg0);
366 }
367 
krcStateInitUnlocked_DISPATCH(POBJGPU pGpu,struct KernelRc * pEngstate)368 static inline NV_STATUS krcStateInitUnlocked_DISPATCH(POBJGPU pGpu, struct KernelRc *pEngstate) {
369     return pEngstate->__krcStateInitUnlocked__(pGpu, pEngstate);
370 }
371 
krcInitMissing_DISPATCH(POBJGPU pGpu,struct KernelRc * pEngstate)372 static inline void krcInitMissing_DISPATCH(POBJGPU pGpu, struct KernelRc *pEngstate) {
373     pEngstate->__krcInitMissing__(pGpu, pEngstate);
374 }
375 
krcStatePreInitLocked_DISPATCH(POBJGPU pGpu,struct KernelRc * pEngstate)376 static inline NV_STATUS krcStatePreInitLocked_DISPATCH(POBJGPU pGpu, struct KernelRc *pEngstate) {
377     return pEngstate->__krcStatePreInitLocked__(pGpu, pEngstate);
378 }
379 
krcStatePreInitUnlocked_DISPATCH(POBJGPU pGpu,struct KernelRc * pEngstate)380 static inline NV_STATUS krcStatePreInitUnlocked_DISPATCH(POBJGPU pGpu, struct KernelRc *pEngstate) {
381     return pEngstate->__krcStatePreInitUnlocked__(pGpu, pEngstate);
382 }
383 
krcStatePostLoad_DISPATCH(POBJGPU pGpu,struct KernelRc * pEngstate,NvU32 arg0)384 static inline NV_STATUS krcStatePostLoad_DISPATCH(POBJGPU pGpu, struct KernelRc *pEngstate, NvU32 arg0) {
385     return pEngstate->__krcStatePostLoad__(pGpu, pEngstate, arg0);
386 }
387 
krcIsPresent_DISPATCH(POBJGPU pGpu,struct KernelRc * pEngstate)388 static inline NvBool krcIsPresent_DISPATCH(POBJGPU pGpu, struct KernelRc *pEngstate) {
389     return pEngstate->__krcIsPresent__(pGpu, pEngstate);
390 }
391 
392 void krcInitRegistryOverridesDelayed_IMPL(struct OBJGPU *pGpu, struct KernelRc *pKernelRc);
393 
394 #ifdef __nvoc_kernel_rc_h_disabled
krcInitRegistryOverridesDelayed(struct OBJGPU * pGpu,struct KernelRc * pKernelRc)395 static inline void krcInitRegistryOverridesDelayed(struct OBJGPU *pGpu, struct KernelRc *pKernelRc) {
396     NV_ASSERT_FAILED_PRECOMP("KernelRc was disabled!");
397 }
398 #else //__nvoc_kernel_rc_h_disabled
399 #define krcInitRegistryOverridesDelayed(pGpu, pKernelRc) krcInitRegistryOverridesDelayed_IMPL(pGpu, pKernelRc)
400 #endif //__nvoc_kernel_rc_h_disabled
401 
402 NV_STATUS krcErrorSetNotifier_IMPL(struct OBJGPU *pGpu, struct KernelRc *pKernelRc, struct KernelChannel *pKernelChannel, NvU32 exceptType, RM_ENGINE_TYPE nv2080EngineType, RC_NOTIFIER_SCOPE scope);
403 
404 #ifdef __nvoc_kernel_rc_h_disabled
krcErrorSetNotifier(struct OBJGPU * pGpu,struct KernelRc * pKernelRc,struct KernelChannel * pKernelChannel,NvU32 exceptType,RM_ENGINE_TYPE nv2080EngineType,RC_NOTIFIER_SCOPE scope)405 static inline NV_STATUS krcErrorSetNotifier(struct OBJGPU *pGpu, struct KernelRc *pKernelRc, struct KernelChannel *pKernelChannel, NvU32 exceptType, RM_ENGINE_TYPE nv2080EngineType, RC_NOTIFIER_SCOPE scope) {
406     NV_ASSERT_FAILED_PRECOMP("KernelRc was disabled!");
407     return NV_ERR_NOT_SUPPORTED;
408 }
409 #else //__nvoc_kernel_rc_h_disabled
410 #define krcErrorSetNotifier(pGpu, pKernelRc, pKernelChannel, exceptType, nv2080EngineType, scope) krcErrorSetNotifier_IMPL(pGpu, pKernelRc, pKernelChannel, exceptType, nv2080EngineType, scope)
411 #endif //__nvoc_kernel_rc_h_disabled
412 
413 NV_STATUS krcReadVirtMem_IMPL(struct OBJGPU *pGpu, struct KernelRc *pKernelRc, struct KernelChannel *pKernelChannel, NvU64 virtAddr, NvP64 bufPtr, NvU32 bufSize);
414 
415 #ifdef __nvoc_kernel_rc_h_disabled
krcReadVirtMem(struct OBJGPU * pGpu,struct KernelRc * pKernelRc,struct KernelChannel * pKernelChannel,NvU64 virtAddr,NvP64 bufPtr,NvU32 bufSize)416 static inline NV_STATUS krcReadVirtMem(struct OBJGPU *pGpu, struct KernelRc *pKernelRc, struct KernelChannel *pKernelChannel, NvU64 virtAddr, NvP64 bufPtr, NvU32 bufSize) {
417     NV_ASSERT_FAILED_PRECOMP("KernelRc was disabled!");
418     return NV_ERR_NOT_SUPPORTED;
419 }
420 #else //__nvoc_kernel_rc_h_disabled
421 #define krcReadVirtMem(pGpu, pKernelRc, pKernelChannel, virtAddr, bufPtr, bufSize) krcReadVirtMem_IMPL(pGpu, pKernelRc, pKernelChannel, virtAddr, bufPtr, bufSize)
422 #endif //__nvoc_kernel_rc_h_disabled
423 
424 void krcReportXid_IMPL(struct OBJGPU *pGpu, struct KernelRc *pKernelRc, NvU32 exceptType, const char *pMsg);
425 
426 #ifdef __nvoc_kernel_rc_h_disabled
krcReportXid(struct OBJGPU * pGpu,struct KernelRc * pKernelRc,NvU32 exceptType,const char * pMsg)427 static inline void krcReportXid(struct OBJGPU *pGpu, struct KernelRc *pKernelRc, NvU32 exceptType, const char *pMsg) {
428     NV_ASSERT_FAILED_PRECOMP("KernelRc was disabled!");
429 }
430 #else //__nvoc_kernel_rc_h_disabled
431 #define krcReportXid(pGpu, pKernelRc, exceptType, pMsg) krcReportXid_IMPL(pGpu, pKernelRc, exceptType, pMsg)
432 #endif //__nvoc_kernel_rc_h_disabled
433 
434 NvBool krcTestAllowAlloc_IMPL(struct OBJGPU *pGpu, struct KernelRc *pKernelRc, NvU32 failMask);
435 
436 #ifdef __nvoc_kernel_rc_h_disabled
krcTestAllowAlloc(struct OBJGPU * pGpu,struct KernelRc * pKernelRc,NvU32 failMask)437 static inline NvBool krcTestAllowAlloc(struct OBJGPU *pGpu, struct KernelRc *pKernelRc, NvU32 failMask) {
438     NV_ASSERT_FAILED_PRECOMP("KernelRc was disabled!");
439     return NV_FALSE;
440 }
441 #else //__nvoc_kernel_rc_h_disabled
442 #define krcTestAllowAlloc(pGpu, pKernelRc, failMask) krcTestAllowAlloc_IMPL(pGpu, pKernelRc, failMask)
443 #endif //__nvoc_kernel_rc_h_disabled
444 
445 NvBool krcErrorInvokeCallback_IMPL(struct OBJGPU *pGpu, struct KernelRc *pKernelRc, struct KernelChannel *pKernelChannel, FIFO_MMU_EXCEPTION_DATA *pMmuExceptionData, NvU32 exceptType, NvU32 exceptLevel, RM_ENGINE_TYPE rmEngineType, NvU32 rcDiagStart);
446 
447 #ifdef __nvoc_kernel_rc_h_disabled
krcErrorInvokeCallback(struct OBJGPU * pGpu,struct KernelRc * pKernelRc,struct KernelChannel * pKernelChannel,FIFO_MMU_EXCEPTION_DATA * pMmuExceptionData,NvU32 exceptType,NvU32 exceptLevel,RM_ENGINE_TYPE rmEngineType,NvU32 rcDiagStart)448 static inline NvBool krcErrorInvokeCallback(struct OBJGPU *pGpu, struct KernelRc *pKernelRc, struct KernelChannel *pKernelChannel, FIFO_MMU_EXCEPTION_DATA *pMmuExceptionData, NvU32 exceptType, NvU32 exceptLevel, RM_ENGINE_TYPE rmEngineType, NvU32 rcDiagStart) {
449     NV_ASSERT_FAILED_PRECOMP("KernelRc was disabled!");
450     return NV_FALSE;
451 }
452 #else //__nvoc_kernel_rc_h_disabled
453 #define krcErrorInvokeCallback(pGpu, pKernelRc, pKernelChannel, pMmuExceptionData, exceptType, exceptLevel, rmEngineType, rcDiagStart) krcErrorInvokeCallback_IMPL(pGpu, pKernelRc, pKernelChannel, pMmuExceptionData, exceptType, exceptLevel, rmEngineType, rcDiagStart)
454 #endif //__nvoc_kernel_rc_h_disabled
455 
456 NV_STATUS krcSubdeviceCtrlCmdRcGetErrorCount_IMPL(struct KernelRc *pKernelRc, struct Subdevice *pSubdevice, NV2080_CTRL_RC_GET_ERROR_COUNT_PARAMS *pParams);
457 
458 #ifdef __nvoc_kernel_rc_h_disabled
krcSubdeviceCtrlCmdRcGetErrorCount(struct KernelRc * pKernelRc,struct Subdevice * pSubdevice,NV2080_CTRL_RC_GET_ERROR_COUNT_PARAMS * pParams)459 static inline NV_STATUS krcSubdeviceCtrlCmdRcGetErrorCount(struct KernelRc *pKernelRc, struct Subdevice *pSubdevice, NV2080_CTRL_RC_GET_ERROR_COUNT_PARAMS *pParams) {
460     NV_ASSERT_FAILED_PRECOMP("KernelRc was disabled!");
461     return NV_ERR_NOT_SUPPORTED;
462 }
463 #else //__nvoc_kernel_rc_h_disabled
464 #define krcSubdeviceCtrlCmdRcGetErrorCount(pKernelRc, pSubdevice, pParams) krcSubdeviceCtrlCmdRcGetErrorCount_IMPL(pKernelRc, pSubdevice, pParams)
465 #endif //__nvoc_kernel_rc_h_disabled
466 
467 NV_STATUS krcSubdeviceCtrlCmdRcGetErrorV2_IMPL(struct KernelRc *pKernelRc, struct Subdevice *pSubdevice, NV2080_CTRL_RC_GET_ERROR_V2_PARAMS *pParams);
468 
469 #ifdef __nvoc_kernel_rc_h_disabled
krcSubdeviceCtrlCmdRcGetErrorV2(struct KernelRc * pKernelRc,struct Subdevice * pSubdevice,NV2080_CTRL_RC_GET_ERROR_V2_PARAMS * pParams)470 static inline NV_STATUS krcSubdeviceCtrlCmdRcGetErrorV2(struct KernelRc *pKernelRc, struct Subdevice *pSubdevice, NV2080_CTRL_RC_GET_ERROR_V2_PARAMS *pParams) {
471     NV_ASSERT_FAILED_PRECOMP("KernelRc was disabled!");
472     return NV_ERR_NOT_SUPPORTED;
473 }
474 #else //__nvoc_kernel_rc_h_disabled
475 #define krcSubdeviceCtrlCmdRcGetErrorV2(pKernelRc, pSubdevice, pParams) krcSubdeviceCtrlCmdRcGetErrorV2_IMPL(pKernelRc, pSubdevice, pParams)
476 #endif //__nvoc_kernel_rc_h_disabled
477 
478 NV_STATUS krcWatchdogChangeState_IMPL(struct KernelRc *pKernelRc, struct Subdevice *pSubdevice, RC_CHANGE_WATCHDOG_STATE_OPERATION_TYPE operation);
479 
480 #ifdef __nvoc_kernel_rc_h_disabled
krcWatchdogChangeState(struct KernelRc * pKernelRc,struct Subdevice * pSubdevice,RC_CHANGE_WATCHDOG_STATE_OPERATION_TYPE operation)481 static inline NV_STATUS krcWatchdogChangeState(struct KernelRc *pKernelRc, struct Subdevice *pSubdevice, RC_CHANGE_WATCHDOG_STATE_OPERATION_TYPE operation) {
482     NV_ASSERT_FAILED_PRECOMP("KernelRc was disabled!");
483     return NV_ERR_NOT_SUPPORTED;
484 }
485 #else //__nvoc_kernel_rc_h_disabled
486 #define krcWatchdogChangeState(pKernelRc, pSubdevice, operation) krcWatchdogChangeState_IMPL(pKernelRc, pSubdevice, operation)
487 #endif //__nvoc_kernel_rc_h_disabled
488 
489 void krcWatchdogEnable_IMPL(struct KernelRc *pKernelRc, NvBool bOverRide);
490 
491 #ifdef __nvoc_kernel_rc_h_disabled
krcWatchdogEnable(struct KernelRc * pKernelRc,NvBool bOverRide)492 static inline void krcWatchdogEnable(struct KernelRc *pKernelRc, NvBool bOverRide) {
493     NV_ASSERT_FAILED_PRECOMP("KernelRc was disabled!");
494 }
495 #else //__nvoc_kernel_rc_h_disabled
496 #define krcWatchdogEnable(pKernelRc, bOverRide) krcWatchdogEnable_IMPL(pKernelRc, bOverRide)
497 #endif //__nvoc_kernel_rc_h_disabled
498 
499 void krcWatchdogDisable_IMPL(struct KernelRc *pKernelRc);
500 
501 #ifdef __nvoc_kernel_rc_h_disabled
krcWatchdogDisable(struct KernelRc * pKernelRc)502 static inline void krcWatchdogDisable(struct KernelRc *pKernelRc) {
503     NV_ASSERT_FAILED_PRECOMP("KernelRc was disabled!");
504 }
505 #else //__nvoc_kernel_rc_h_disabled
506 #define krcWatchdogDisable(pKernelRc) krcWatchdogDisable_IMPL(pKernelRc)
507 #endif //__nvoc_kernel_rc_h_disabled
508 
509 NV_STATUS krcWatchdogShutdown_IMPL(struct OBJGPU *pGpu, struct KernelRc *pKernelRc);
510 
511 #ifdef __nvoc_kernel_rc_h_disabled
krcWatchdogShutdown(struct OBJGPU * pGpu,struct KernelRc * pKernelRc)512 static inline NV_STATUS krcWatchdogShutdown(struct OBJGPU *pGpu, struct KernelRc *pKernelRc) {
513     NV_ASSERT_FAILED_PRECOMP("KernelRc was disabled!");
514     return NV_ERR_NOT_SUPPORTED;
515 }
516 #else //__nvoc_kernel_rc_h_disabled
517 #define krcWatchdogShutdown(pGpu, pKernelRc) krcWatchdogShutdown_IMPL(pGpu, pKernelRc)
518 #endif //__nvoc_kernel_rc_h_disabled
519 
520 void krcWatchdogGetReservationCounts_IMPL(struct KernelRc *pKernelRc, NvS32 *pEnable, NvS32 *pDisable, NvS32 *pSoftDisable);
521 
522 #ifdef __nvoc_kernel_rc_h_disabled
krcWatchdogGetReservationCounts(struct KernelRc * pKernelRc,NvS32 * pEnable,NvS32 * pDisable,NvS32 * pSoftDisable)523 static inline void krcWatchdogGetReservationCounts(struct KernelRc *pKernelRc, NvS32 *pEnable, NvS32 *pDisable, NvS32 *pSoftDisable) {
524     NV_ASSERT_FAILED_PRECOMP("KernelRc was disabled!");
525 }
526 #else //__nvoc_kernel_rc_h_disabled
527 #define krcWatchdogGetReservationCounts(pKernelRc, pEnable, pDisable, pSoftDisable) krcWatchdogGetReservationCounts_IMPL(pKernelRc, pEnable, pDisable, pSoftDisable)
528 #endif //__nvoc_kernel_rc_h_disabled
529 
530 void krcWatchdogWriteNotifierToGpfifo_IMPL(struct OBJGPU *pGpu, struct KernelRc *pKernelRc);
531 
532 #ifdef __nvoc_kernel_rc_h_disabled
krcWatchdogWriteNotifierToGpfifo(struct OBJGPU * pGpu,struct KernelRc * pKernelRc)533 static inline void krcWatchdogWriteNotifierToGpfifo(struct OBJGPU *pGpu, struct KernelRc *pKernelRc) {
534     NV_ASSERT_FAILED_PRECOMP("KernelRc was disabled!");
535 }
536 #else //__nvoc_kernel_rc_h_disabled
537 #define krcWatchdogWriteNotifierToGpfifo(pGpu, pKernelRc) krcWatchdogWriteNotifierToGpfifo_IMPL(pGpu, pKernelRc)
538 #endif //__nvoc_kernel_rc_h_disabled
539 
540 void krcWatchdogCallbackVblankRecovery_IMPL(struct OBJGPU *pGpu, struct KernelRc *pKernelRc);
541 
542 #ifdef __nvoc_kernel_rc_h_disabled
krcWatchdogCallbackVblankRecovery(struct OBJGPU * pGpu,struct KernelRc * pKernelRc)543 static inline void krcWatchdogCallbackVblankRecovery(struct OBJGPU *pGpu, struct KernelRc *pKernelRc) {
544     NV_ASSERT_FAILED_PRECOMP("KernelRc was disabled!");
545 }
546 #else //__nvoc_kernel_rc_h_disabled
547 #define krcWatchdogCallbackVblankRecovery(pGpu, pKernelRc) krcWatchdogCallbackVblankRecovery_IMPL(pGpu, pKernelRc)
548 #endif //__nvoc_kernel_rc_h_disabled
549 
550 NV_STATUS krcWatchdogGetClientHandle_IMPL(struct KernelRc *arg0, NvHandle *arg1);
551 
552 #ifdef __nvoc_kernel_rc_h_disabled
krcWatchdogGetClientHandle(struct KernelRc * arg0,NvHandle * arg1)553 static inline NV_STATUS krcWatchdogGetClientHandle(struct KernelRc *arg0, NvHandle *arg1) {
554     NV_ASSERT_FAILED_PRECOMP("KernelRc was disabled!");
555     return NV_ERR_NOT_SUPPORTED;
556 }
557 #else //__nvoc_kernel_rc_h_disabled
558 #define krcWatchdogGetClientHandle(arg0, arg1) krcWatchdogGetClientHandle_IMPL(arg0, arg1)
559 #endif //__nvoc_kernel_rc_h_disabled
560 
561 #undef PRIVATE_FIELD
562 
563 
564 
565 /*! Actual callback funtion called during RC */
566 NvU32 krcResetCallback(NvHandle hClient,
567                        NvHandle hDevice,
568                        NvHandle hFifo,
569                        NvHandle hChannel,
570                        void    *pContext,
571                        NvBool   bClearRc);
572 
573 
574 /*! Watchdog timer function */
575 void krcWatchdogTimerProc(struct OBJGPU *pGpu, void *);
576 
577 
578 #define krcBreakpoint(pKernelRc)     \
579     {                                \
580         if ((pKernelRc)->bBreakOnRc) \
581         {                            \
582             DBG_BREAKPOINT();        \
583         }                            \
584     }
585 
586 #endif // ifndef KERNEL_RC_H
587 
588 #ifdef __cplusplus
589 } // extern "C"
590 #endif
591 
592 #endif // _G_KERNEL_RC_NVOC_H_
593