Module uefi::proto::device_path
source · [−]Expand description
Device Path protocol
A UEFI device path is a very flexible structure for encoding a programatic path such as a hard drive or console.
A device path is made up of a packed list of variable-length nodes of
various types. The entire device path is terminated with an
END_ENTIRE
node. A device path may contain multiple device-path
instances separated by END_INSTANCE
nodes, but typical paths contain
only a single instance (in which case no END_INSTANCE
node is needed).
Example of what a device path containing two instances (each comprised of three nodes) might look like:
┌──────┬─────┬──────────────╥───────┬──────────┬────────────┐
│ ACPI │ PCI │ END_INSTANCE ║ CDROM │ FILEPATH │ END_ENTIRE │
└──────┴─────┴──────────────╨───────┴──────────┴────────────┘
↑ ↑ ↑
├─── DevicePathInstance ────╨────── DevicePathInstance ─────┤
│ │
└─────────────────── Entire DevicePath ─────────────────────┘
Types
To represent device paths, this module provides several types:
-
DevicePath
is the root type that represents a full device path, containing one or more device path instance. It ends with anEND_ENTIRE
node. It implementsProtocol
(corresponding toEFI_DEVICE_PATH_PROTOCOL
). -
DevicePathInstance
represents a single path instance within a device path. It ends with either anEND_INSTANCE
orEND_ENTIRE
node. -
DevicePathNode
represents a single node within a path. The node’sdevice_type
andsub_type
must be examined to determine what type of data it contains.Specific node types have their own structures, but only a few are currently implemented:
-
DevicePathHeader
is a header present at the start of every node. It describes the type of node as well as the node’s size. -
FfiDevicePath
is an opaque type used whenever a device path pointer is passed to or from external UEFI interfaces (i.e. where the UEFI spec usesconst* EFI_DEVICE_PATH_PROTOCOL
,*const FfiDevicePath
should be used in the Rust definition). Many of the other types in this module are DSTs, so pointers to the type are “fat” and not suitable for FFI.
All of these types use a packed layout and may appear on any byte boundary.
Note: the API provided by this module is currently mostly limited to reading existing device paths rather than constructing new ones.
Modules
DevicePathToText
and DevicePathFromText
Protocol
Structs
ACPI Device Path
Device path protocol.
Header that appears at the start of every DevicePathNode
.
A single device path instance that ends with either an END_INSTANCE
or END_ENTIRE
node. Use DevicePath::instance_iter
to get the
path instances in a DevicePath
.
Iterator over the DevicePathInstance
s in a DevicePath
.
A single node within a DevicePath
.
Iterator over DevicePathNode
s.
Sub-type identifier for a DevicePath
Type identifier for a DevicePath
Opaque type that should be used to represent a pointer to a
DevicePath
or DevicePathNode
in foreign function interfaces. This
type produces a thin pointer, unlike DevicePath
and
DevicePathNode
.
File Path Media Device Path.