Description, Status codes returned – Intel Extensible Firmware Interface User Manual
Page 766

Extensible Firmware Interface Specification
18-6
12/01/02
Version 1.10
Description
The
DEVICE_IO.Mem()
,
.Io()
, and
.Pci()
functions enable a driver to access device
registers in the appropriate memory or I/O space.
The I/O operations are carried out exactly as requested. The caller is responsible for any alignment
and I/O width issues which the bus, device, platform, or type of I/O might require. For example on
IA-32 platforms, width requests of
IO_UINT64
do not work.
For
Mem()
and
Io()
, the address field is the bus relative address as seen by the device on the bus.
For
Mem()
and
Io()
the caller must align the starting address to be on a proper width boundary.
For
Pci()
, the address field is encoded as shown in Table 18-1. The caller must align the register
number being accessed to be on a proper width boundary.
Table 18-1. PCI Address
Mnemonic
Byte
Offset
Byte
Length
Description
Register
0
1
The register number on the function.
Function
1
1
The function on the device.
Device
2
1
The device on the bus.
Bus
3
1
The bus.
Segment 4
1
The
segment
number.
Reserved
5
3
Must be zero.
Status Codes Returned
EFI_SUCCESS
The data was read from or written to the device.
EFI_INVALID_PARAMETER
Width
is invalid.
EFI_OUT_OF_RESOURCES
The request could not be completed due to a lack of resources.