1 /*
2  * SPDX-FileCopyrightText: Copyright (c) 2021-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3  * SPDX-License-Identifier: MIT
4  *
5  * Permission is hereby granted, free of charge, to any person obtaining a
6  * copy of this software and associated documentation files (the "Software"),
7  * to deal in the Software without restriction, including without limitation
8  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9  * and/or sell copies of the Software, and to permit persons to whom the
10  * Software is furnished to do so, subject to the following conditions:
11  *
12  * The above copyright notice and this permission notice shall be included in
13  * all copies or substantial portions of the Software.
14  *
15  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21  * DEALINGS IN THE SOFTWARE.
22  */
23 
24 #include "g_binary_api_nvoc.h"
25 
26 #ifndef BINARY_API_H
27 #define BINARY_API_H
28 
29 #include "core/core.h"
30 #include "rmapi/resource.h"
31 #include "gpu/gpu_resource.h"
32 #include "resserv/rs_resource.h"
33 #include "rmapi/control.h"
34 
35 NVOC_PREFIX(binapi) class BinaryApi : GpuResource
36 {
37 public:
38     NV_STATUS binapiConstruct(BinaryApi *pResource,
39                               CALL_CONTEXT   *pCallContext,
40                               RS_RES_ALLOC_PARAMS_INTERNAL *pParams) :
41                               GpuResource(pCallContext, pParams);
42 
43     virtual NV_STATUS binapiControl(BinaryApi *pResource, CALL_CONTEXT *pCallContext,
44                                     RS_RES_CONTROL_PARAMS_INTERNAL *pParams);
45 
46 };
47 
48 NVOC_PREFIX(binapipriv) class BinaryApiPrivileged : BinaryApi
49 {
50 public:
51     NV_STATUS binapiprivConstruct(BinaryApiPrivileged *pResource, CALL_CONTEXT *pCallContext,
52                                   RS_RES_ALLOC_PARAMS_INTERNAL *pParams) :
53                                   BinaryApi(pCallContext, pParams);
54 
55     virtual NV_STATUS binapiprivControl(BinaryApiPrivileged *pResource, CALL_CONTEXT *pCallContext,
56                                         RS_RES_CONTROL_PARAMS_INTERNAL *pParams);
57 
58 };
59 
60 #endif
61 
62