1 #ifndef _G_HOST_ENG_NVOC_H_
2 #define _G_HOST_ENG_NVOC_H_
3 #include "nvoc/runtime.h"
4 
5 #ifdef __cplusplus
6 extern "C" {
7 #endif
8 
9 /*
10  * SPDX-FileCopyrightText: Copyright (c) 2013-2022 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_host_eng_nvoc.h"
33 
34 #ifndef HOST_ENG_H
35 #define HOST_ENG_H
36 
37 /*!
38  * @file   host_eng.h
39  * @brief  Provides definitions for all OBJHOSTENG data structures and interfaces.
40  */
41 
42 #include "core/core.h"
43 #include "gpu/gpu_timeout.h"
44 
45 #include "kernel/gpu/fifo/kernel_channel.h"
46 
47 typedef struct OBJHOSTENG *POBJHOSTENG;
48 
49 /*!
50  * Interface class for all Hosteng modules.
51  */
52 #ifdef NVOC_HOST_ENG_H_PRIVATE_ACCESS_ALLOWED
53 #define PRIVATE_FIELD(x) x
54 #else
55 #define PRIVATE_FIELD(x) NVOC_PRIVATE_FIELD(x)
56 #endif
57 struct OBJHOSTENG {
58     const struct NVOC_RTTI *__nvoc_rtti;
59     struct OBJHOSTENG *__nvoc_pbase_OBJHOSTENG;
60     NV_STATUS (*__hostengHaltAndReset__)(struct OBJGPU *, struct OBJHOSTENG *, RMTIMEOUT *);
61 };
62 
63 #ifndef __NVOC_CLASS_OBJHOSTENG_TYPEDEF__
64 #define __NVOC_CLASS_OBJHOSTENG_TYPEDEF__
65 typedef struct OBJHOSTENG OBJHOSTENG;
66 #endif /* __NVOC_CLASS_OBJHOSTENG_TYPEDEF__ */
67 
68 #ifndef __nvoc_class_id_OBJHOSTENG
69 #define __nvoc_class_id_OBJHOSTENG 0xb356e7
70 #endif /* __nvoc_class_id_OBJHOSTENG */
71 
72 extern const struct NVOC_CLASS_DEF __nvoc_class_def_OBJHOSTENG;
73 
74 #define __staticCast_OBJHOSTENG(pThis) \
75     ((pThis)->__nvoc_pbase_OBJHOSTENG)
76 
77 #ifdef __nvoc_host_eng_h_disabled
78 #define __dynamicCast_OBJHOSTENG(pThis) ((OBJHOSTENG*)NULL)
79 #else //__nvoc_host_eng_h_disabled
80 #define __dynamicCast_OBJHOSTENG(pThis) \
81     ((OBJHOSTENG*)__nvoc_dynamicCast(staticCast((pThis), Dynamic), classInfo(OBJHOSTENG)))
82 #endif //__nvoc_host_eng_h_disabled
83 
84 
85 NV_STATUS __nvoc_objCreateDynamic_OBJHOSTENG(OBJHOSTENG**, Dynamic*, NvU32, va_list);
86 
87 NV_STATUS __nvoc_objCreate_OBJHOSTENG(OBJHOSTENG**, Dynamic*, NvU32);
88 #define __objCreate_OBJHOSTENG(ppNewObj, pParent, createFlags) \
89     __nvoc_objCreate_OBJHOSTENG((ppNewObj), staticCast((pParent), Dynamic), (createFlags))
90 
91 #define hostengHaltAndReset(pGpu, pHosteng, pRmTimeout) hostengHaltAndReset_DISPATCH(pGpu, pHosteng, pRmTimeout)
92 NV_STATUS hostengHaltAndReset_IMPL(struct OBJGPU *pGpu, struct OBJHOSTENG *pHosteng, RMTIMEOUT *pRmTimeout);
93 
94 static inline NV_STATUS hostengHaltAndReset_DISPATCH(struct OBJGPU *pGpu, struct OBJHOSTENG *pHosteng, RMTIMEOUT *pRmTimeout) {
95     return pHosteng->__hostengHaltAndReset__(pGpu, pHosteng, pRmTimeout);
96 }
97 
98 #undef PRIVATE_FIELD
99 
100 
101 #endif // HOST_ENG_H
102 
103 #ifdef __cplusplus
104 } // extern "C"
105 #endif
106 
107 #endif // _G_HOST_ENG_NVOC_H_
108