rust/library/std/src/sys/path
Ayush Singh c1790b14bc
uefi: Implement path
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.

Signed-off-by: Ayush Singh <ayush@beagleboard.org>
2025-01-16 10:19:22 +05:30
..
windows library: consistently use American spelling for 'behavior' 2024-10-25 12:02:47 +02:00
mod.rs uefi: Implement path 2025-01-16 10:19:22 +05:30
sgx.rs path: Move is_absolute check to sys::path 2025-01-13 11:52:03 +05:30
uefi.rs uefi: Implement path 2025-01-16 10:19:22 +05:30
unix.rs path: Move is_absolute check to sys::path 2025-01-13 11:52:03 +05:30
unsupported_backslash.rs path: Move is_absolute check to sys::path 2025-01-13 11:52:03 +05:30
windows.rs path: Move is_absolute check to sys::path 2025-01-13 11:52:03 +05:30