pub struct StandardBootServices<'a> { /* private fields */ }Expand description
This is the boot services used in the UEFI.
it wraps an atomic ptr to efi::BootServices
Implementations§
Source§impl<'a> StandardBootServices<'a>
impl<'a> StandardBootServices<'a>
Sourcepub const fn new(efi_boot_services: &'a BootServices) -> Self
pub const fn new(efi_boot_services: &'a BootServices) -> Self
Create a new StandardBootServices with the provided efi::BootServices.
Sourcepub const fn new_uninit() -> Self
pub const fn new_uninit() -> Self
Create a new StandardBootServices that is uninitialized. The struct need to be initialize later with Self::initialize, otherwise, subsequent call will panic.
Sourcepub fn initialize(&'a self, efi_boot_services: &'a BootServices)
pub fn initialize(&'a self, efi_boot_services: &'a BootServices)
Initialize the StandardBootServices with a reference to efi::BootServices.
§Panics
This function will panic if already initialize.
Trait Implementations§
Source§impl BootServices for StandardBootServices<'_>
impl BootServices for StandardBootServices<'_>
Source§unsafe fn create_event_unchecked<T: Sized + 'static>(
&self,
event_type: EventType,
notify_tpl: Tpl,
notify_function: Option<EventNotifyCallback<*mut T>>,
notify_context: *mut T,
) -> Result<Event, Status>
unsafe fn create_event_unchecked<T: Sized + 'static>( &self, event_type: EventType, notify_tpl: Tpl, notify_function: Option<EventNotifyCallback<*mut T>>, notify_context: *mut T, ) -> Result<Event, Status>
Use
BootServices::create_event when possible. Read moreSource§unsafe fn create_event_ex_unchecked<T: Sized + 'static>(
&self,
event_type: EventType,
notify_tpl: Tpl,
notify_function: EventNotifyCallback<*mut T>,
notify_context: *mut T,
event_group: &'static Guid,
) -> Result<Event, Status>
unsafe fn create_event_ex_unchecked<T: Sized + 'static>( &self, event_type: EventType, notify_tpl: Tpl, notify_function: EventNotifyCallback<*mut T>, notify_context: *mut T, event_group: &'static Guid, ) -> Result<Event, Status>
Use
BootServices::create_event_ex when possible. Read moreSource§fn wait_for_event(&self, events: &mut [Event]) -> Result<usize, Status>
fn wait_for_event(&self, events: &mut [Event]) -> Result<usize, Status>
Stops execution until an event is signaled. Read more
Source§fn check_event(&self, event: Event) -> Result<(), Status>
fn check_event(&self, event: Event) -> Result<(), Status>
Checks whether an event is in the signaled state. Read more
Source§fn set_timer(
&self,
event: Event,
timer_type: EventTimerType,
trigger_time: u64,
) -> Result<(), Status>
fn set_timer( &self, event: Event, timer_type: EventTimerType, trigger_time: u64, ) -> Result<(), Status>
Sets the type of timer and the trigger time for a timer event. Read more
Source§fn raise_tpl(&self, new_tpl: Tpl) -> Tpl
fn raise_tpl(&self, new_tpl: Tpl) -> Tpl
Raises a task’s priority level and returns its previous level. Read more
Source§fn restore_tpl(&self, old_tpl: Tpl)
fn restore_tpl(&self, old_tpl: Tpl)
Restores a task’s priority level to its previous value. Read more
Source§fn allocate_pages(
&self,
alloc_type: AllocType,
memory_type: MemoryType,
nb_pages: usize,
) -> Result<usize, Status>
fn allocate_pages( &self, alloc_type: AllocType, memory_type: MemoryType, nb_pages: usize, ) -> Result<usize, Status>
Allocates memory pages from the system. Read more
Source§fn free_pages(&self, address: usize, nb_pages: usize) -> Result<(), Status>
fn free_pages(&self, address: usize, nb_pages: usize) -> Result<(), Status>
Frees memory pages. Read more
Source§fn get_memory_map<'a>(&'a self) -> Result<MemoryMap<'a, Self>, (Status, usize)>
fn get_memory_map<'a>(&'a self) -> Result<MemoryMap<'a, Self>, (Status, usize)>
Returns the current memory map. Read more
Source§fn allocate_pool(
&self,
memory_type: MemoryType,
size: usize,
) -> Result<*mut u8, Status>
fn allocate_pool( &self, memory_type: MemoryType, size: usize, ) -> Result<*mut u8, Status>
Allocates pool memory. Read more
Source§fn free_pool(&self, buffer: *mut u8) -> Result<(), Status>
fn free_pool(&self, buffer: *mut u8) -> Result<(), Status>
Returns pool memory to the system. Read more
Source§unsafe fn install_protocol_interface_unchecked(
&self,
handle: Option<Handle>,
protocol: &'static Guid,
interface: *mut c_void,
) -> Result<Handle, Status>
unsafe fn install_protocol_interface_unchecked( &self, handle: Option<Handle>, protocol: &'static Guid, interface: *mut c_void, ) -> Result<Handle, Status>
Use
BootServices::install_protocol_interface when possible. Read moreSource§unsafe fn uninstall_protocol_interface_unchecked(
&self,
handle: Handle,
protocol: &'static Guid,
interface: *mut c_void,
) -> Result<(), Status>
unsafe fn uninstall_protocol_interface_unchecked( &self, handle: Handle, protocol: &'static Guid, interface: *mut c_void, ) -> Result<(), Status>
Use
BootServices::uninstall_protocol_interface when possible. Read moreSource§unsafe fn reinstall_protocol_interface_unchecked(
&self,
handle: Handle,
protocol: &'static Guid,
old_protocol_interface: *mut c_void,
new_protocol_interface: *mut c_void,
) -> Result<(), Status>
unsafe fn reinstall_protocol_interface_unchecked( &self, handle: Handle, protocol: &'static Guid, old_protocol_interface: *mut c_void, new_protocol_interface: *mut c_void, ) -> Result<(), Status>
Use
BootServices::reinstall_protocol_interface when possible. Read moreSource§fn register_protocol_notify(
&self,
protocol: &Guid,
event: Event,
) -> Result<Registration, Status>
fn register_protocol_notify( &self, protocol: &Guid, event: Event, ) -> Result<Registration, Status>
Creates an event that is to be signaled whenever an interface is installed for a specified protocol. Read more
Source§fn locate_handle(
&self,
search_type: HandleSearchType,
) -> Result<BootServicesBox<'_, [Handle], Self>, Status>
fn locate_handle( &self, search_type: HandleSearchType, ) -> Result<BootServicesBox<'_, [Handle], Self>, Status>
Returns an array of handles that support a specified protocol. Read more
Source§unsafe fn handle_protocol_unchecked(
&self,
handle: Handle,
protocol: &Guid,
) -> Result<*mut c_void, Status>
unsafe fn handle_protocol_unchecked( &self, handle: Handle, protocol: &Guid, ) -> Result<*mut c_void, Status>
Use
BootServices::handle_protocol when possible.Source§unsafe fn locate_device_path(
&self,
protocol: &Guid,
device_path: *mut *mut Protocol,
) -> Result<Handle, Status>
unsafe fn locate_device_path( &self, protocol: &Guid, device_path: *mut *mut Protocol, ) -> Result<Handle, Status>
Locates the handle to a device on the device path that supports the specified protocol. Read more
Source§unsafe fn open_protocol_unchecked(
&self,
handle: Handle,
protocol: &Guid,
agent_handle: Handle,
controller_handle: Handle,
attribute: u32,
) -> Result<*mut c_void, Status>
unsafe fn open_protocol_unchecked( &self, handle: Handle, protocol: &Guid, agent_handle: Handle, controller_handle: Handle, attribute: u32, ) -> Result<*mut c_void, Status>
Use
BootServices::open_protocol when possible. Read moreSource§fn close_protocol(
&self,
handle: Handle,
protocol: &Guid,
agent_handle: Handle,
controller_handle: Handle,
) -> Result<(), Status>
fn close_protocol( &self, handle: Handle, protocol: &Guid, agent_handle: Handle, controller_handle: Handle, ) -> Result<(), Status>
Closes a protocol on a handle that was previously opened. Read more
Source§fn open_protocol_information(
&self,
handle: Handle,
protocol: &Guid,
) -> Result<BootServicesBox<'_, [OpenProtocolInformationEntry], Self>, Status>where
Self: Sized,
fn open_protocol_information(
&self,
handle: Handle,
protocol: &Guid,
) -> Result<BootServicesBox<'_, [OpenProtocolInformationEntry], Self>, Status>where
Self: Sized,
Retrieves the list of agents that currently have a protocol interface opened. Read more
Source§unsafe fn connect_controller(
&self,
controller_handle: Handle,
driver_image_handles: Vec<Handle>,
remaining_device_path: *mut Protocol,
recursive: bool,
) -> Result<(), Status>
unsafe fn connect_controller( &self, controller_handle: Handle, driver_image_handles: Vec<Handle>, remaining_device_path: *mut Protocol, recursive: bool, ) -> Result<(), Status>
Connects one or more drivers to a controller. Read more
Source§fn disconnect_controller(
&self,
controller_handle: Handle,
driver_image_handle: Option<Handle>,
child_handle: Option<Handle>,
) -> Result<(), Status>
fn disconnect_controller( &self, controller_handle: Handle, driver_image_handle: Option<Handle>, child_handle: Option<Handle>, ) -> Result<(), Status>
Disconnects one or more drivers from a controller. Read more
Source§fn protocols_per_handle(
&self,
handle: Handle,
) -> Result<BootServicesBox<'_, [&'static Guid], Self>, Status>
fn protocols_per_handle( &self, handle: Handle, ) -> Result<BootServicesBox<'_, [&'static Guid], Self>, Status>
Retrieves the list of protocol interface GUIDs that are installed on a handle in a buffer allocated from pool. Read more
Source§fn locate_handle_buffer(
&self,
search_type: HandleSearchType,
) -> Result<BootServicesBox<'_, [Handle], Self>, Status>where
Self: Sized,
fn locate_handle_buffer(
&self,
search_type: HandleSearchType,
) -> Result<BootServicesBox<'_, [Handle], Self>, Status>where
Self: Sized,
Returns an array of handles that support the requested protocol in a buffer allocated from pool. Read more
Source§unsafe fn locate_protocol_unchecked(
&self,
protocol: &'static Guid,
registration: *mut c_void,
) -> Result<*mut c_void, Status>
unsafe fn locate_protocol_unchecked( &self, protocol: &'static Guid, registration: *mut c_void, ) -> Result<*mut c_void, Status>
Use
BootServices::locate_protocol when possible. Read moreSource§fn load_image(
&self,
boot_policy: bool,
parent_image_handle: Handle,
device_path: *mut Protocol,
source_buffer: Option<&[u8]>,
) -> Result<Handle, Status>
fn load_image( &self, boot_policy: bool, parent_image_handle: Handle, device_path: *mut Protocol, source_buffer: Option<&[u8]>, ) -> Result<Handle, Status>
Loads an EFI image into memory. Read more
Source§fn start_image<'a>(
&'a self,
image_handle: Handle,
) -> Result<(), (Status, Option<BootServicesBox<'a, [u8], Self>>)>
fn start_image<'a>( &'a self, image_handle: Handle, ) -> Result<(), (Status, Option<BootServicesBox<'a, [u8], Self>>)>
Transfers control to a loaded image’s entry point. Read more
Source§fn unload_image(&self, image_handle: Handle) -> Result<(), Status>
fn unload_image(&self, image_handle: Handle) -> Result<(), Status>
Unloads an image. Read more
Source§fn exit<'a>(
&'a self,
image_handle: Handle,
exit_status: Status,
exit_data: Option<BootServicesBox<'a, [u8], Self>>,
) -> Result<(), Status>
fn exit<'a>( &'a self, image_handle: Handle, exit_status: Status, exit_data: Option<BootServicesBox<'a, [u8], Self>>, ) -> Result<(), Status>
Terminates a loaded EFI image and returns control to boot services. Read more
Source§fn exit_boot_services(
&self,
image_handle: Handle,
map_key: usize,
) -> Result<(), Status>
fn exit_boot_services( &self, image_handle: Handle, map_key: usize, ) -> Result<(), Status>
Terminates all boot services. Read more
Source§fn set_watchdog_timer(&self, timeout: usize) -> Result<(), Status>
fn set_watchdog_timer(&self, timeout: usize) -> Result<(), Status>
Sets the system’s watchdog timer. Read more
Source§fn stall(&self, microseconds: usize) -> Result<(), Status>
fn stall(&self, microseconds: usize) -> Result<(), Status>
Induces a fine-grained stall Read more
Source§unsafe fn copy_mem_unchecked(
&self,
dest: *mut c_void,
src: *const c_void,
length: usize,
)
unsafe fn copy_mem_unchecked( &self, dest: *mut c_void, src: *const c_void, length: usize, )
Use of
Self::copy_mem is preferable if the context allows it. Read moreSource§fn set_mem(&self, buffer: &mut [u8], value: u8)
fn set_mem(&self, buffer: &mut [u8], value: u8)
Fills a buffer with a specified value. Read more
Source§fn get_next_monotonic_count(&self) -> Result<u64, Status>
fn get_next_monotonic_count(&self) -> Result<u64, Status>
Returns a monotonically increasing count for the platform. Read more
Source§unsafe fn install_configuration_table_unchecked(
&self,
guid: &Guid,
table: *mut c_void,
) -> Result<(), Status>
unsafe fn install_configuration_table_unchecked( &self, guid: &Guid, table: *mut c_void, ) -> Result<(), Status>
Use
BootServices::install_configuration_table when possible. Read moreunsafe fn calculate_crc_32_unchecked( &self, data: *const c_void, data_size: usize, ) -> Result<u32, Status>
Source§fn create_event<T>(
&self,
event_type: EventType,
notify_tpl: Tpl,
notify_function: Option<EventNotifyCallback<T>>,
notify_context: T,
) -> Result<Event, Status>where
T: CPtr<'static> + 'static,
fn create_event<T>(
&self,
event_type: EventType,
notify_tpl: Tpl,
notify_function: Option<EventNotifyCallback<T>>,
notify_context: T,
) -> Result<Event, Status>where
T: CPtr<'static> + 'static,
Create an event. Read more
Source§fn create_event_ex<T>(
&self,
event_type: EventType,
notify_tpl: Tpl,
notify_function: Option<EventNotifyCallback<T>>,
notify_context: T,
event_group: &'static Guid,
) -> Result<Event, Status>where
T: CPtr<'static> + 'static,
fn create_event_ex<T>(
&self,
event_type: EventType,
notify_tpl: Tpl,
notify_function: Option<EventNotifyCallback<T>>,
notify_context: T,
event_group: &'static Guid,
) -> Result<Event, Status>where
T: CPtr<'static> + 'static,
Create an event in a group. Read more
Source§fn raise_tpl_guarded<'a>(&'a self, tpl: Tpl) -> TplGuard<'a, Self>
fn raise_tpl_guarded<'a>(&'a self, tpl: Tpl) -> TplGuard<'a, Self>
Source§fn allocate_pool_for_type<T: 'static>(
&self,
pool_type: MemoryType,
) -> Result<*mut T, Status>
fn allocate_pool_for_type<T: 'static>( &self, pool_type: MemoryType, ) -> Result<*mut T, Status>
Allocates pool memory casted as given type.
Source§fn install_protocol_interface<P, R, I>(
&self,
handle: Option<Handle>,
protocol: &P,
interface: R,
) -> Result<(Handle, PtrMetadata<'static, R>), Status>
fn install_protocol_interface<P, R, I>( &self, handle: Option<Handle>, protocol: &P, interface: R, ) -> Result<(Handle, PtrMetadata<'static, R>), Status>
Installs a protocol interface on a device handle.
If the handle does not exist, it is created and added to the list of handles in the system. Read more
Source§fn install_protocol_marker<P>(
&self,
handle: Option<Handle>,
protocol: &P,
) -> Result<Handle, Status>
fn install_protocol_marker<P>( &self, handle: Option<Handle>, protocol: &P, ) -> Result<Handle, Status>
Installs a protocol marker (null) interface on a device handle.
If the handle does not exist, it is created and added to the list of handles in the system. Read more
Source§fn uninstall_protocol_interface<P, R, I>(
&self,
handle: Handle,
protocol: &P,
key: PtrMetadata<'static, R>,
) -> Result<R, Status>
fn uninstall_protocol_interface<P, R, I>( &self, handle: Handle, protocol: &P, key: PtrMetadata<'static, R>, ) -> Result<R, Status>
Removes a protocol interface from a device handle. Read more
Source§fn uninstall_protocol_marker<P>(
&self,
handle: Handle,
protocol: &P,
) -> Result<(), Status>
fn uninstall_protocol_marker<P>( &self, handle: Handle, protocol: &P, ) -> Result<(), Status>
Removes a protocol interface marker (null) from a device handle. Read more
Source§fn reinstall_protocol_interface<P, O, N, I>(
&self,
handle: Handle,
protocol: &P,
old_protocol_interface_key: PtrMetadata<'static, O>,
new_protocol_interface: N,
) -> Result<(PtrMetadata<'static, N>, O), Status>
fn reinstall_protocol_interface<P, O, N, I>( &self, handle: Handle, protocol: &P, old_protocol_interface_key: PtrMetadata<'static, O>, new_protocol_interface: N, ) -> Result<(PtrMetadata<'static, N>, O), Status>
Reinstalls a protocol interface on a device handle. Read more
Source§unsafe fn handle_protocol<P: Protocol<Interface = I> + 'static, I: 'static>(
&self,
handle: Handle,
protocol: &P,
) -> Result<&'static mut I, Status>
unsafe fn handle_protocol<P: Protocol<Interface = I> + 'static, I: 'static>( &self, handle: Handle, protocol: &P, ) -> Result<&'static mut I, Status>
Queries a handle to determine if it supports a specified protocol and return a mutable reference to the interface. Read more
Source§fn handle_protocol_marker<P: Protocol<Interface = ()> + 'static>(
&self,
handle: Handle,
protocol: &P,
) -> Result<(), Status>
fn handle_protocol_marker<P: Protocol<Interface = ()> + 'static>( &self, handle: Handle, protocol: &P, ) -> Result<(), Status>
Queries a handle to determine if it supports a specified protocol marker. Read more
Source§unsafe fn open_protocol<P: Protocol<Interface = I> + 'static, I: 'static>(
&self,
handle: Handle,
protocol: &P,
agent_handle: Handle,
controller_handle: Handle,
attribute: u32,
) -> Result<&'static mut I, Status>
unsafe fn open_protocol<P: Protocol<Interface = I> + 'static, I: 'static>( &self, handle: Handle, protocol: &P, agent_handle: Handle, controller_handle: Handle, attribute: u32, ) -> Result<&'static mut I, Status>
Queries a handle to determine if it supports a specified protocol.
If the protocol is supported by the handle, it opens the protocol on behalf of the calling agent. Read more
Source§fn open_protocol_marker<P: Protocol<Interface = ()> + 'static>(
&self,
handle: Handle,
protocol: &P,
agent_handle: Handle,
controller_handle: Handle,
attribute: u32,
) -> Result<(), Status>
fn open_protocol_marker<P: Protocol<Interface = ()> + 'static>( &self, handle: Handle, protocol: &P, agent_handle: Handle, controller_handle: Handle, attribute: u32, ) -> Result<(), Status>
Queries a handle to determine if it supports a specified protocol marker.
If the protocol is supported by the handle, it opens the protocol on behalf of the calling agent. Read more
Source§unsafe fn locate_protocol<P, I>(
&self,
protocol: &P,
registration: Option<Registration>,
) -> Result<&'static mut I, Status>
unsafe fn locate_protocol<P, I>( &self, protocol: &P, registration: Option<Registration>, ) -> Result<&'static mut I, Status>
Returns the first protocol instance that matches the given protocol. Read more
Source§fn locate_protocol_marker<P>(
&self,
protocol: &P,
registration: Option<Registration>,
) -> Result<(), Status>
fn locate_protocol_marker<P>( &self, protocol: &P, registration: Option<Registration>, ) -> Result<(), Status>
Returns the first protocol instance that matches the given marker protocol. Read more
Source§fn load_image_from_source(
&self,
parent_image_handle: Handle,
device_path: *mut Protocol,
source_buffer: &[u8],
) -> Result<Handle, Status>
fn load_image_from_source( &self, parent_image_handle: Handle, device_path: *mut Protocol, source_buffer: &[u8], ) -> Result<Handle, Status>
Load an EFI image from a memory buffer. Read more
Source§fn load_image_from_file(
&self,
parent_image_handle: Handle,
file_device_path: NonNull<Protocol>,
) -> Result<Handle, Status>
fn load_image_from_file( &self, parent_image_handle: Handle, file_device_path: NonNull<Protocol>, ) -> Result<Handle, Status>
Load an EFI image from a file. Read more
Source§fn copy_mem<T: 'static>(&self, dest: &mut T, src: &T)
fn copy_mem<T: 'static>(&self, dest: &mut T, src: &T)
Copies the contents of one buffer to another buffer. Read more
Source§impl<'a> Debug for StandardBootServices<'a>
impl<'a> Debug for StandardBootServices<'a>
impl Send for StandardBootServices<'static>
SAFETY: When the lifetime is 'static, the pointer is guaranteed to stay valid.
impl Sync for StandardBootServices<'static>
SAFETY: StandardBootServices uses an atomic ptr to access the BootServices.
Auto Trait Implementations§
impl<'a> !Freeze for StandardBootServices<'a>
impl<'a> RefUnwindSafe for StandardBootServices<'a>
impl<'a> Unpin for StandardBootServices<'a>
impl<'a> UnwindSafe for StandardBootServices<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more