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#![forbid(unsafe_code)]
14#![no_std]
15
16// TODO: find a nice way to create const `Ucs2LeSlice` instances, and use proper
17// `const`ants instead of runtime methods...
18macro_rules! defn_nvram_var {
19 ($varname:ident = ($guid:expr, $name:literal)) => {
20 #[allow(non_snake_case)]
21 pub fn $varname() -> (Guid, &'static ucs2::Ucs2LeSlice) {
22 use ucs2::Ucs2LeSlice;
23 use zerocopy::IntoBytes;
24
25 (
26 $guid,
27 Ucs2LeSlice::from_slice_with_nul(wchar::wchz!(u16, $name).as_bytes()).unwrap(),
28 )
29 }
30 };
31}
32
33pub mod hyperv;
34pub mod linux;
35pub mod uefi;