StandardBootServices

Struct StandardBootServices 

Source
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>

Source

pub const fn new(efi_boot_services: &'a BootServices) -> Self

Create a new StandardBootServices with the provided efi::BootServices.

Source

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.

Source

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<'_>

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>

Source§

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>

Source§

fn close_event(&self, event: Event) -> Result<(), Status>

Close an event. Read more
Source§

fn signal_event(&self, event: Event) -> Result<(), Status>

Signals an event. Read more
Source§

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>

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>

Sets the type of timer and the trigger time for a timer event. Read more
Source§

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)

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>

Allocates memory pages from the system. Read more
Source§

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)>

Returns the current memory map. Read more
Source§

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>

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>

Source§

unsafe fn uninstall_protocol_interface_unchecked( &self, handle: Handle, protocol: &'static Guid, interface: *mut c_void, ) -> Result<(), Status>

Source§

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>

Source§

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>

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>

Source§

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>

Source§

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,

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>

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>

Disconnects one or more drivers from a controller. Read more
Source§

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,

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>

Source§

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>>)>

Transfers control to a loaded image’s entry point. Read more
Source§

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>

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>

Terminates all boot services. Read more
Source§

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>

Induces a fine-grained stall Read more
Source§

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 more
Source§

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>

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>

Source§

unsafe 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,

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,

Create an event in a group. Read more
Source§

fn raise_tpl_guarded<'a>(&'a self, tpl: Tpl) -> TplGuard<'a, Self>

Raises a task’s priority level and returns a TplGuard that will restore the tpl when dropped. Read more
Source§

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>
where P: Protocol<Interface = I> + 'static, R: CMutRef<'static, Type = I> + 'static, I: 'static,

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>
where P: Protocol<Interface = ()> + 'static,

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>
where P: Protocol<Interface = I> + 'static, R: CMutRef<'static, Type = I> + 'static, I: 'static,

Removes a protocol interface from a device handle. Read more
Source§

fn uninstall_protocol_marker<P>( &self, handle: Handle, protocol: &P, ) -> Result<(), Status>
where P: Protocol<Interface = ()> + 'static,

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>
where P: Protocol<Interface = I> + 'static, O: CMutRef<'static, Type = I> + 'static, N: CMutRef<'static, Type = I> + 'static, I: 'static,

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>

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>

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>

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>

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>
where P: Protocol<Interface = I> + 'static, I: Any + 'static,

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>
where P: Protocol<Interface = ()> + 'static,

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>

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>

Load an EFI image from a file. Read more
Source§

fn copy_mem<T: 'static>(&self, dest: &mut T, src: &T)

Copies the contents of one buffer to another buffer. Read more
Source§

fn install_configuration_table<T: CMutPtr<'static> + 'static>( &self, guid: &Guid, table: T, ) -> Result<(), Status>

Adds, updates, or removes a configuration table entry from the EFI System Table. Read more
Source§

fn calculate_crc_32<T: 'static>(&self, data: &T) -> Result<u32, Status>

Computes and returns a 32-bit CRC for a data buffer. Read more
Source§

impl<'a> Debug for StandardBootServices<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Send for StandardBootServices<'static>

SAFETY: When the lifetime is 'static, the pointer is guaranteed to stay valid.

Source§

impl Sync for StandardBootServices<'static>

SAFETY: StandardBootServices uses an atomic ptr to access the BootServices.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.