#[repr(C)]
pub struct BootServices { pub header: TableHeader, pub free_pages: unsafe extern "C" fn(physical_address: u64, page_count: usize) -> Status, pub allocate_pool: unsafe extern "C" fn(pool_type: MemoryType, size: usize, buffer: *mut *mut c_void) -> Status, pub free_pool: unsafe extern "C" fn(buffer: *mut c_void) -> Status, pub handle_protocol: unsafe extern "C" fn(handle: Handle, protocol: &GUID, interface: *mut *const c_void) -> Status, /* private fields */ }

Fields§

§header: TableHeader§free_pages: unsafe extern "C" fn(physical_address: u64, page_count: usize) -> Status§allocate_pool: unsafe extern "C" fn(pool_type: MemoryType, size: usize, buffer: *mut *mut c_void) -> Status§free_pool: unsafe extern "C" fn(buffer: *mut c_void) -> Status§handle_protocol: unsafe extern "C" fn(handle: Handle, protocol: &GUID, interface: *mut *const c_void) -> Status

Implementations§

Allocate a number of pages of a given type of memory, optionally constraining its location.

Pages are 4KB (PAGE_SIZE) on all platforms.

The meaning of reference_address depends on allocate_type:

  • AnyAddress: Search for a block of pages anywhere in memory. reference_address is ignored, and should be None.
  • MaxAddress: Search for a block of pages below the given address.
  • ExactAddress: Reserve the block of pages starting at reference_address.
Errors

This function will return:

Get a map representing the status of all available memory.

Panics

Panics if the firmware does not behave according to the spec.

Get the implementation of a protocol offered by the given handle.

For UEFI applications, agent_handle is the application’s image handle. This method does not offer all the options required by UEFI drivers.

Errors

Fails if handle is not valid, or it does not implement the specified protocol.

Panics

Panics if the firmware does not behave according to the spec.

Signal to UEFI that the OS is now taking over.

If this function exits successfully, the OS is now in charge of memory management, and it is no longer safe to call any functions on BootServices.

In order to ensure that the OS has an accurate picture of the system, the caller must pass the key from a prior call to BootServices::get_memory_map. If it does not match the latest value, this function returns with an error and the caller will have to fetch a new map before trying again.

Safety

If this function exits successfully, then this object is no longer valid. The pointer to this table should be removed from the SystemTable and any other copies should be deleted.

If the function exits with an error, then it is only safe to call memory services like allocate_pages and get_memory_map. Any other boot services may have been unloaded already.

Errors

Will fail with Status::InvalidParameter if the memory_map_key does not match the latest value.

Trait Implementations§

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.