1 
2 #ifndef _G_CLIENT_NVOC_H_
3 #define _G_CLIENT_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) 2016-2024 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 #pragma once
39 #include "g_client_nvoc.h"
40 
41 #ifndef _CLIENT_H_
42 #define _CLIENT_H_
43 
44 #include "ctrl/ctrl0000/ctrl0000proc.h" // NV_PROC_NAME_MAX_LENGTH
45 #include "containers/btree.h"
46 #include "resserv/resserv.h"
47 #include "nvoc/prelude.h"
48 #include "resserv/rs_client.h"
49 #include "rmapi/resource.h"
50 #include "rmapi/event.h"
51 #include "nvsecurityinfo.h"
52 
53 // event information definitions
54 typedef struct _def_client_system_event_info CLI_SYSTEM_EVENT_INFO, *PCLI_SYSTEM_EVENT_INFO;
55 
56 /**
57  * This ref-counted object is shared by all clients that were registered under
58  * the same user and is used to identify clients from the same user.
59  */
60 
61 // Private field names are wrapped in PRIVATE_FIELD, which does nothing for
62 // the matching C source file, but causes diagnostics to be issued if another
63 // source file references the field.
64 #ifdef NVOC_CLIENT_H_PRIVATE_ACCESS_ALLOWED
65 #define PRIVATE_FIELD(x) x
66 #else
67 #define PRIVATE_FIELD(x) NVOC_PRIVATE_FIELD(x)
68 #endif
69 
70 
71 struct UserInfo {
72 
73     // Metadata
74     const struct NVOC_RTTI *__nvoc_rtti;
75 
76     // Parent (i.e. superclass or base class) object pointers
77     struct RsShared __nvoc_base_RsShared;
78 
79     // Ancestor object pointers for `staticCast` feature
80     struct Object *__nvoc_pbase_Object;    // obj super^2
81     struct RsShared *__nvoc_pbase_RsShared;    // shr super
82     struct UserInfo *__nvoc_pbase_UserInfo;    // userinfo
83 
84     // Data members
85     PUID_TOKEN pUidToken;
86 };
87 
88 #ifndef __NVOC_CLASS_UserInfo_TYPEDEF__
89 #define __NVOC_CLASS_UserInfo_TYPEDEF__
90 typedef struct UserInfo UserInfo;
91 #endif /* __NVOC_CLASS_UserInfo_TYPEDEF__ */
92 
93 #ifndef __nvoc_class_id_UserInfo
94 #define __nvoc_class_id_UserInfo 0x21d236
95 #endif /* __nvoc_class_id_UserInfo */
96 
97 // Casting support
98 extern const struct NVOC_CLASS_DEF __nvoc_class_def_UserInfo;
99 
100 #define __staticCast_UserInfo(pThis) \
101     ((pThis)->__nvoc_pbase_UserInfo)
102 
103 #ifdef __nvoc_client_h_disabled
104 #define __dynamicCast_UserInfo(pThis) ((UserInfo*)NULL)
105 #else //__nvoc_client_h_disabled
106 #define __dynamicCast_UserInfo(pThis) \
107     ((UserInfo*)__nvoc_dynamicCast(staticCast((pThis), Dynamic), classInfo(UserInfo)))
108 #endif //__nvoc_client_h_disabled
109 
110 NV_STATUS __nvoc_objCreateDynamic_UserInfo(UserInfo**, Dynamic*, NvU32, va_list);
111 
112 NV_STATUS __nvoc_objCreate_UserInfo(UserInfo**, Dynamic*, NvU32);
113 #define __objCreate_UserInfo(ppNewObj, pParent, createFlags) \
114     __nvoc_objCreate_UserInfo((ppNewObj), staticCast((pParent), Dynamic), (createFlags))
115 
116 
117 // Wrapper macros
118 
119 // Dispatch functions
120 NV_STATUS userinfoConstruct_IMPL(struct UserInfo *arg_pUserInfo);
121 
122 #define __nvoc_userinfoConstruct(arg_pUserInfo) userinfoConstruct_IMPL(arg_pUserInfo)
123 void userinfoDestruct_IMPL(struct UserInfo *pUserInfo);
124 
125 #define __nvoc_userinfoDestruct(pUserInfo) userinfoDestruct_IMPL(pUserInfo)
126 #undef PRIVATE_FIELD
127 
128 
129 // Flags for RmClient
130 #define RMAPI_CLIENT_FLAG_RM_INTERNAL_CLIENT                     0x00000001
131 #define RMAPI_CLIENT_FLAG_DELETE_PENDING                         0x00000002
132 
133 // Values for client debugger state
134 #define RMAPI_CLIENT_DEBUGGER_STATE_NOT_SET                      0x00000000
135 #define RMAPI_CLIENT_DEBUGGER_STATE_COMPUTE_ACTIVE               0x00000001
136 #define RMAPI_CLIENT_DEBUGGER_STATE_DEBUG_ACTIVE                 0x00000002
137 
138 
139 // Private field names are wrapped in PRIVATE_FIELD, which does nothing for
140 // the matching C source file, but causes diagnostics to be issued if another
141 // source file references the field.
142 #ifdef NVOC_CLIENT_H_PRIVATE_ACCESS_ALLOWED
143 #define PRIVATE_FIELD(x) x
144 #else
145 #define PRIVATE_FIELD(x) NVOC_PRIVATE_FIELD(x)
146 #endif
147 
148 
149 // Metadata including vtable
150 struct NVOC_VTABLE__RmClient;
151 
152 
153 struct RmClient {
154 
155     // Metadata
156     const struct NVOC_RTTI *__nvoc_rtti;
157     const struct NVOC_VTABLE__RmClient *__nvoc_vtable;
158 
159     // Parent (i.e. superclass or base class) object pointers
160     struct RsClient __nvoc_base_RsClient;
161 
162     // Ancestor object pointers for `staticCast` feature
163     struct Object *__nvoc_pbase_Object;    // obj super^2
164     struct RsClient *__nvoc_pbase_RsClient;    // client super
165     struct RmClient *__nvoc_pbase_RmClient;    // rmclient
166 
167     // Data members
168     RS_PRIV_LEVEL cachedPrivilege;
169     NvBool bIsRootNonPriv;
170     NvU32 ProcID;
171     NvU32 SubProcessID;
172     char SubProcessName[100];
173     NvBool bIsSubProcessDisabled;
174     NvU32 Flags;
175     NvU32 ClientDebuggerState;
176     void *pOSInfo;
177     void *pOsPidInfo;
178     char name[100];
179     CLI_SYSTEM_EVENT_INFO CliSysEventInfo;
180     PSECURITY_TOKEN pSecurityToken;
181     struct UserInfo *pUserInfo;
182     NvBool bIsClientVirtualMode;
183     NvS32 imexChannel;
184     PNODE pCliSyncGpuBoostTree;
185     NvS32 lockStressCounter;
186 };
187 
188 
189 // Metadata including vtable with 12 function pointers plus superclass metadata
190 struct NVOC_VTABLE__RmClient {
191     const struct NVOC_VTABLE__RsClient RsClient;    // (client) 12 function pointers
192 
193     NV_STATUS (*__rmclientValidate__)(struct RmClient * /*this*/, const API_SECURITY_INFO *);  // virtual override (client) base (client)
194     NV_STATUS (*__rmclientValidateLocks__)(struct RmClient * /*this*/, struct RsServer *, const struct CLIENT_ENTRY *);  // virtual override (client) base (client)
195     NV_STATUS (*__rmclientFreeResource__)(struct RmClient * /*this*/, struct RsServer *, struct RS_RES_FREE_PARAMS_INTERNAL *);  // virtual override (client) base (client)
196     NV_STATUS (*__rmclientInterMap__)(struct RmClient * /*this*/, struct RsResourceRef *, struct RsResourceRef *, struct RS_INTER_MAP_PARAMS *);  // virtual override (client) base (client)
197     NV_STATUS (*__rmclientInterUnmap__)(struct RmClient * /*this*/, struct RsResourceRef *, struct RS_INTER_UNMAP_PARAMS *);  // virtual override (client) base (client)
198     NV_STATUS (*__rmclientPostProcessPendingFreeList__)(struct RmClient * /*this*/, struct RsResourceRef **);  // virtual override (client) base (client)
199     RS_PRIV_LEVEL (*__rmclientGetCachedPrivilege__)(struct RmClient * /*this*/);  // virtual override (client) base (client)
200     NvBool (*__rmclientIsAdmin__)(struct RmClient * /*this*/, RS_PRIV_LEVEL);  // virtual override (client) base (client)
201     NV_STATUS (*__rmclientDestructResourceRef__)(struct RmClient * /*this*/, RsServer *, struct RsResourceRef *);  // virtual inherited (client) base (client)
202     NV_STATUS (*__rmclientUnmapMemory__)(struct RmClient * /*this*/, struct RsResourceRef *, struct RS_LOCK_INFO *, struct RsCpuMapping **, API_SECURITY_INFO *);  // virtual inherited (client) base (client)
203     NV_STATUS (*__rmclientValidateNewResourceHandle__)(struct RmClient * /*this*/, NvHandle, NvBool);  // virtual inherited (client) base (client)
204     NV_STATUS (*__rmclientShareResource__)(struct RmClient * /*this*/, struct RsResourceRef *, RS_SHARE_POLICY *, struct CALL_CONTEXT *);  // virtual inherited (client) base (client)
205 };
206 
207 #ifndef __NVOC_CLASS_RmClient_TYPEDEF__
208 #define __NVOC_CLASS_RmClient_TYPEDEF__
209 typedef struct RmClient RmClient;
210 #endif /* __NVOC_CLASS_RmClient_TYPEDEF__ */
211 
212 #ifndef __nvoc_class_id_RmClient
213 #define __nvoc_class_id_RmClient 0xb23d83
214 #endif /* __nvoc_class_id_RmClient */
215 
216 // Casting support
217 extern const struct NVOC_CLASS_DEF __nvoc_class_def_RmClient;
218 
219 #define __staticCast_RmClient(pThis) \
220     ((pThis)->__nvoc_pbase_RmClient)
221 
222 #ifdef __nvoc_client_h_disabled
223 #define __dynamicCast_RmClient(pThis) ((RmClient*)NULL)
224 #else //__nvoc_client_h_disabled
225 #define __dynamicCast_RmClient(pThis) \
226     ((RmClient*)__nvoc_dynamicCast(staticCast((pThis), Dynamic), classInfo(RmClient)))
227 #endif //__nvoc_client_h_disabled
228 
229 NV_STATUS __nvoc_objCreateDynamic_RmClient(RmClient**, Dynamic*, NvU32, va_list);
230 
231 NV_STATUS __nvoc_objCreate_RmClient(RmClient**, Dynamic*, NvU32, struct PORT_MEM_ALLOCATOR * arg_pAllocator, struct RS_RES_ALLOC_PARAMS_INTERNAL * arg_pParams);
232 #define __objCreate_RmClient(ppNewObj, pParent, createFlags, arg_pAllocator, arg_pParams) \
233     __nvoc_objCreate_RmClient((ppNewObj), staticCast((pParent), Dynamic), (createFlags), arg_pAllocator, arg_pParams)
234 
235 
236 // Wrapper macros
237 #define rmclientValidate_FNPTR(pClient) pClient->__nvoc_vtable->__rmclientValidate__
238 #define rmclientValidate(pClient, pSecInfo) rmclientValidate_DISPATCH(pClient, pSecInfo)
239 #define rmclientValidateLocks_FNPTR(pClient) pClient->__nvoc_vtable->__rmclientValidateLocks__
240 #define rmclientValidateLocks(pClient, pServer, pClientEntry) rmclientValidateLocks_DISPATCH(pClient, pServer, pClientEntry)
241 #define rmclientFreeResource_FNPTR(pClient) pClient->__nvoc_vtable->__rmclientFreeResource__
242 #define rmclientFreeResource(pClient, pServer, pParams) rmclientFreeResource_DISPATCH(pClient, pServer, pParams)
243 #define rmclientInterMap_FNPTR(pClient) pClient->__nvoc_vtable->__rmclientInterMap__
244 #define rmclientInterMap(pClient, pMapperRef, pMappableRef, pParams) rmclientInterMap_DISPATCH(pClient, pMapperRef, pMappableRef, pParams)
245 #define rmclientInterUnmap_FNPTR(pClient) pClient->__nvoc_vtable->__rmclientInterUnmap__
246 #define rmclientInterUnmap(pClient, pMapperRef, pParams) rmclientInterUnmap_DISPATCH(pClient, pMapperRef, pParams)
247 #define rmclientPostProcessPendingFreeList_FNPTR(pClient) pClient->__nvoc_vtable->__rmclientPostProcessPendingFreeList__
248 #define rmclientPostProcessPendingFreeList(pClient, ppFirstLowPriRef) rmclientPostProcessPendingFreeList_DISPATCH(pClient, ppFirstLowPriRef)
249 #define rmclientGetCachedPrivilege_FNPTR(pClient) pClient->__nvoc_vtable->__rmclientGetCachedPrivilege__
250 #define rmclientGetCachedPrivilege(pClient) rmclientGetCachedPrivilege_DISPATCH(pClient)
251 #define rmclientIsAdmin_FNPTR(pClient) pClient->__nvoc_vtable->__rmclientIsAdmin__
252 #define rmclientIsAdmin(pClient, privLevel) rmclientIsAdmin_DISPATCH(pClient, privLevel)
253 #define rmclientDestructResourceRef_FNPTR(pClient) pClient->__nvoc_base_RsClient.__nvoc_vtable->__clientDestructResourceRef__
254 #define rmclientDestructResourceRef(pClient, pServer, pResourceRef) rmclientDestructResourceRef_DISPATCH(pClient, pServer, pResourceRef)
255 #define rmclientUnmapMemory_FNPTR(pClient) pClient->__nvoc_base_RsClient.__nvoc_vtable->__clientUnmapMemory__
256 #define rmclientUnmapMemory(pClient, pResourceRef, pLockInfo, ppCpuMapping, pSecInfo) rmclientUnmapMemory_DISPATCH(pClient, pResourceRef, pLockInfo, ppCpuMapping, pSecInfo)
257 #define rmclientValidateNewResourceHandle_FNPTR(pClient) pClient->__nvoc_base_RsClient.__nvoc_vtable->__clientValidateNewResourceHandle__
258 #define rmclientValidateNewResourceHandle(pClient, hResource, bRestrict) rmclientValidateNewResourceHandle_DISPATCH(pClient, hResource, bRestrict)
259 #define rmclientShareResource_FNPTR(pClient) pClient->__nvoc_base_RsClient.__nvoc_vtable->__clientShareResource__
260 #define rmclientShareResource(pClient, pResourceRef, pSharePolicy, pCallContext) rmclientShareResource_DISPATCH(pClient, pResourceRef, pSharePolicy, pCallContext)
261 
262 // Dispatch functions
rmclientValidate_DISPATCH(struct RmClient * pClient,const API_SECURITY_INFO * pSecInfo)263 static inline NV_STATUS rmclientValidate_DISPATCH(struct RmClient *pClient, const API_SECURITY_INFO *pSecInfo) {
264     return pClient->__nvoc_vtable->__rmclientValidate__(pClient, pSecInfo);
265 }
266 
rmclientValidateLocks_DISPATCH(struct RmClient * pClient,struct RsServer * pServer,const struct CLIENT_ENTRY * pClientEntry)267 static inline NV_STATUS rmclientValidateLocks_DISPATCH(struct RmClient *pClient, struct RsServer *pServer, const struct CLIENT_ENTRY *pClientEntry) {
268     return pClient->__nvoc_vtable->__rmclientValidateLocks__(pClient, pServer, pClientEntry);
269 }
270 
rmclientFreeResource_DISPATCH(struct RmClient * pClient,struct RsServer * pServer,struct RS_RES_FREE_PARAMS_INTERNAL * pParams)271 static inline NV_STATUS rmclientFreeResource_DISPATCH(struct RmClient *pClient, struct RsServer *pServer, struct RS_RES_FREE_PARAMS_INTERNAL *pParams) {
272     return pClient->__nvoc_vtable->__rmclientFreeResource__(pClient, pServer, pParams);
273 }
274 
rmclientInterMap_DISPATCH(struct RmClient * pClient,struct RsResourceRef * pMapperRef,struct RsResourceRef * pMappableRef,struct RS_INTER_MAP_PARAMS * pParams)275 static inline NV_STATUS rmclientInterMap_DISPATCH(struct RmClient *pClient, struct RsResourceRef *pMapperRef, struct RsResourceRef *pMappableRef, struct RS_INTER_MAP_PARAMS *pParams) {
276     return pClient->__nvoc_vtable->__rmclientInterMap__(pClient, pMapperRef, pMappableRef, pParams);
277 }
278 
rmclientInterUnmap_DISPATCH(struct RmClient * pClient,struct RsResourceRef * pMapperRef,struct RS_INTER_UNMAP_PARAMS * pParams)279 static inline NV_STATUS rmclientInterUnmap_DISPATCH(struct RmClient *pClient, struct RsResourceRef *pMapperRef, struct RS_INTER_UNMAP_PARAMS *pParams) {
280     return pClient->__nvoc_vtable->__rmclientInterUnmap__(pClient, pMapperRef, pParams);
281 }
282 
rmclientPostProcessPendingFreeList_DISPATCH(struct RmClient * pClient,struct RsResourceRef ** ppFirstLowPriRef)283 static inline NV_STATUS rmclientPostProcessPendingFreeList_DISPATCH(struct RmClient *pClient, struct RsResourceRef **ppFirstLowPriRef) {
284     return pClient->__nvoc_vtable->__rmclientPostProcessPendingFreeList__(pClient, ppFirstLowPriRef);
285 }
286 
rmclientGetCachedPrivilege_DISPATCH(struct RmClient * pClient)287 static inline RS_PRIV_LEVEL rmclientGetCachedPrivilege_DISPATCH(struct RmClient *pClient) {
288     return pClient->__nvoc_vtable->__rmclientGetCachedPrivilege__(pClient);
289 }
290 
rmclientIsAdmin_DISPATCH(struct RmClient * pClient,RS_PRIV_LEVEL privLevel)291 static inline NvBool rmclientIsAdmin_DISPATCH(struct RmClient *pClient, RS_PRIV_LEVEL privLevel) {
292     return pClient->__nvoc_vtable->__rmclientIsAdmin__(pClient, privLevel);
293 }
294 
rmclientDestructResourceRef_DISPATCH(struct RmClient * pClient,RsServer * pServer,struct RsResourceRef * pResourceRef)295 static inline NV_STATUS rmclientDestructResourceRef_DISPATCH(struct RmClient *pClient, RsServer *pServer, struct RsResourceRef *pResourceRef) {
296     return pClient->__nvoc_vtable->__rmclientDestructResourceRef__(pClient, pServer, pResourceRef);
297 }
298 
rmclientUnmapMemory_DISPATCH(struct RmClient * pClient,struct RsResourceRef * pResourceRef,struct RS_LOCK_INFO * pLockInfo,struct RsCpuMapping ** ppCpuMapping,API_SECURITY_INFO * pSecInfo)299 static inline NV_STATUS rmclientUnmapMemory_DISPATCH(struct RmClient *pClient, struct RsResourceRef *pResourceRef, struct RS_LOCK_INFO *pLockInfo, struct RsCpuMapping **ppCpuMapping, API_SECURITY_INFO *pSecInfo) {
300     return pClient->__nvoc_vtable->__rmclientUnmapMemory__(pClient, pResourceRef, pLockInfo, ppCpuMapping, pSecInfo);
301 }
302 
rmclientValidateNewResourceHandle_DISPATCH(struct RmClient * pClient,NvHandle hResource,NvBool bRestrict)303 static inline NV_STATUS rmclientValidateNewResourceHandle_DISPATCH(struct RmClient *pClient, NvHandle hResource, NvBool bRestrict) {
304     return pClient->__nvoc_vtable->__rmclientValidateNewResourceHandle__(pClient, hResource, bRestrict);
305 }
306 
rmclientShareResource_DISPATCH(struct RmClient * pClient,struct RsResourceRef * pResourceRef,RS_SHARE_POLICY * pSharePolicy,struct CALL_CONTEXT * pCallContext)307 static inline NV_STATUS rmclientShareResource_DISPATCH(struct RmClient *pClient, struct RsResourceRef *pResourceRef, RS_SHARE_POLICY *pSharePolicy, struct CALL_CONTEXT *pCallContext) {
308     return pClient->__nvoc_vtable->__rmclientShareResource__(pClient, pResourceRef, pSharePolicy, pCallContext);
309 }
310 
311 NV_STATUS rmclientValidate_IMPL(struct RmClient *pClient, const API_SECURITY_INFO *pSecInfo);
312 
313 NV_STATUS rmclientValidateLocks_IMPL(struct RmClient *pClient, struct RsServer *pServer, const struct CLIENT_ENTRY *pClientEntry);
314 
315 NV_STATUS rmclientFreeResource_IMPL(struct RmClient *pClient, struct RsServer *pServer, struct RS_RES_FREE_PARAMS_INTERNAL *pParams);
316 
317 NV_STATUS rmclientInterMap_IMPL(struct RmClient *pClient, struct RsResourceRef *pMapperRef, struct RsResourceRef *pMappableRef, struct RS_INTER_MAP_PARAMS *pParams);
318 
319 NV_STATUS rmclientInterUnmap_IMPL(struct RmClient *pClient, struct RsResourceRef *pMapperRef, struct RS_INTER_UNMAP_PARAMS *pParams);
320 
321 NV_STATUS rmclientPostProcessPendingFreeList_IMPL(struct RmClient *pClient, struct RsResourceRef **ppFirstLowPriRef);
322 
323 RS_PRIV_LEVEL rmclientGetCachedPrivilege_IMPL(struct RmClient *pClient);
324 
325 NvBool rmclientIsAdmin_IMPL(struct RmClient *pClient, RS_PRIV_LEVEL privLevel);
326 
327 NV_STATUS rmclientConstruct_IMPL(struct RmClient *arg_pClient, struct PORT_MEM_ALLOCATOR *arg_pAllocator, struct RS_RES_ALLOC_PARAMS_INTERNAL *arg_pParams);
328 
329 #define __nvoc_rmclientConstruct(arg_pClient, arg_pAllocator, arg_pParams) rmclientConstruct_IMPL(arg_pClient, arg_pAllocator, arg_pParams)
330 void rmclientDestruct_IMPL(struct RmClient *pClient);
331 
332 #define __nvoc_rmclientDestruct(pClient) rmclientDestruct_IMPL(pClient)
333 void rmclientSetClientFlags_IMPL(struct RmClient *pClient, NvU32 clientFlags);
334 
335 #ifdef __nvoc_client_h_disabled
rmclientSetClientFlags(struct RmClient * pClient,NvU32 clientFlags)336 static inline void rmclientSetClientFlags(struct RmClient *pClient, NvU32 clientFlags) {
337     NV_ASSERT_FAILED_PRECOMP("RmClient was disabled!");
338 }
339 #else //__nvoc_client_h_disabled
340 #define rmclientSetClientFlags(pClient, clientFlags) rmclientSetClientFlags_IMPL(pClient, clientFlags)
341 #endif //__nvoc_client_h_disabled
342 
343 void *rmclientGetSecurityToken_IMPL(struct RmClient *pClient);
344 
345 #ifdef __nvoc_client_h_disabled
rmclientGetSecurityToken(struct RmClient * pClient)346 static inline void *rmclientGetSecurityToken(struct RmClient *pClient) {
347     NV_ASSERT_FAILED_PRECOMP("RmClient was disabled!");
348     return NULL;
349 }
350 #else //__nvoc_client_h_disabled
351 #define rmclientGetSecurityToken(pClient) rmclientGetSecurityToken_IMPL(pClient)
352 #endif //__nvoc_client_h_disabled
353 
354 NvBool rmclientIsCapableOrAdmin_IMPL(struct RmClient *pClient, NvU32 capability, RS_PRIV_LEVEL privLevel);
355 
356 #ifdef __nvoc_client_h_disabled
rmclientIsCapableOrAdmin(struct RmClient * pClient,NvU32 capability,RS_PRIV_LEVEL privLevel)357 static inline NvBool rmclientIsCapableOrAdmin(struct RmClient *pClient, NvU32 capability, RS_PRIV_LEVEL privLevel) {
358     NV_ASSERT_FAILED_PRECOMP("RmClient was disabled!");
359     return NV_FALSE;
360 }
361 #else //__nvoc_client_h_disabled
362 #define rmclientIsCapableOrAdmin(pClient, capability, privLevel) rmclientIsCapableOrAdmin_IMPL(pClient, capability, privLevel)
363 #endif //__nvoc_client_h_disabled
364 
365 NvBool rmclientIsCapable_IMPL(struct RmClient *pClient, NvU32 capability);
366 
367 #ifdef __nvoc_client_h_disabled
rmclientIsCapable(struct RmClient * pClient,NvU32 capability)368 static inline NvBool rmclientIsCapable(struct RmClient *pClient, NvU32 capability) {
369     NV_ASSERT_FAILED_PRECOMP("RmClient was disabled!");
370     return NV_FALSE;
371 }
372 #else //__nvoc_client_h_disabled
373 #define rmclientIsCapable(pClient, capability) rmclientIsCapable_IMPL(pClient, capability)
374 #endif //__nvoc_client_h_disabled
375 
376 #undef PRIVATE_FIELD
377 
378 
379 MAKE_LIST(RmClientList, RmClient*);
380 extern RmClientList g_clientListBehindGpusLock;
381 MAKE_LIST(UserInfoList, UserInfo*);
382 extern UserInfoList g_userInfoList;
383 MAKE_MULTIMAP(OsInfoMap, RmClient*);
384 extern OsInfoMap g_osInfoList;
385 
386 
387 //
388 // Convenience rmclientXxxByHandle util macros. Ideally, code operates on
389 // pClient directly instead of hClient but providing these for compatibility
390 // to hClient-heavy code.
391 //
392 RS_PRIV_LEVEL rmclientGetCachedPrivilegeByHandle(NvHandle hClient);
393 NvBool rmclientIsAdminByHandle(NvHandle hClient, RS_PRIV_LEVEL privLevel);
394 NvBool rmclientIsKernelOnlyByHandle(NvHandle hClient);
395 NvBool rmclientSetClientFlagsByHandle(NvHandle hClient, NvU32 clientFlags);
396 void rmclientPromoteDebuggerStateByHandle(NvHandle hClient, NvU32 newMinimumState);
397 void *rmclientGetSecurityTokenByHandle(NvHandle hClient);
398 NV_STATUS rmclientUserClientSecurityCheckByHandle(NvHandle hClient, const API_SECURITY_INFO *pSecInfo);
399 NvBool rmclientIsCapableOrAdminByHandle(NvHandle hClient, NvU32 capability, RS_PRIV_LEVEL privLevel);
400 
401 #endif
402 
403 #ifdef __cplusplus
404 } // extern "C"
405 #endif
406 
407 #endif // _G_CLIENT_NVOC_H_
408