rust/library/std
Matthias Krüger 55c7a02a8b
Rollup merge of #135475 - Ayush1325:uefi-absolute-path, r=jhpratt
uefi: Implement path

This PR is split off from https://github.com/rust-lang/rust/pull/135368 to reduce noise.

UEFI paths can be of 4 types:
1. Absolute Shell Path: Uses shell mappings
2. Absolute Device Path: this is what we want
3. Relative root: path relative to the current root.
4. Relative

Absolute shell path can be identified with `:` and Absolute Device path can be identified with `/`. Relative root path will start with `\`.

The algorithm is mostly taken from edk2 UEFI shell implementation and is somewhat simple. Check for the path type in order.

For Absolute Shell path, use `EFI_SHELL->GetDevicePathFromMap` to get a BorrowedDevicePath for the volume.

For Relative paths, we use the current working directory to construct the new path.

BorrowedDevicePath abstraction is needed to interact with `EFI_SHELL->GetDevicePathFromMap` which returns a Device Path Protocol with the lifetime of UEFI shell.

Absolute Shell paths cannot exist if UEFI shell is missing.

cc `@nicholasbishop`
2025-01-30 20:47:04 +01:00
..
benches Reformat use declarations. 2024-07-29 08:26:52 +10:00
src Rollup merge of #135475 - Ayush1325:uefi-absolute-path, r=jhpratt 2025-01-30 20:47:04 +01:00
tests Fix testing of the standard library with Emscripten 2025-01-24 09:25:34 +00:00
build.rs Enable f128 tests on all non-buggy platforms 🎉 2024-11-03 19:33:04 -06:00
Cargo.toml add nto80 x86-64 and aarch64 target 2025-01-24 12:41:49 +00:00