Description, Status codes returned – Intel Extensible Firmware Interface User Manual
Page 443
Protocols
— PCI Bus Support
Version 1.10
12/01/02
12-25
Description
The
Pci.Read()
and
Pci.Write()
functions enable a driver to access PCI configuration
registers for a PCI controller.
The PCI Configuration operations are carried out exactly as requested. The caller is responsible for
any alignment and PCI configuration width issues that a PCI Root Bridge on a platform might
require. For example on some platforms, width requests of
EfiPciWidthUint64
do not work.
If
Width
is
EfiPciWidthUint8
,
EfiPciWidthUint16
,
EfiPciWidthUint32
, or
EfiPciWidthUint64
, then both
Address
and
Buffer
are incremented for each of the
Count
operations performed.
If
Width
is
EfiPciWidthFifoUint8
,
EfiPciWidthFifoUint16
,
EfiPciWidthFifoUint32
, or
EfiPciWidthFifoUint64
, then only
Buffer
is
incremented for each of the
Count
operations performed. The read or write operation is
performed
Count
times on the same
Address
.
If
Width
is
EfiPciWidthFillUint8
,
EfiPciWidthFillUint16
,
EfiPciWidthFillUint32
, or
EfiPciWidthFillUint64
, then only
Address
is
incremented for each of the
Count
operations performed. The read or write operation is
performed
Count
times from the first element of
Buffer
.
All the PCI transactions generated by this function are guaranteed to be completed before this
function returns.
Table 12-1. PCI Configuration Address
Mnemonic
Byte
Offset
Byte
Length
Description
Register
0
1
The register number on the PCI Function.
Function
1
1
The PCI Function number on the PCI Device.
Device
2
1
The PCI Device number on the PCI Bus.
Bus
3
1
The PCI Bus number.
ExtendedRegister
4
4
The register number on the PCI Function. If this field is zero,
then the Register field is used for the register number. If this
field is nonzero, then the Register field is ignored, and the
ExtendedRegister field is used for the register number.
Status Codes Returned
EFI_SUCCESS
The data was read from or written to the PCI root bridge
.
EFI_INVALID_PARAMETER
Width
is invalid for this PCI root bridge.
EFI_INVALID_PARAMETER
Buffer
is
NULL
.
EFI_OUT_OF_RESOURCES
The request could not be completed due to a lack of resources.