コード例 #1
0
ファイル: PciLib.c プロジェクト: hsienchieh/uefilab
/**
  Internal worker function to writes a PCI configuration register.

  This function wraps EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.Pci.Write() service.
  It writes the PCI configuration register specified by Address with the
  value specified by Data. The width of data is specifed by Width.
  Data is returned.

  @param  Address The address that encodes the PCI Bus, Device, Function and
                  Register.
  @param  Width   The width of data to write
  @param  Data    The value to write.

  @return The value written to the PCI configuration register.

**/
UINT32
DxePciLibPciRootBridgeIoWriteWorker (
  IN    UINTN                                  Address,
  IN    EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH  Width,
  IN    UINT32                                 Data
  )
{
  mPciRootBridgeIo->Pci.Write (
                          mPciRootBridgeIo,
                          Width,
                          PCI_TO_PCI_ROOT_BRIDGE_IO_ADDRESS (Address),
                          1,
                          &Data
                          );
  return Data;
}
コード例 #2
0
ファイル: PciLib.c プロジェクト: EvanLloyd/tianocore
/**
  Internal worker function to read a PCI configuration register.

  This function wraps EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.Pci.Read() service.
  It reads and returns the PCI configuration register specified by Address,
  the width of data is specified by Width.

  @param  Address The address that encodes the PCI Bus, Device, Function and
                  Register.
  @param  Width   The width of data to read

  @return The value read from the PCI configuration register.

**/
UINT32
SmmPciLibPciRootBridgeIoReadWorker (
  IN    UINTN                                  Address,
  IN    EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH  Width
  )
{
  UINT32  Data;

  mSmmPciRootBridgeIo->Pci.Read (
                          mSmmPciRootBridgeIo,
                          Width,
                          PCI_TO_PCI_ROOT_BRIDGE_IO_ADDRESS (Address),
                          1,
                          &Data
                          );

  return Data;
}