Skip to content

Commit 205cd34

Browse files
boot: Add freestanding close_event
1 parent fcfe676 commit 205cd34

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

uefi/src/boot.rs

+17
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,23 @@ pub fn check_event(event: Event) -> Result<bool> {
234234
}
235235
}
236236

237+
/// Removes `event` from any event group to which it belongs and closes it.
238+
///
239+
/// If `event` was registered with `register_protocol_notify`, then the
240+
/// corresponding registration will be removed. Calling this function within the
241+
/// corresponding notify function is allowed.
242+
///
243+
/// # Errors
244+
///
245+
/// The specification does not list any errors, however implementations are
246+
/// allowed to return an error if needed.
247+
pub fn close_event(event: Event) -> Result {
248+
let bt = boot_services_raw_panicking();
249+
let bt = unsafe { bt.as_ref() };
250+
251+
unsafe { (bt.close_event)(event.as_ptr()) }.to_result()
252+
}
253+
237254
/// Sets the trigger for an event of type [`TIMER`].
238255
///
239256
/// # Errors

0 commit comments

Comments
 (0)