1 // This file is automatically generated by rmconfig - DO NOT EDIT!
2 //
3 // Provides access to RPC Hal interfaces.
4 //
5 // Profile:  shipping-gpus-openrm
6 // Haldef:   rpc.def
7 // Template: templates/gt_eng_hal.h
8 //
9 
10 #ifndef _G_RPCHAL_H_
11 #define _G_RPCHAL_H_
12 
13 //
14 // Typedefs for RPC public object interfaces.
15 //
16 
17 typedef NV_STATUS      RpcConstruct(POBJGPU, POBJRPC);
18 typedef void           RpcDestroy(POBJGPU, POBJRPC);
19 typedef NV_STATUS      RpcSendMessage(POBJGPU, POBJRPC);
20 typedef NV_STATUS      RpcRecvPoll(POBJGPU, POBJRPC, NvU32);
21 
22 
23 //
24 // "struct" to list RPC's public interfaces, eg:  pRpc->rpcInit(pGpu, pRpc)
25 //
26 
27 typedef struct RPC_OBJ_IFACES {
28     RpcConstruct                *__rpcConstruct__            ; /* Construct the RPC object */
29     RpcDestroy                  *__rpcDestroy__              ; /* Destroy the RPC object */
30     RpcSendMessage              *__rpcSendMessage__          ; /* Send an RPC message */
31     RpcRecvPoll                 *__rpcRecvPoll__             ; /* Receive an RPC message */
32 } RPC_OBJ_IFACES;
33 
34 
35 
36 //
37 // macro defines to directly access RPC's OBJ interfaces,
38 // eg: #define rpcReadFoo(_pGpu, _pRpc) _pRpc->obj._rpcReadFoo(_pGpu, _pRpc)
39 //
40 
41 #define rpcConstruct(_pGpu, _pRpc)  \
42         (_pRpc)->obj.__rpcConstruct__(_pGpu, _pRpc)
43 #define rpcDestroy(_pGpu, _pRpc)  \
44         (_pRpc)->obj.__rpcDestroy__(_pGpu, _pRpc)
45 #define rpcSendMessage(_pGpu, _pRpc)  \
46         (_pRpc)->obj.__rpcSendMessage__(_pGpu, _pRpc)
47 #define rpcRecvPoll(_pGpu, _pRpc, _arg0)  \
48         (_pRpc)->obj.__rpcRecvPoll__(_pGpu, _pRpc, _arg0)
49 
50 
51 //
52 // macro defines to access RPC's function pointers,
53 // eg: #define rpcReadFoo_FNPTR(_pRpc) _pRpc->obj.__rpcReadFoo__
54 // or  #define rpcReadFoo_FNPTR(_pRpc) _pRpc->__rpcReadFoo__
55 //
56 
57 #define rpcSendMessage_FNPTR(_pRpc)  \
58         (_pRpc)->obj.__rpcSendMessage__
59 #define rpcRecvPoll_FNPTR(_pRpc)  \
60         (_pRpc)->obj.__rpcRecvPoll__
61 
62 
63 //
64 // Typedefs for RPC HAL interfaces.
65 //
66 
67 typedef NV_STATUS      RpcVgpuPfRegRead32(POBJGPU, POBJRPC, NvU64, NvU32*, NvU32);
68 typedef NV_STATUS      RpcDumpProtobufComponent(POBJGPU, POBJRPC, PRB_ENCODER *pPrbEnc, NVD_STATE *pNvDumpState, NVDUMP_COMPONENT component);
69 typedef NV_STATUS      RpcEccNotifierWriteAck(POBJGPU, POBJRPC);
70 typedef NV_STATUS      RpcAllocMemory(POBJGPU, POBJRPC, NvHandle, NvHandle, NvHandle,
71                                     NvU32, NvU32, MEMORY_DESCRIPTOR*);
72 typedef NV_STATUS      RpcGpuExecRegOps(POBJGPU, POBJRPC, NvHandle, NvHandle,
73                                     NV2080_CTRL_GPU_EXEC_REG_OPS_PARAMS*, NV2080_CTRL_GPU_REG_OP*);
74 typedef NV_STATUS      RpcRmfsInit(POBJGPU, POBJRPC, PMEMORY_DESCRIPTOR);
75 typedef NV_STATUS      RpcUnsetPageDirectory(POBJGPU, POBJRPC, NvHandle, NvHandle,
76                                     NV0080_CTRL_DMA_UNSET_PAGE_DIRECTORY_PARAMS*);
77 typedef NV_STATUS      RpcGetGspStaticInfo(POBJGPU, POBJRPC);
78 typedef NV_STATUS      RpcGspSetSystemInfo(POBJGPU, POBJRPC);
79 typedef NV_STATUS      RpcRmfsCleanup(POBJGPU, POBJRPC);
80 typedef NV_STATUS      RpcSetPageDirectory(POBJGPU, POBJRPC, NvHandle, NvHandle,
81                                     NV0080_CTRL_DMA_SET_PAGE_DIRECTORY_PARAMS*);
82 typedef NV_STATUS      RpcUnloadingGuestDriver(POBJGPU, POBJRPC, NvBool, NvBool, NvU32);
83 typedef NV_STATUS      RpcSetRegistry(POBJGPU, POBJRPC);
84 typedef NV_STATUS      RpcRmfsCloseQueue(POBJGPU, POBJRPC);
85 typedef NV_STATUS      RpcGetStaticInfo(POBJGPU, POBJRPC);
86 typedef NV_STATUS      RpcIdleChannels(OBJGPU *, OBJRPC *, NvHandle *phclients,
87                                     NvHandle *phdevices, NvHandle *phchannels,
88                                     NvU32 nentries, NvU32 flags, NvU32 timeout);
89 typedef NV_STATUS      RpcUpdateBarPde(POBJGPU, POBJRPC, NV_RPC_UPDATE_PDE_BAR_TYPE, NvU64, NvU64);
90 typedef NV_STATUS      RpcMapMemoryDma(POBJGPU, POBJRPC, NvHandle, NvHandle, NvHandle,
91                                     NvHandle, NvU64, NvU64, NvU32, NvU64*);
92 typedef NV_STATUS      RpcUnmapMemoryDma(POBJGPU, POBJRPC, NvHandle, NvHandle, NvHandle, NvHandle, NvU32, NvU64);
93 typedef NV_STATUS      RpcRmfsTest(POBJGPU, POBJRPC, NvU32, NvU32, NvU32, NvU32);
94 typedef NV_STATUS      Rpc_iGrp_ipVersions_getInfo(IGRP_IP_VERSIONS_TABLE_INFO *);
95 
96 
97 //
98 // struct to access RPC's hal interfaces, eg:  pRpc->hal.rpcReadFoo(pGpu, pRpc)
99 //
100 
101 typedef struct RPC_HAL_IFACES {
102     RpcVgpuPfRegRead32          *rpcVgpuPfRegRead32;          /* Read reg value from plugin */
103     RpcDumpProtobufComponent    *rpcDumpProtobufComponent;    /* Dump a GSP component into the protobuf. */
104     RpcEccNotifierWriteAck      *rpcEccNotifierWriteAck;      /* ECC_NOTIFIER_WRITE_ACK */
105     RpcAllocMemory              *rpcAllocMemory;              /* ALLOC_MEMORY */
106     RpcGpuExecRegOps            *rpcGpuExecRegOps;            /* GPU_EXEC_REG_OPS */
107     RpcRmfsInit                 *rpcRmfsInit;                 /* Resman File Streaming Init */
108     RpcUnsetPageDirectory       *rpcUnsetPageDirectory;       /* UNSET_PAGE_DIRECTORY */
109     RpcGetGspStaticInfo         *rpcGetGspStaticInfo;         /* Get static info from GSP RM. */
110     RpcGspSetSystemInfo         *rpcGspSetSystemInfo;         /* Tells GSP-RM about the overall system environment */
111     RpcRmfsCleanup              *rpcRmfsCleanup;              /* Resman File Cleanup */
112     RpcSetPageDirectory         *rpcSetPageDirectory;         /* SET_PAGE_DIRECTORY */
113     RpcUnloadingGuestDriver     *rpcUnloadingGuestDriver;     /* UNLOADING_GUEST_DRIVER */
114     RpcSetRegistry              *rpcSetRegistry;              /* GSP Init Set registry values */
115     RpcRmfsCloseQueue           *rpcRmfsCloseQueue;           /* Resman File Streaming Close Queue */
116     RpcGetStaticInfo            *rpcGetStaticInfo;            /* GET_STATIC_INFO */
117     RpcIdleChannels             *rpcIdleChannels;             /* IDLE_CHANNELS */
118     RpcUpdateBarPde             *rpcUpdateBarPde;             /* Update the value of BAR1/BAR2 PDE */
119     RpcMapMemoryDma             *rpcMapMemoryDma;             /* MAP_MEMORY_DMA */
120     RpcUnmapMemoryDma           *rpcUnmapMemoryDma;           /* UNMAP_MEMORY_DMA */
121     RpcRmfsTest                 *rpcRmfsTest;                 /* Resman File Streaming Test */
122     Rpc_iGrp_ipVersions_getInfo  *rpc_iGrp_ipVersions_getInfo; /* Return lookup table of hal interface ptrs based on IP_VERSION */
123 } RPC_HAL_IFACES;
124 
125 
126 //
127 // macro defines to directly access RPC's hal interfaces,
128 // eg: #define rpcReadFoo_HAL(_pGpu, _pRpc) _pRpc->hal.rpcReadFoo(_pGpu, _pRpc)
129 //
130 
131 #define rpcVgpuPfRegRead32_HAL(_pGpu, _pRpc, _arg0, _pArg1, _arg2)  \
132         (_pRpc)->_hal.rpcVgpuPfRegRead32(_pGpu, _pRpc, _arg0, _pArg1, _arg2)
133 #define rpcDumpProtobufComponent_HAL(_pGpu, _pRpc, _pPrbEnc, _pNvDumpState, _component)  \
134         (_pRpc)->_hal.rpcDumpProtobufComponent(_pGpu, _pRpc, _pPrbEnc, _pNvDumpState, _component)
135 #define rpcEccNotifierWriteAck_HAL(_pGpu, _pRpc)  \
136         (_pRpc)->_hal.rpcEccNotifierWriteAck(_pGpu, _pRpc)
137 #define rpcAllocMemory_HAL(_pGpu, _pRpc, _arg0, _arg1, _arg2, _arg3, _arg4, _pArg5)  \
138         (_pRpc)->_hal.rpcAllocMemory(_pGpu, _pRpc, _arg0, _arg1, _arg2, _arg3, _arg4, _pArg5)
139 #define rpcGpuExecRegOps_HAL(_pGpu, _pRpc, _arg0, _arg1, _pArg2, _pArg3)  \
140         (_pRpc)->_hal.rpcGpuExecRegOps(_pGpu, _pRpc, _arg0, _arg1, _pArg2, _pArg3)
141 #define rpcRmfsInit_HAL(_pGpu, _pRpc, _arg0)  \
142         (_pRpc)->_hal.rpcRmfsInit(_pGpu, _pRpc, _arg0)
143 #define rpcUnsetPageDirectory_HAL(_pGpu, _pRpc, _arg0, _arg1, _pArg2)  \
144         (_pRpc)->_hal.rpcUnsetPageDirectory(_pGpu, _pRpc, _arg0, _arg1, _pArg2)
145 #define rpcGetGspStaticInfo_HAL(_pGpu, _pRpc)  \
146         (_pRpc)->_hal.rpcGetGspStaticInfo(_pGpu, _pRpc)
147 #define rpcGspSetSystemInfo_HAL(_pGpu, _pRpc)  \
148         (_pRpc)->_hal.rpcGspSetSystemInfo(_pGpu, _pRpc)
149 #define rpcRmfsCleanup_HAL(_pGpu, _pRpc)  \
150         (_pRpc)->_hal.rpcRmfsCleanup(_pGpu, _pRpc)
151 #define rpcSetPageDirectory_HAL(_pGpu, _pRpc, _arg0, _arg1, _pArg2)  \
152         (_pRpc)->_hal.rpcSetPageDirectory(_pGpu, _pRpc, _arg0, _arg1, _pArg2)
153 #define rpcUnloadingGuestDriver_HAL(_pGpu, _pRpc, _arg0, _arg1, _arg2)  \
154         (_pRpc)->_hal.rpcUnloadingGuestDriver(_pGpu, _pRpc, _arg0, _arg1, _arg2)
155 #define rpcSetRegistry_HAL(_pGpu, _pRpc)  \
156         (_pRpc)->_hal.rpcSetRegistry(_pGpu, _pRpc)
157 #define rpcRmfsCloseQueue_HAL(_pGpu, _pRpc)  \
158         (_pRpc)->_hal.rpcRmfsCloseQueue(_pGpu, _pRpc)
159 #define rpcGetStaticInfo_HAL(_pGpu, _pRpc)  \
160         (_pRpc)->_hal.rpcGetStaticInfo(_pGpu, _pRpc)
161 #define rpcIdleChannels_HAL(_pArg0, _pRpc, _pPhclients, _pPhdevices, _pPhchannels, _nentries, _flags, _timeout)  \
162         (_pRpc)->_hal.rpcIdleChannels(_pArg0, _pRpc, _pPhclients, _pPhdevices, _pPhchannels, _nentries, _flags, _timeout)
163 #define rpcUpdateBarPde_HAL(_pGpu, _pRpc, _arg0, _arg1, _arg2)  \
164         (_pRpc)->_hal.rpcUpdateBarPde(_pGpu, _pRpc, _arg0, _arg1, _arg2)
165 #define rpcMapMemoryDma_HAL(_pGpu, _pRpc, _arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _pArg7)  \
166         (_pRpc)->_hal.rpcMapMemoryDma(_pGpu, _pRpc, _arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _pArg7)
167 #define rpcUnmapMemoryDma_HAL(_pGpu, _pRpc, _arg0, _arg1, _arg2, _arg3, _arg4, _arg5)  \
168         (_pRpc)->_hal.rpcUnmapMemoryDma(_pGpu, _pRpc, _arg0, _arg1, _arg2, _arg3, _arg4, _arg5)
169 #define rpcRmfsTest_HAL(_pGpu, _pRpc, _arg0, _arg1, _arg2, _arg3)  \
170         (_pRpc)->_hal.rpcRmfsTest(_pGpu, _pRpc, _arg0, _arg1, _arg2, _arg3)
171 #define rpc_iGrp_ipVersions_getInfo_HAL(_pRpc, _pArg0)  \
172         (_pRpc)->_hal.rpc_iGrp_ipVersions_getInfo(_pArg0)
173 
174 //
175 // hal function pointer defines requested by the :GEN_FNPTR_DEFINE flag
176 //
177 
178 #define rpc_iGrp_ipVersions_getInfo_HAL_FNPTR(_pObj)   (_pObj)->_hal.rpc_iGrp_ipVersions_getInfo
179 
180 // Are there any optimized hal interfaces?
181 #define RPC_DIRECT_HAL_CALLS               0
182 
183 // Are there any non-optimized hal interfaces?
184 #define RPC_INDIRECT_HAL_CALLS             1
185 
186 
187 //
188 // Inline stub function definitions.
189 //
190 
191 
192 
193 //
194 // RPC PDB properties
195 //
196 
197 
198 
199 #endif  // _G_RPCHAL_H_
200