Intel Extensible Firmware Interface Specification page 157

Intel extensible firmware interface specification
Table of Contents

Advertisement

Description
The
protocol provides the basic Memory, I/O, and PCI interfaces that are used to
DEVICE_IO
abstract accesses to devices.
A driver that controls a physical device obtains the proper
checking for the supported protocol on the programmatic parent(s) for the device. This is easily
done via the
LocateDevicePath()
The following C code fragment illustrates the use of the
// Get the handle to our parent that provides the device I/O
// protocol interfaces to "MyDevice" (which has the device path
// of "MyDevicePath")
EFI_DEVICE_IO_INTERFACE
EFI_DEVICE_PATH
SearchPath = MyDevicePath;
Status = LocateDevicePath (
// Get the device I/O interfaces from the handle
Status = HandleProtocol (DevHandle, &DeviceIoProtocol, &IoFncs);
// Read 1 dword into Buffer from MyDevice's I/O address
IoFncs->Io.Read (IoFncs, IO_UINT32, MyDeviceAddress, 1, &Buffer);
The call to
LocateDevicePath()
contains the
DEVICE_IO
with a pointer to the
EFI_GUID
protocol is returned. The
a device.
Version 1.02
function.
*IoFncs;
*SearchPath;
&DeviceIoProtocol,
&SearchPath,
&DevHandle
);
takes the Device Path of a device and returns the handle that
protocol for the device. The handle is passed to
for
DEVICE_IO
protocol pointer
DEVICE_IO
12/12/00
protocol interface by
DEVICE_IO
protocol:
DEVICE_IO
// Protocol GUID
// Device Path SearchKey
// Return EFI Handle
HandleProtocol()
protocol and a pointer to the
is then used to do an I/O read to
IoFncs
Device I/O Protocol
DEVICE_IO
139

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the Extensible Firmware Interface and is the answer not in the manual?

Subscribe to Our Youtube Channel

Table of Contents