pub trait BootServices {
Show 61 methods
// Required methods
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_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>;
fn close_event(&self, event: Event) -> Result<(), Status>;
fn signal_event(&self, event: Event) -> Result<(), Status>;
fn wait_for_event(&self, events: &mut [Event]) -> Result<usize, Status>;
fn check_event(&self, event: Event) -> Result<(), Status>;
fn set_timer(
&self,
event: Event,
timer_type: EventTimerType,
trigger_time: u64,
) -> Result<(), Status>;
fn raise_tpl(&self, tpl: Tpl) -> Tpl;
fn restore_tpl(&self, tpl: Tpl);
fn allocate_pages(
&self,
alloc_type: AllocType,
memory_type: MemoryType,
nb_pages: usize,
) -> Result<usize, Status>;
fn free_pages(&self, address: usize, nb_pages: usize) -> Result<(), Status>;
fn get_memory_map<'a>(
&'a self,
) -> Result<MemoryMap<'a, Self>, (Status, usize)>;
fn allocate_pool(
&self,
pool_type: MemoryType,
size: usize,
) -> Result<*mut u8, Status>;
fn free_pool(&self, buffer: *mut u8) -> Result<(), Status>;
unsafe fn install_protocol_interface_unchecked(
&self,
handle: Option<Handle>,
protocol: &'static Guid,
interface: *mut c_void,
) -> Result<Handle, Status>;
unsafe fn uninstall_protocol_interface_unchecked(
&self,
handle: Handle,
protocol: &'static Guid,
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>;
fn register_protocol_notify(
&self,
protocol: &'static Guid,
event: Event,
) -> Result<Registration, Status>;
fn locate_handle<'a>(
&'a self,
search_type: HandleSearchType,
) -> Result<BootServicesBox<'a, [Handle], Self>, Status>;
unsafe fn handle_protocol_unchecked(
&self,
handle: Handle,
protocol: &Guid,
) -> Result<*mut c_void, Status>;
unsafe fn locate_device_path(
&self,
protocol: &Guid,
device_path: *mut *mut Protocol,
) -> Result<Handle, Status>;
unsafe fn open_protocol_unchecked(
&self,
handle: Handle,
protocol: &Guid,
agent_handle: Handle,
controller_handle: Handle,
attribute: u32,
) -> Result<*mut c_void, Status>;
fn close_protocol(
&self,
handle: Handle,
protocol: &Guid,
agent_handle: Handle,
controller_handle: Handle,
) -> Result<(), Status>;
fn open_protocol_information<'a>(
&'a self,
handle: Handle,
protocol: &Guid,
) -> Result<BootServicesBox<'a, [OpenProtocolInformationEntry], Self>, Status>;
unsafe fn connect_controller(
&self,
controller_handle: Handle,
driver_image_handles: Vec<Handle>,
remaining_device_path: *mut Protocol,
recursive: bool,
) -> Result<(), Status>;
fn disconnect_controller(
&self,
controller_handle: Handle,
driver_image_handle: Option<Handle>,
child_handle: Option<Handle>,
) -> Result<(), Status>;
fn protocols_per_handle<'a>(
&'a self,
handle: Handle,
) -> Result<BootServicesBox<'a, [&'static Guid], Self>, Status>;
fn locate_handle_buffer<'a>(
&'a self,
search_type: HandleSearchType,
) -> Result<BootServicesBox<'a, [Handle], Self>, Status>;
unsafe fn locate_protocol_unchecked(
&self,
protocol: &'static Guid,
registration: *mut c_void,
) -> Result<*mut c_void, Status>;
fn load_image<'a>(
&self,
boot_policy: bool,
parent_image_handle: Handle,
device_path: *mut Protocol,
source_buffer: Option<&'a [u8]>,
) -> Result<Handle, Status>;
fn start_image<'a>(
&'a self,
image_handle: Handle,
) -> Result<(), (Status, Option<BootServicesBox<'a, [u8], Self>>)>;
fn unload_image(&self, image_handle: Handle) -> Result<(), Status>;
fn exit<'a>(
&'a self,
image_handle: Handle,
exit_status: Status,
exit_data: Option<BootServicesBox<'a, [u8], Self>>,
) -> Result<(), Status>;
fn exit_boot_services(
&self,
image_handle: Handle,
map_key: usize,
) -> Result<(), Status>;
fn set_watchdog_timer(&self, timeout: usize) -> Result<(), Status>;
fn stall(&self, microseconds: usize) -> Result<(), Status>;
unsafe fn copy_mem_unchecked(
&self,
dest: *mut c_void,
src: *const c_void,
length: usize,
);
fn set_mem(&self, buffer: &mut [u8], value: u8);
fn get_next_monotonic_count(&self) -> Result<u64, Status>;
unsafe fn install_configuration_table_unchecked(
&self,
guid: &Guid,
table: *mut c_void,
) -> Result<(), Status>;
unsafe fn calculate_crc_32_unchecked(
&self,
data: *const c_void,
data_size: usize,
) -> Result<u32, Status>;
// Provided methods
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_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 raise_tpl_guarded<'a>(&'a self, tpl: Tpl) -> TplGuard<'a, Self> { ... }
fn allocate_pool_for_type<T: 'static>(
&self,
pool_type: MemoryType,
) -> Result<*mut T, Status> { ... }
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 { ... }
fn install_protocol_marker<P>(
&self,
handle: Option<Handle>,
protocol: &P,
) -> Result<Handle, Status>
where P: Protocol<Interface = ()> + 'static { ... }
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 { ... }
fn uninstall_protocol_marker<P>(
&self,
handle: Handle,
protocol: &P,
) -> Result<(), Status>
where P: Protocol<Interface = ()> + 'static { ... }
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 { ... }
unsafe fn handle_protocol<P: Protocol<Interface = I> + 'static, I: 'static>(
&self,
handle: Handle,
protocol: &P,
) -> Result<&'static mut I, Status> { ... }
fn handle_protocol_marker<P: Protocol<Interface = ()> + 'static>(
&self,
handle: Handle,
protocol: &P,
) -> Result<(), 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> { ... }
fn open_protocol_marker<P: Protocol<Interface = ()> + 'static>(
&self,
handle: Handle,
protocol: &P,
agent_handle: Handle,
controller_handle: Handle,
attribute: u32,
) -> Result<(), Status> { ... }
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 { ... }
fn locate_protocol_marker<P>(
&self,
protocol: &P,
registration: Option<Registration>,
) -> Result<(), Status>
where P: Protocol<Interface = ()> + 'static { ... }
fn load_image_from_source(
&self,
parent_image_handle: Handle,
device_path: *mut Protocol,
source_buffer: &[u8],
) -> Result<Handle, Status> { ... }
fn load_image_from_file(
&self,
parent_image_handle: Handle,
file_device_path: NonNull<Protocol>,
) -> Result<Handle, Status> { ... }
fn copy_mem<T: 'static>(&self, dest: &mut T, src: &T) { ... }
fn install_configuration_table<T: CMutPtr<'static> + 'static>(
&self,
guid: &Guid,
table: T,
) -> Result<(), Status> { ... }
fn calculate_crc_32<T: 'static>(&self, data: &T) -> Result<u32, Status> { ... }
}Expand description
Functions that are available before a successful call to EFI_BOOT_SERVICES.ExitBootServices().
Required Methods§
Sourceunsafe 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.
§Safety
When calling this method, you have to make sure that notify_context pointer is null or all of the following is true:
- The pointer must be properly aligned.
- It must be “dereferenceable” into type
T - It must remain a valid pointer for the lifetime of the event.
- You must enforce Rust’s borrowing1 rules rules.
Sourceunsafe 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.
§Safety
Make sure to comply to the same constraint as BootServices::create_event_unchecked
Sourcefn close_event(&self, event: Event) -> Result<(), Status>
fn close_event(&self, event: Event) -> Result<(), Status>
Close an event.
UEFI Spec Documentation: 7.1.3. EFI_BOOT_SERVICES.CloseEvent()
It is safe to call close_event in the notify function. ↩
Sourcefn signal_event(&self, event: Event) -> Result<(), Status>
fn signal_event(&self, event: Event) -> Result<(), Status>
Signals an event.
UEFI Spec Documentation: 7.1.4. EFI_BOOT_SERVICES.SignalEvent()
Sourcefn 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.
UEFI Spec Documentation: 7.1.5. EFI_BOOT_SERVICES.WaitForEvent()
Sourcefn check_event(&self, event: Event) -> Result<(), Status>
fn check_event(&self, event: Event) -> Result<(), Status>
Checks whether an event is in the signaled state.
UEFI Spec Documentation: 7.1.6. EFI_BOOT_SERVICES.CheckEvent()
Sourcefn 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.
UEFI Spec Documentation: 7.1.7. EFI_BOOT_SERVICES.SetTimer()
Sourcefn raise_tpl(&self, tpl: Tpl) -> Tpl
fn raise_tpl(&self, tpl: Tpl) -> Tpl
Raises a task’s priority level and returns its previous level.
UEFI Spec Documentation: 7.1.8. EFI_BOOT_SERVICES.RaiseTPL()
Sourcefn restore_tpl(&self, tpl: Tpl)
fn restore_tpl(&self, tpl: Tpl)
Restores a task’s priority level to its previous value.
UEFI Spec Documentation: 7.1.9. EFI_BOOT_SERVICES.RestoreTPL()
Sourcefn 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.
UEFI Spec Documentation: 7.2.1. EFI_BOOT_SERVICES.AllocatePages()
Sourcefn free_pages(&self, address: usize, nb_pages: usize) -> Result<(), Status>
fn free_pages(&self, address: usize, nb_pages: usize) -> Result<(), Status>
Frees memory pages.
UEFI Spec Documentation: 7.2.2. EFI_BOOT_SERVICES.FreePages()
Sourcefn 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.
UEFI Spec Documentation: 7.2.3. EFI_BOOT_SERVICES.GetMemoryMap()
Sourcefn allocate_pool(
&self,
pool_type: MemoryType,
size: usize,
) -> Result<*mut u8, Status>
fn allocate_pool( &self, pool_type: MemoryType, size: usize, ) -> Result<*mut u8, Status>
Allocates pool memory.
UEFI Spec Documentation: 7.2.4. EFI_BOOT_SERVICES.AllocatePool()
Sourcefn free_pool(&self, buffer: *mut u8) -> Result<(), Status>
fn free_pool(&self, buffer: *mut u8) -> Result<(), Status>
Returns pool memory to the system.
UEFI Spec Documentation: 7.2.5. EFI_BOOT_SERVICES.FreePool()
Sourceunsafe 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.
§Safety
When calling this method, you have to make sure that if interface pointer is non-null, it is adhereing to the structure associated with the protocol.
Sourceunsafe 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.
§Safety
interface must be a valid pointer and be of the type expected by to protocol.
Sourceunsafe 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.
§Safety
When calling this method, you have to make sure that if new_protocol_interface pointer is non-null, it is adhereing to the structure associated with the protocol.
Sourcefn register_protocol_notify(
&self,
protocol: &'static Guid,
event: Event,
) -> Result<Registration, Status>
fn register_protocol_notify( &self, protocol: &'static Guid, event: Event, ) -> Result<Registration, Status>
Creates an event that is to be signaled whenever an interface is installed for a specified protocol.
UEFI Spec Documentation: 7.3.5. EFI_BOOT_SERVICES.RegisterProtocolNotify()
Sourcefn locate_handle<'a>(
&'a self,
search_type: HandleSearchType,
) -> Result<BootServicesBox<'a, [Handle], Self>, Status>
fn locate_handle<'a>( &'a self, search_type: HandleSearchType, ) -> Result<BootServicesBox<'a, [Handle], Self>, Status>
Returns an array of handles that support a specified protocol.
UEFI Spec Documentation: 7.3.6. EFI_BOOT_SERVICES.LocateHandle()
Sourceunsafe 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.
Sourceunsafe 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.
UEFI Spec Documentation: 7.3.8. EFI_BOOT_SERVICES.LocateDevicePath()
§Safety
device path mut be valid pointers.
Sourceunsafe 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.
§Safety
When calling this method, you have to make sure that if agent_handle pointer is non-null.
Sourcefn 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.
UEFI Spec Documentation: 7.3.10. EFI_BOOT_SERVICES.CloseProtocol()
Sourcefn open_protocol_information<'a>(
&'a self,
handle: Handle,
protocol: &Guid,
) -> Result<BootServicesBox<'a, [OpenProtocolInformationEntry], Self>, Status>
fn open_protocol_information<'a>( &'a self, handle: Handle, protocol: &Guid, ) -> Result<BootServicesBox<'a, [OpenProtocolInformationEntry], Self>, Status>
Retrieves the list of agents that currently have a protocol interface opened.
UEFI Spec Documentation: 7.3.11. EFI_BOOT_SERVICES.OpenProtocolInformation()
Sourceunsafe 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.
§Safety
When calling this method, you have to make sure that driver_image_handle’s last entry is null per UEFI specification.
UEFI Spec Documentation: 7.3.12. EFI_BOOT_SERVICES.ConnectController()
Sourcefn 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.
UEFI Spec Documentation: 7.3.13. EFI_BOOT_SERVICES.DisconnectController()
Sourcefn protocols_per_handle<'a>(
&'a self,
handle: Handle,
) -> Result<BootServicesBox<'a, [&'static Guid], Self>, Status>
fn protocols_per_handle<'a>( &'a self, handle: Handle, ) -> Result<BootServicesBox<'a, [&'static Guid], Self>, Status>
Retrieves the list of protocol interface GUIDs that are installed on a handle in a buffer allocated from pool.
UEFI Spec Documentation: 7.3.14. EFI_BOOT_SERVICES.ProtocolsPerHandle()
Sourcefn locate_handle_buffer<'a>(
&'a self,
search_type: HandleSearchType,
) -> Result<BootServicesBox<'a, [Handle], Self>, Status>
fn locate_handle_buffer<'a>( &'a self, search_type: HandleSearchType, ) -> Result<BootServicesBox<'a, [Handle], Self>, Status>
Returns an array of handles that support the requested protocol in a buffer allocated from pool.
UEFI Spec Documentation: 7.3.15. EFI_BOOT_SERVICES.LocateHandleBuffer()
Sourceunsafe 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.
§Safety
Sourcefn load_image<'a>(
&self,
boot_policy: bool,
parent_image_handle: Handle,
device_path: *mut Protocol,
source_buffer: Option<&'a [u8]>,
) -> Result<Handle, Status>
fn load_image<'a>( &self, boot_policy: bool, parent_image_handle: Handle, device_path: *mut Protocol, source_buffer: Option<&'a [u8]>, ) -> Result<Handle, Status>
Loads an EFI image into memory.
UEFI Spec Documentation: 7.4.1. EFI_BOOT_SERVICES.LoadImage()
Sourcefn 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.
UEFI Spec Documentation: 7.4.2. EFI_BOOT_SERVICES.StartImage()
Sourcefn unload_image(&self, image_handle: Handle) -> Result<(), Status>
fn unload_image(&self, image_handle: Handle) -> Result<(), Status>
Unloads an image.
UEFI Spec Documentation: 7.4.3. EFI_BOOT_SERVICES.UnloadImage()
Sourcefn 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.
Sourcefn 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.
UEFI Spec Documentation: EFI_BOOT_SERVICES.ExitBootServices()
Sourcefn set_watchdog_timer(&self, timeout: usize) -> Result<(), Status>
fn set_watchdog_timer(&self, timeout: usize) -> Result<(), Status>
Sets the system’s watchdog timer.
Note:
We deliberately choose to ignore the watchdog code and data parameters because we are not using them.
Feel free to add those if needed.
UEFI Spec Documentation: 7.5.1. EFI_BOOT_SERVICES.SetWatchdogTimer()
Sourceunsafe 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.
§Safety
dest and src must be valid pointer to a continuous chunk of memory of size length.
Sourcefn 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.
UEFI Spec Documentation: 7.5.5. EFI_BOOT_SERVICES.GetNextMonotonicCount()
Sourceunsafe 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.
§Safety
The table pointer must be the right type associated with the guid.
unsafe fn calculate_crc_32_unchecked( &self, data: *const c_void, data_size: usize, ) -> Result<u32, Status>
Provided Methods§
Sourcefn 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.
UEFI Spec Documentation: 7.1.1. EFI_BOOT_SERVICES.CreateEvent()
Sourcefn 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.
UEFI Spec Documentation: 7.1.2. EFI_BOOT_SERVICES.CreateEventEx()
Sourcefn raise_tpl_guarded<'a>(&'a self, tpl: Tpl) -> TplGuard<'a, Self>
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.
See BootServices::raise_tpl and BootServices::restore_tpl for more details.
Sourcefn 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.
Sourcefn 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.
UEFI Spec Documentation: 7.3.2. EFI_BOOT_SERVICES.InstallProtocolInterface()
Sourcefn 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.
UEFI Spec Documentation: 7.3.2. EFI_BOOT_SERVICES.InstallProtocolInterface()
Sourcefn 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.
UEFI Spec Documentation: 7.3.3. EFI_BOOT_SERVICES.UninstallProtocolInterface()
Sourcefn 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.
UEFI Spec Documentation: 7.3.3. EFI_BOOT_SERVICES.UninstallProtocolInterface()
Sourcefn 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.
UEFI Spec Documentation: 7.3.4. EFI_BOOT_SERVICES.ReinstallProtocolInterface()
Sourceunsafe 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.
UEFI Spec Documentation: 7.3.7. EFI_BOOT_SERVICES.HandleProtocol()
§Safety
Make sure to not create multiple mutable reference of interface.
Sourcefn 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.
UEFI Spec Documentation: 7.3.7. EFI_BOOT_SERVICES.HandleProtocol()
Sourceunsafe 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.
UEFI Spec Documentation: 7.3.9. EFI_BOOT_SERVICES.OpenProtocol()
§Safety
Do not create more than one mutable reference to the interface.
Sourcefn 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.
UEFI Spec Documentation: 7.3.9. EFI_BOOT_SERVICES.OpenProtocol()
Sourceunsafe 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.
UEFI Spec Documentation: 7.3.16. EFI_BOOT_SERVICES.LocateProtocol()
§Safety
Make sure to not create multiple mutable reference when using this api.
Sourcefn 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.
UEFI Spec Documentation: 7.3.16. EFI_BOOT_SERVICES.LocateProtocol()
Sourcefn 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.
This uses Self::load_image behind the scene. This function assume that the request is not originating from the boot manager.
Sourcefn 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.
This uses Self::load_image behind the scene. This function assume that the request is not originating from the boot manager.
Sourcefn 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.
Sourcefn install_configuration_table<T: CMutPtr<'static> + 'static>(
&self,
guid: &Guid,
table: T,
) -> Result<(), Status>
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.
UEFI Spec Documentation: 7.5.6. EFI_BOOT_SERVICES.InstallConfigurationTable()
Sourcefn calculate_crc_32<T: 'static>(&self, data: &T) -> Result<u32, Status>
fn calculate_crc_32<T: 'static>(&self, data: &T) -> Result<u32, Status>
Computes and returns a 32-bit CRC for a data buffer.
UEFI Spec Documentation: 7.5.7. EFI_BOOT_SERVICES.CalculateCrc32()
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.