|
1 | 1 | // SPDX-License-Identifier: MIT OR Apache-2.0
|
2 | 2 |
|
| 3 | +//! UEFI device paths and the UEFI device path protocol. |
| 4 | +//! |
| 5 | +//! This module provides (generated) ABI-compatible bindings to all known device |
| 6 | +//! path node types. |
| 7 | +//! |
| 8 | +//! # Device Paths, Device Path Nodes, and Device Path Instances |
| 9 | +//! A UEFI device path is an open instance of the UEFI device path [protocol], |
| 10 | +//! which can be implemented for any UEFI handle. It is a very flexible |
| 11 | +//! structure for encoding a programmatic path to a device, such as a hard drive |
| 12 | +//! attached to the PCI bus. |
| 13 | +//! |
| 14 | +//! A device path is made up of a packed list of variable-length nodes of |
| 15 | +//! various types. The entire device path is terminated with an |
| 16 | +//! [`END_ENTIRE`] node. A device path _may_ contain multiple device-path |
| 17 | +//! instances separated by [`END_INSTANCE`] nodes, but typical paths contain |
| 18 | +//! only a single instance (in which case no [`END_INSTANCE`] node is needed). |
| 19 | +//! |
| 20 | +//! Example of what a device path containing two instances (each comprised of |
| 21 | +//! three nodes) might look like: |
| 22 | +//! |
| 23 | +//! ```text |
| 24 | +//! ┌──────┬──────┬──────────────╥───────┬──────────┬────────────┐ |
| 25 | +//! │ ACPI │ PCI │ END_INSTANCE ║ CDROM │ FILEPATH │ END_ENTIRE │ |
| 26 | +//! └──────┴──────┴──────────────╨───────┴──────────┴────────────┘ |
| 27 | +//! ↑ ↑ ↑ ↑ ↑ ↑ ↑ |
| 28 | +//! ├─Node─╨─Node─╨─────Node─────╨─Node──╨───Node───╨────Node────┤ |
| 29 | +//! ↑ ↑ ↑ |
| 30 | +//! ├─── DevicePathInstance ─────╨────── DevicePathInstance ─────┤ |
| 31 | +//! │ │ |
| 32 | +//! └──────────────────── Entire DevicePath ─────────────────────┘ |
| 33 | +//! ``` |
| 34 | +//! |
| 35 | +//! [`END_ENTIRE`]: DeviceSubType::END_ENTIRE |
| 36 | +//! [`END_INSTANCE`]: DeviceSubType::END_INSTANCE |
| 37 | +//! [protocol]: crate::protocol |
| 38 | +
|
3 | 39 | mod device_path_gen;
|
4 | 40 |
|
5 | 41 | use crate::{guid, Boolean, Char16, Guid};
|
|
0 commit comments