//! UEFI runtime services. //! //! These services are available both before and after exiting boot //! services. Note that various restrictions apply when calling runtime services //! functions after exiting boot services; see the "Calling Convention" section //! of the UEFI specification for details. use crate::data_types::PhysicalAddress; use crate::table::{self, Revision}; use crate::{CStr16, Error, Result, Status, StatusExt}; use core::fmt::{self, Debug, Display, Formatter}; use core::mem; use core::ptr::{self, NonNull}; use uefi_raw::table::boot::MemoryDescriptor; #[cfg(feature = "alloc")] use { crate::mem::make_boxed, crate::CString16, crate::Guid, alloc::borrow::ToOwned, alloc::boxed::Box, alloc::vec::Vec, }; #[cfg(all(feature = "unstable", feature = "alloc"))] use alloc::alloc::Global; pub use uefi_raw::capsule::{CapsuleBlockDescriptor, CapsuleFlags, CapsuleHeader}; pub use uefi_raw::table::runtime::{ ResetType, TimeCapabilities, VariableAttributes, VariableVendor, }; pub use uefi_raw::time::Daylight; fn runtime_services_raw_panicking() -> NonNull { let st = table::system_table_raw_panicking(); // SAFETY: valid per requirements of `set_system_table`. let st = unsafe { st.as_ref() }; NonNull::new(st.runtime_services).expect("runtime services are not active") } /// Query the current time and date information. pub fn get_time() -> Result