BootServices

Trait BootServices 

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

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>

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.

Rust By Example Book: 15.3. Borrowing


  1.  
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>

Use BootServices::create_event_ex when possible.

§Safety

Make sure to comply to the same constraint as BootServices::create_event_unchecked

Source

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

Close an event.

UEFI Spec Documentation: 7.1.3. EFI_BOOT_SERVICES.CloseEvent()


  1. It is safe to call close_event in the notify function. 

Source

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

Source

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

Source

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

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.

UEFI Spec Documentation: 7.1.7. EFI_BOOT_SERVICES.SetTimer()

Source

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

Source

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

Source

fn allocate_pages( &self, alloc_type: AllocType, memory_type: MemoryType, nb_pages: usize, ) -> Result<usize, Status>

Source

fn free_pages(&self, address: usize, nb_pages: usize) -> Result<(), Status>

Source

fn get_memory_map<'a>(&'a self) -> Result<MemoryMap<'a, Self>, (Status, usize)>

Source

fn allocate_pool( &self, pool_type: MemoryType, size: usize, ) -> Result<*mut u8, Status>

Source

fn free_pool(&self, buffer: *mut u8) -> Result<(), Status>

Source

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.

Source

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.

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>

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.

Source

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

Source

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

Source

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>

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.

Source

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.

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.

UEFI Spec Documentation: 7.3.10. EFI_BOOT_SERVICES.CloseProtocol()

Source

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

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.

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

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.

UEFI Spec Documentation: 7.3.13. EFI_BOOT_SERVICES.DisconnectController()

Source

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

Source

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

Source

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
Source

fn load_image<'a>( &self, boot_policy: bool, parent_image_handle: Handle, device_path: *mut Protocol, source_buffer: Option<&'a [u8]>, ) -> Result<Handle, Status>

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.

UEFI Spec Documentation: 7.4.2. EFI_BOOT_SERVICES.StartImage()

Source

fn unload_image(&self, image_handle: Handle) -> Result<(), Status>

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.

UEFI Spec Documentation: 7.4.5. EFI_BOOT_SERVICES.Exit()

Source

fn exit_boot_services( &self, image_handle: Handle, map_key: usize, ) -> Result<(), Status>

Source

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

Source

fn stall(&self, microseconds: usize) -> Result<(), Status>

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.

§Safety

dest and src must be valid pointer to a continuous chunk of memory of size length.

Source

fn set_mem(&self, buffer: &mut [u8], value: u8)

Fills a buffer with a specified value.

UEFI Spec Documentation: 7.5.4. EFI_BOOT_SERVICES.SetMem()

Source

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

Source

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.

Source

unsafe fn calculate_crc_32_unchecked( &self, data: *const c_void, data_size: usize, ) -> Result<u32, Status>

Provided Methods§

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,

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,

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.

See BootServices::raise_tpl and BootServices::restore_tpl for more details.

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.

UEFI Spec Documentation: 7.3.2. EFI_BOOT_SERVICES.InstallProtocolInterface()

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.

UEFI Spec Documentation: 7.3.2. EFI_BOOT_SERVICES.InstallProtocolInterface()

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.

UEFI Spec Documentation: 7.3.3. EFI_BOOT_SERVICES.UninstallProtocolInterface()

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.

UEFI Spec Documentation: 7.3.3. EFI_BOOT_SERVICES.UninstallProtocolInterface()

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.

UEFI Spec Documentation: 7.3.4. EFI_BOOT_SERVICES.ReinstallProtocolInterface()

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.

UEFI Spec Documentation: 7.3.7. EFI_BOOT_SERVICES.HandleProtocol()

§Safety

Make sure to not create multiple mutable reference of interface.

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.

UEFI Spec Documentation: 7.3.7. EFI_BOOT_SERVICES.HandleProtocol()

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.

UEFI Spec Documentation: 7.3.9. EFI_BOOT_SERVICES.OpenProtocol()

§Safety

Do not create more than one mutable reference to the interface.

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.

UEFI Spec Documentation: 7.3.9. EFI_BOOT_SERVICES.OpenProtocol()

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.

UEFI Spec Documentation: 7.3.16. EFI_BOOT_SERVICES.LocateProtocol()

§Safety

Make sure to not create multiple mutable reference when using this api.

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.

UEFI Spec Documentation: 7.3.16. EFI_BOOT_SERVICES.LocateProtocol()

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.

This uses Self::load_image behind the scene. This function assume that the request is not originating from the boot manager.

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.

This uses Self::load_image behind the scene. This function assume that the request is not originating from the boot manager.

Source

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

Copies the contents of one buffer to another buffer.

UEFI Spec Documentation: 7.5.3. EFI_BOOT_SERVICES.CopyMem()

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.

UEFI Spec Documentation: 7.5.6. EFI_BOOT_SERVICES.InstallConfigurationTable()

Source

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.

Implementors§