![Intel Extensible Firmware Interface Specification Download Page 157](http://html1.mh-extra.com/html/intel/extensible-firmware-interface/extensible-firmware-interface_specification_2073117157.webp)
Device I/O Protocol
Version 1.02
12/12/00
139
Description
The
DEVICE_IO
protocol provides the basic Memory, I/O, and PCI interfaces that are used to
abstract accesses to devices.
A driver that controls a physical device obtains the proper
DEVICE_IO
protocol interface by
checking for the supported protocol on the programmatic parent(s) for the device. This is easily
done via the
LocateDevicePath()
function.
The following C code fragment illustrates the use of the
DEVICE_IO
protocol:
// 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
*
IoFncs
;
EFI_DEVICE_PATH
*SearchPath;
SearchPath =
MyDevicePath
;
Status = LocateDevicePath (
&DeviceIoProtocol,
// Protocol GUID
&SearchPath,
// Device Path SearchKey
&
DevHandle
// Return EFI Handle
);
// 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()
takes the Device Path of a device and returns the handle that
contains the
DEVICE_IO
protocol for the device. The handle is passed to
HandleProtocol()
with a pointer to the
EFI_GUID
for
DEVICE_IO
protocol and a pointer to the
DEVICE_IO
protocol is returned. The
DEVICE_IO
protocol pointer
IoFncs
is then used to do an I/O read to
a device.
Summary of Contents for Extensible Firmware Interface
Page 1: ...Extensible Firmware Interface Specification Version 1 02 December 12 2000...
Page 4: ...Extensible Firmware Interface Specification iv 12 12 00 Version 1 02...
Page 42: ...Extensible Firmware Interface Specification 24 12 01 00 Version 1 02...
Page 190: ...Extensible Firmware Interface Specification 172 12 12 00 Version 1 02...
Page 200: ...Extensible Firmware Interface Specification 182 12 12 00 Version 1 02...
Page 226: ...Extensible Firmware Interface Specification 208 12 12 00 Version 1 02...
Page 230: ...Extensible Firmware Interface Specification 212 12 12 00 Version 1 02...
Page 252: ...Extensible Firmware Interface Specification 234 12 12 00 Version 1 02...
Page 294: ...Extensible Firmware Interface Specification 276 12 12 00 Version 1 02...
Page 348: ...Extensible Firmware Interface Specification 330 12 01 00 Version 1 01...
Page 350: ...Extensible Firmware Interface Specification 332 12 12 00 Version 1 02...
Page 354: ...Extensible Firmware Interface Specification 336 12 12 00 Version 1 02...
Page 362: ...Extensible Firmware Interface Specification 344 12 12 00 Version 1 02...
Page 486: ...Extensible Firmware Interface Specification 468 12 12 00 Version 1 02...
Page 494: ...Extensible Firmware Interface Specification 476 12 12 00 Version 1 02...