Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/aienux/blob/main/vendor/uefi/src/runtime/mod.rs # aienux Aienux, the AienOS kernel: boot, scheduling, IPC and capability boundaries. Pre-alpha; host, emulator and physical evidence are labelled separately. Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `aienux / vendor / uefi / src / runtime / mod.rs` 641 lines ยท 23208 bytes Raw Blame History 1 // SPDX-License-Identifier: MIT OR Apache-2.0 2 3 //! UEFI runtime services. 4 //! 5 //! These services are available both before and after exiting boot 6 //! services. Note that various restrictions apply when calling runtime services 7 //! functions after exiting boot services; see the "Calling Convention" section 8 //! of the UEFI specification for details. 9 10 mod time; 11 12 pub use time::*; 13 14 use crate::data_types::PhysicalAddress; 15 use crate::table::{self, Revision}; 16 use crate::{CStr16, Error, Result, Status, StatusExt}; 17 use core::fmt::Debug; 18 #[cfg(feature = "alloc")] 19 use core::fmt::{self, Display, Formatter}; 20 use core::ptr::{self, NonNull}; 21 use uefi_raw::table::boot::MemoryDescriptor; 22 use uefi_raw::table::runtime::RuntimeServices; 23 use uefi_raw::table::system::SystemTable; 24 25 #[cfg(feature = "alloc")] 26 use { 27 crate::CString16, 28 crate::Guid, 29 crate::mem::make_boxed, 30 alloc::borrow::ToOwned, 31 alloc::boxed::Box, 32 alloc::{vec, vec::Vec}, 33 }; 34 35 pub use uefi_raw::capsule::{CapsuleBlockDescriptor, CapsuleFlags, CapsuleHeader}; 36 pub use uefi_raw::table::runtime::{ 37 ResetType, TimeCapabilities, VariableAttributes, VariableVendor, 38 }; 39 pub use uefi_raw::time::Daylight; 40 41 fn runtime_services_raw_panicking() -> NonNull { 42 let st = table::system_table_raw_panicking(); 43 // SAFETY: valid per requirements of `set_system_table`. 44 let st = unsafe { st.as_ref() }; 45 NonNull::new(st.runtime_services).expect("runtime services are not active") 46 } 47 48 /// Query the current time and date information. 49 pub fn get_time() -> Result