// This file is automatically generated by rmconfig - DO NOT EDIT!
//
// Provides access to RPC Hal interfaces.
//
// Profile:  shipping-gpus-openrm
// Haldef:   rpc.def
// Template: templates/gt_eng_hal.h
//

#ifndef _G_RPCHAL_H_
#define _G_RPCHAL_H_

//
// Typedefs for RPC public object interfaces.
//

typedef NV_STATUS      RpcConstruct(POBJGPU, POBJRPC);
typedef void           RpcDestroy(POBJGPU, POBJRPC);
typedef NV_STATUS      RpcSendMessage(POBJGPU, POBJRPC);
typedef NV_STATUS      RpcRecvPoll(POBJGPU, POBJRPC, NvU32);


//
// "struct" to list RPC's public interfaces, eg:  pRpc->rpcInit(pGpu, pRpc)
//

typedef struct RPC_OBJ_IFACES {
    RpcConstruct                *__rpcConstruct__            ; /* Construct the RPC object */
    RpcDestroy                  *__rpcDestroy__              ; /* Destroy the RPC object */
    RpcSendMessage              *__rpcSendMessage__          ; /* Send an RPC message */
    RpcRecvPoll                 *__rpcRecvPoll__             ; /* Receive an RPC message */
} RPC_OBJ_IFACES;



//
// macro defines to directly access RPC's OBJ interfaces,
// eg: #define rpcReadFoo(_pGpu, _pRpc) _pRpc->obj._rpcReadFoo(_pGpu, _pRpc)
//

#define rpcConstruct(_pGpu, _pRpc)  \
        (_pRpc)->obj.__rpcConstruct__(_pGpu, _pRpc)
#define rpcDestroy(_pGpu, _pRpc)  \
        (_pRpc)->obj.__rpcDestroy__(_pGpu, _pRpc)
#define rpcSendMessage(_pGpu, _pRpc)  \
        (_pRpc)->obj.__rpcSendMessage__(_pGpu, _pRpc)
#define rpcRecvPoll(_pGpu, _pRpc, _arg0)  \
        (_pRpc)->obj.__rpcRecvPoll__(_pGpu, _pRpc, _arg0)


//
// macro defines to access RPC's function pointers,
// eg: #define rpcReadFoo_FNPTR(_pRpc) _pRpc->obj.__rpcReadFoo__
// or  #define rpcReadFoo_FNPTR(_pRpc) _pRpc->__rpcReadFoo__
//

#define rpcSendMessage_FNPTR(_pRpc)  \
        (_pRpc)->obj.__rpcSendMessage__
#define rpcRecvPoll_FNPTR(_pRpc)  \
        (_pRpc)->obj.__rpcRecvPoll__


//
// Typedefs for RPC HAL interfaces.
//

typedef NV_STATUS      RpcVgpuPfRegRead32(POBJGPU, POBJRPC, NvU64, NvU32*, NvU32);
typedef NV_STATUS      RpcDumpProtobufComponent(POBJGPU, POBJRPC, PRB_ENCODER *pPrbEnc, NVD_STATE *pNvDumpState, NVDUMP_COMPONENT component);
typedef NV_STATUS      RpcAllocMemory(POBJGPU, POBJRPC, NvHandle, NvHandle, NvHandle,
                                    NvU32, NvU32, MEMORY_DESCRIPTOR*);
typedef NV_STATUS      RpcGpuExecRegOps(POBJGPU, POBJRPC, NvHandle, NvHandle,
                                    NV2080_CTRL_GPU_EXEC_REG_OPS_PARAMS*, NV2080_CTRL_GPU_REG_OP*);
typedef NV_STATUS      RpcRmfsInit(POBJGPU, POBJRPC, PMEMORY_DESCRIPTOR);
typedef NV_STATUS      RpcUnsetPageDirectory(POBJGPU, POBJRPC, NvHandle, NvHandle,
                                    NV0080_CTRL_DMA_UNSET_PAGE_DIRECTORY_PARAMS*);
typedef NV_STATUS      RpcGetGspStaticInfo(POBJGPU, POBJRPC);
typedef NV_STATUS      RpcGspSetSystemInfo(POBJGPU, POBJRPC);
typedef NV_STATUS      RpcRmfsCleanup(POBJGPU, POBJRPC);
typedef NV_STATUS      RpcSetPageDirectory(POBJGPU, POBJRPC, NvHandle, NvHandle,
                                    NV0080_CTRL_DMA_SET_PAGE_DIRECTORY_PARAMS*);
typedef NV_STATUS      RpcUnloadingGuestDriver(POBJGPU, POBJRPC, NvBool, NvBool, NvU32);
typedef NV_STATUS      RpcSetRegistry(POBJGPU, POBJRPC);
typedef NV_STATUS      RpcRmfsCloseQueue(POBJGPU, POBJRPC);
typedef NV_STATUS      RpcGetStaticInfo(POBJGPU, POBJRPC);
typedef NV_STATUS      RpcIdleChannels(OBJGPU *, OBJRPC *, NvHandle *phclients,
                                    NvHandle *phdevices, NvHandle *phchannels,
                                    NvU32 nentries, NvU32 flags, NvU32 timeout);
typedef NV_STATUS      RpcUpdateBarPde(POBJGPU, POBJRPC, NV_RPC_UPDATE_PDE_BAR_TYPE, NvU64, NvU64);
typedef NV_STATUS      RpcMapMemoryDma(POBJGPU, POBJRPC, NvHandle, NvHandle, NvHandle,
                                    NvHandle, NvU64, NvU64, NvU32, NvU64*);
typedef NV_STATUS      RpcUnmapMemoryDma(POBJGPU, POBJRPC, NvHandle, NvHandle, NvHandle, NvHandle, NvU32, NvU64);
typedef NV_STATUS      RpcRmfsTest(POBJGPU, POBJRPC, NvU32, NvU32, NvU32, NvU32);
typedef NV_STATUS      Rpc_iGrp_ipVersions_getInfo(IGRP_IP_VERSIONS_TABLE_INFO *);


//
// struct to access RPC's hal interfaces, eg:  pRpc->hal.rpcReadFoo(pGpu, pRpc)
//

typedef struct RPC_HAL_IFACES {
    RpcVgpuPfRegRead32          *rpcVgpuPfRegRead32;          /* Read reg value from plugin */
    RpcDumpProtobufComponent    *rpcDumpProtobufComponent;    /* Dump a GSP component into the protobuf. */
    RpcAllocMemory              *rpcAllocMemory;              /* ALLOC_MEMORY */
    RpcGpuExecRegOps            *rpcGpuExecRegOps;            /* GPU_EXEC_REG_OPS */
    RpcRmfsInit                 *rpcRmfsInit;                 /* Resman File Streaming Init */
    RpcUnsetPageDirectory       *rpcUnsetPageDirectory;       /* UNSET_PAGE_DIRECTORY */
    RpcGetGspStaticInfo         *rpcGetGspStaticInfo;         /* Get static info from GSP RM. */
    RpcGspSetSystemInfo         *rpcGspSetSystemInfo;         /* Tells GSP-RM about the overall system environment */
    RpcRmfsCleanup              *rpcRmfsCleanup;              /* Resman File Cleanup */
    RpcSetPageDirectory         *rpcSetPageDirectory;         /* SET_PAGE_DIRECTORY */
    RpcUnloadingGuestDriver     *rpcUnloadingGuestDriver;     /* UNLOADING_GUEST_DRIVER */
    RpcSetRegistry              *rpcSetRegistry;              /* GSP Init Set registry values */
    RpcRmfsCloseQueue           *rpcRmfsCloseQueue;           /* Resman File Streaming Close Queue */
    RpcGetStaticInfo            *rpcGetStaticInfo;            /* GET_STATIC_INFO */
    RpcIdleChannels             *rpcIdleChannels;             /* IDLE_CHANNELS */
    RpcUpdateBarPde             *rpcUpdateBarPde;             /* Update the value of BAR1/BAR2 PDE */
    RpcMapMemoryDma             *rpcMapMemoryDma;             /* MAP_MEMORY_DMA */
    RpcUnmapMemoryDma           *rpcUnmapMemoryDma;           /* UNMAP_MEMORY_DMA */
    RpcRmfsTest                 *rpcRmfsTest;                 /* Resman File Streaming Test */
    Rpc_iGrp_ipVersions_getInfo  *rpc_iGrp_ipVersions_getInfo; /* Return lookup table of hal interface ptrs based on IP_VERSION */
} RPC_HAL_IFACES;


//
// macro defines to directly access RPC's hal interfaces,
// eg: #define rpcReadFoo_HAL(_pGpu, _pRpc) _pRpc->hal.rpcReadFoo(_pGpu, _pRpc)
//

#define rpcVgpuPfRegRead32_HAL(_pGpu, _pRpc, _arg0, _pArg1, _arg2)  \
        (_pRpc)->_hal.rpcVgpuPfRegRead32(_pGpu, _pRpc, _arg0, _pArg1, _arg2)
#define rpcDumpProtobufComponent_HAL(_pGpu, _pRpc, _pPrbEnc, _pNvDumpState, _component)  \
        (_pRpc)->_hal.rpcDumpProtobufComponent(_pGpu, _pRpc, _pPrbEnc, _pNvDumpState, _component)
#define rpcAllocMemory_HAL(_pGpu, _pRpc, _arg0, _arg1, _arg2, _arg3, _arg4, _pArg5)  \
        (_pRpc)->_hal.rpcAllocMemory(_pGpu, _pRpc, _arg0, _arg1, _arg2, _arg3, _arg4, _pArg5)
#define rpcGpuExecRegOps_HAL(_pGpu, _pRpc, _arg0, _arg1, _pArg2, _pArg3)  \
        (_pRpc)->_hal.rpcGpuExecRegOps(_pGpu, _pRpc, _arg0, _arg1, _pArg2, _pArg3)
#define rpcRmfsInit_HAL(_pGpu, _pRpc, _arg0)  \
        (_pRpc)->_hal.rpcRmfsInit(_pGpu, _pRpc, _arg0)
#define rpcUnsetPageDirectory_HAL(_pGpu, _pRpc, _arg0, _arg1, _pArg2)  \
        (_pRpc)->_hal.rpcUnsetPageDirectory(_pGpu, _pRpc, _arg0, _arg1, _pArg2)
#define rpcGetGspStaticInfo_HAL(_pGpu, _pRpc)  \
        (_pRpc)->_hal.rpcGetGspStaticInfo(_pGpu, _pRpc)
#define rpcGspSetSystemInfo_HAL(_pGpu, _pRpc)  \
        (_pRpc)->_hal.rpcGspSetSystemInfo(_pGpu, _pRpc)
#define rpcRmfsCleanup_HAL(_pGpu, _pRpc)  \
        (_pRpc)->_hal.rpcRmfsCleanup(_pGpu, _pRpc)
#define rpcSetPageDirectory_HAL(_pGpu, _pRpc, _arg0, _arg1, _pArg2)  \
        (_pRpc)->_hal.rpcSetPageDirectory(_pGpu, _pRpc, _arg0, _arg1, _pArg2)
#define rpcUnloadingGuestDriver_HAL(_pGpu, _pRpc, _arg0, _arg1, _arg2)  \
        (_pRpc)->_hal.rpcUnloadingGuestDriver(_pGpu, _pRpc, _arg0, _arg1, _arg2)
#define rpcSetRegistry_HAL(_pGpu, _pRpc)  \
        (_pRpc)->_hal.rpcSetRegistry(_pGpu, _pRpc)
#define rpcRmfsCloseQueue_HAL(_pGpu, _pRpc)  \
        (_pRpc)->_hal.rpcRmfsCloseQueue(_pGpu, _pRpc)
#define rpcGetStaticInfo_HAL(_pGpu, _pRpc)  \
        (_pRpc)->_hal.rpcGetStaticInfo(_pGpu, _pRpc)
#define rpcIdleChannels_HAL(_pArg0, _pRpc, _pPhclients, _pPhdevices, _pPhchannels, _nentries, _flags, _timeout)  \
        (_pRpc)->_hal.rpcIdleChannels(_pArg0, _pRpc, _pPhclients, _pPhdevices, _pPhchannels, _nentries, _flags, _timeout)
#define rpcUpdateBarPde_HAL(_pGpu, _pRpc, _arg0, _arg1, _arg2)  \
        (_pRpc)->_hal.rpcUpdateBarPde(_pGpu, _pRpc, _arg0, _arg1, _arg2)
#define rpcMapMemoryDma_HAL(_pGpu, _pRpc, _arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _pArg7)  \
        (_pRpc)->_hal.rpcMapMemoryDma(_pGpu, _pRpc, _arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _pArg7)
#define rpcUnmapMemoryDma_HAL(_pGpu, _pRpc, _arg0, _arg1, _arg2, _arg3, _arg4, _arg5)  \
        (_pRpc)->_hal.rpcUnmapMemoryDma(_pGpu, _pRpc, _arg0, _arg1, _arg2, _arg3, _arg4, _arg5)
#define rpcRmfsTest_HAL(_pGpu, _pRpc, _arg0, _arg1, _arg2, _arg3)  \
        (_pRpc)->_hal.rpcRmfsTest(_pGpu, _pRpc, _arg0, _arg1, _arg2, _arg3)
#define rpc_iGrp_ipVersions_getInfo_HAL(_pRpc, _pArg0)  \
        (_pRpc)->_hal.rpc_iGrp_ipVersions_getInfo(_pArg0)

//
// hal function pointer defines requested by the :GEN_FNPTR_DEFINE flag
//

#define rpc_iGrp_ipVersions_getInfo_HAL_FNPTR(_pObj)   (_pObj)->_hal.rpc_iGrp_ipVersions_getInfo

// Are there any optimized hal interfaces?
#define RPC_DIRECT_HAL_CALLS               0

// Are there any non-optimized hal interfaces?
#define RPC_INDIRECT_HAL_CALLS             1


//
// Inline stub function definitions.
//



//
// RPC PDB properties
//



#endif  // _G_RPCHAL_H_
