Skip to content

Commit ac46bf0

Browse files
authored
Merge pull request #865 from nicholasbishop/bishop-more-boot-fns
uefi-raw: Fill in a few more BootServices function pointers
2 parents d21fdc5 + 3246161 commit ac46bf0

File tree

1 file changed

+21
-3
lines changed

1 file changed

+21
-3
lines changed

uefi-raw/src/table/boot.rs

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ pub struct BootServices {
124124
unsafe extern "efiapi" fn(image_handle: Handle, map_key: usize) -> Status,
125125

126126
// Misc services
127-
pub get_next_monotonic_count: usize,
127+
pub get_next_monotonic_count: unsafe extern "efiapi" fn(count: *mut u64) -> Status,
128128
pub stall: unsafe extern "efiapi" fn(microseconds: usize) -> Status,
129129
pub set_watchdog_timer: unsafe extern "efiapi" fn(
130130
timeout: usize,
@@ -161,7 +161,12 @@ pub struct BootServices {
161161
agent_handle: Handle,
162162
controller_handle: Handle,
163163
) -> Status,
164-
pub open_protocol_information: usize,
164+
pub open_protocol_information: unsafe extern "efiapi" fn(
165+
handle: Handle,
166+
protocol: *const Guid,
167+
entry_buffer: *mut *const OpenProtocolInformationEntry,
168+
entry_count: *mut usize,
169+
) -> Status,
165170

166171
// Library services
167172
pub protocols_per_handle: unsafe extern "efiapi" fn(
@@ -181,11 +186,16 @@ pub struct BootServices {
181186
registration: *mut c_void,
182187
out_proto: *mut *mut c_void,
183188
) -> Status,
189+
190+
// These two function pointers require the `c_variadic` feature, which is
191+
// not yet available in stable Rust:
192+
// https://github.com/rust-lang/rust/issues/44930
184193
pub install_multiple_protocol_interfaces: usize,
185194
pub uninstall_multiple_protocol_interfaces: usize,
186195

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

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

400+
#[repr(C)]
401+
pub struct OpenProtocolInformationEntry {
402+
pub agent_handle: Handle,
403+
pub controller_handle: Handle,
404+
pub attributes: u32,
405+
pub open_count: u32,
406+
}
407+
390408
newtype_enum! {
391409
/// Task priority level.
392410
///

0 commit comments

Comments
 (0)