Skip to content

Commit

Permalink
Merge pull request #865 from nicholasbishop/bishop-more-boot-fns
Browse files Browse the repository at this point in the history
uefi-raw: Fill in a few more BootServices function pointers
  • Loading branch information
phip1611 committed Jun 20, 2023
2 parents d21fdc5 + 3246161 commit ac46bf0
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions uefi-raw/src/table/boot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ pub struct BootServices {
unsafe extern "efiapi" fn(image_handle: Handle, map_key: usize) -> Status,

// Misc services
pub get_next_monotonic_count: usize,
pub get_next_monotonic_count: unsafe extern "efiapi" fn(count: *mut u64) -> Status,
pub stall: unsafe extern "efiapi" fn(microseconds: usize) -> Status,
pub set_watchdog_timer: unsafe extern "efiapi" fn(
timeout: usize,
Expand Down Expand Up @@ -161,7 +161,12 @@ pub struct BootServices {
agent_handle: Handle,
controller_handle: Handle,
) -> Status,
pub open_protocol_information: usize,
pub open_protocol_information: unsafe extern "efiapi" fn(
handle: Handle,
protocol: *const Guid,
entry_buffer: *mut *const OpenProtocolInformationEntry,
entry_count: *mut usize,
) -> Status,

// Library services
pub protocols_per_handle: unsafe extern "efiapi" fn(
Expand All @@ -181,11 +186,16 @@ pub struct BootServices {
registration: *mut c_void,
out_proto: *mut *mut c_void,
) -> Status,

// These two function pointers require the `c_variadic` feature, which is
// not yet available in stable Rust:
// https://github.com/rust-lang/rust/issues/44930
pub install_multiple_protocol_interfaces: usize,
pub uninstall_multiple_protocol_interfaces: usize,

// CRC services
pub calculate_crc32: usize,
pub calculate_crc32:
unsafe extern "efiapi" fn(data: *const c_void, data_size: usize, crc32: *mut u32) -> Status,

// Misc services
pub copy_mem: unsafe extern "efiapi" fn(dest: *mut u8, src: *const u8, len: usize),
Expand Down Expand Up @@ -387,6 +397,14 @@ impl MemoryType {
}
}

#[repr(C)]
pub struct OpenProtocolInformationEntry {
pub agent_handle: Handle,
pub controller_handle: Handle,
pub attributes: u32,
pub open_count: u32,
}

newtype_enum! {
/// Task priority level.
///
Expand Down

0 comments on commit ac46bf0

Please sign in to comment.