uefi_specs/
lib.rs

1// Copyright (c) Microsoft Corporation.
2// Licensed under the MIT License.
3
4//! Types and constants related to the UEFI spec.
5//!
6//! This crate is divided into 3 submodules:
7//!
8//! - `uefi`: types directly lifted from the official UEFI spec
9//! - `hyperv`: types specific to the Hyper-V UEFI implementation
10//! - `linux`: types specific to UEFI on Linux
11
12#![expect(missing_docs)]
13#![no_std]
14
15// TODO: find a nice way to create const `Ucs2LeSlice` instances, and use proper
16// `const`ants instead of runtime methods...
17macro_rules! defn_nvram_var {
18    ($varname:ident = ($guid:expr, $name:literal)) => {
19        #[allow(non_snake_case)]
20        pub fn $varname() -> (Guid, &'static ucs2::Ucs2LeSlice) {
21            use ucs2::Ucs2LeSlice;
22            use zerocopy::IntoBytes;
23
24            (
25                $guid,
26                Ucs2LeSlice::from_slice_with_nul(wchar::wchz!(u16, $name).as_bytes()).unwrap(),
27            )
28        }
29    };
30}
31
32pub mod hyperv;
33pub mod linux;
34pub mod uefi;