EDK2 doxygen online documents - Firmware Encoding Index 1
EDK2 doxygen online documents - Firmware Encoding Index

EdkCompatibilityPkg/Compatibility/PciCfgOnPciCfg2Thunk/PciCfgOnPciCfg2Thunk.c

Go to the documentation of this file.
00001 
00028 #include <PiPei.h>
00029 #include <Ppi/PciCfg.h>
00030 #include <Ppi/PciCfg2.h>
00031 #include <Library/DebugLib.h>
00032 
00033 //
00034 // Function Prototypes
00035 //
00036 
00061 EFI_STATUS
00062 EFIAPI
00063 PciCfgRead (
00064   IN EFI_PEI_SERVICES             **PeiServices,
00065   IN EFI_PEI_PCI_CFG_PPI          *This,
00066   IN EFI_PEI_PCI_CFG_PPI_WIDTH    Width,
00067   IN UINT64                       Address,
00068   IN OUT VOID                     *Buffer
00069   );
00070 
00095 EFI_STATUS
00096 EFIAPI
00097 PciCfgWrite (
00098   IN EFI_PEI_SERVICES             **PeiServices,
00099   IN EFI_PEI_PCI_CFG_PPI          *This,
00100   IN EFI_PEI_PCI_CFG_PPI_WIDTH    Width,
00101   IN UINT64                       Address,
00102   IN OUT VOID                     *Buffer
00103   );
00104 
00133 EFI_STATUS
00134 EFIAPI
00135 PciCfgModify (
00136   IN EFI_PEI_SERVICES             **PeiServices,
00137   IN EFI_PEI_PCI_CFG_PPI          *This,
00138   IN EFI_PEI_PCI_CFG_PPI_WIDTH    Width,
00139   IN UINT64                       Address,
00140   IN UINTN                        SetBits,
00141   IN UINTN                        ClearBits
00142   );
00143 
00144 //
00145 // Module globals
00146 //
00147 EFI_PEI_PCI_CFG_PPI mPciCfgPpi = {
00148   PciCfgRead,
00149   PciCfgWrite,
00150   PciCfgModify,
00151 };
00152 
00153 EFI_PEI_PPI_DESCRIPTOR     mPpiListPciCfg = {
00154   (EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),
00155   &gEfiPciCfgPpiInServiceTableGuid,
00156   &mPciCfgPpi
00157 };
00158 
00169 EFI_STATUS
00170 EFIAPI
00171 PeimInitializePciCfg (
00172   IN EFI_PEI_FILE_HANDLE     FileHandle,
00173   IN CONST EFI_PEI_SERVICES  **PeiServices
00174   )
00175 {
00176   //
00177   // Publish the PciCfgToPciCfg2 Thunk capability to other modules
00178   //
00179   return (*PeiServices)->InstallPpi (PeiServices, &mPpiListPciCfg);
00180 }
00181 
00206 EFI_STATUS
00207 EFIAPI
00208 PciCfgRead (
00209   IN EFI_PEI_SERVICES             **PeiServices,
00210   IN EFI_PEI_PCI_CFG_PPI          *This,
00211   IN EFI_PEI_PCI_CFG_PPI_WIDTH    Width,
00212   IN UINT64                       Address,
00213   IN OUT VOID                     *Buffer
00214   )
00215 {
00216   EFI_PEI_PCI_CFG2_PPI  *PciCfg2;
00217 
00218   PciCfg2 = (*PeiServices)->PciCfg;
00219 
00220   return PciCfg2->Read ((CONST EFI_PEI_SERVICES **)PeiServices, PciCfg2, Width, Address, Buffer);
00221 }
00222 
00223 
00248 EFI_STATUS
00249 EFIAPI
00250 PciCfgWrite (
00251   IN EFI_PEI_SERVICES             **PeiServices,
00252   IN EFI_PEI_PCI_CFG_PPI          *This,
00253   IN EFI_PEI_PCI_CFG_PPI_WIDTH    Width,
00254   IN UINT64                       Address,
00255   IN OUT VOID                     *Buffer
00256   )
00257 {
00258   EFI_PEI_PCI_CFG2_PPI  *PciCfg2;
00259 
00260   PciCfg2 = (*PeiServices)->PciCfg;
00261 
00262   return PciCfg2->Write ((CONST EFI_PEI_SERVICES **)PeiServices, PciCfg2, Width, Address, Buffer);
00263 }
00264 
00293 EFI_STATUS
00294 EFIAPI
00295 PciCfgModify (
00296   IN EFI_PEI_SERVICES             **PeiServices,
00297   IN EFI_PEI_PCI_CFG_PPI          *This,
00298   IN EFI_PEI_PCI_CFG_PPI_WIDTH    Width,
00299   IN UINT64                       Address,
00300   IN UINTN                        SetBits,
00301   IN UINTN                        ClearBits
00302   )
00303 {
00304   EFI_PEI_PCI_CFG2_PPI  *PciCfg2;
00305 
00306   PciCfg2 = (*PeiServices)->PciCfg;
00307 
00308   return PciCfg2->Modify ((CONST EFI_PEI_SERVICES **)PeiServices, PciCfg2, Width, Address, &SetBits, &ClearBits);
00309 }
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Defines