Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
boot: Add freestanding close_event
  • Loading branch information
nicholasbishop committed Aug 9, 2024
commit 205cd34a02f15dc0cbd7dc48ffd264206a14ddda
17 changes: 17 additions & 0 deletions uefi/src/boot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,23 @@ pub fn check_event(event: Event) -> Result<bool> {
}
}

/// Removes `event` from any event group to which it belongs and closes it.
///
/// If `event` was registered with `register_protocol_notify`, then the
/// corresponding registration will be removed. Calling this function within the
/// corresponding notify function is allowed.
///
/// # Errors
///
/// The specification does not list any errors, however implementations are
/// allowed to return an error if needed.
pub fn close_event(event: Event) -> Result {
let bt = boot_services_raw_panicking();
let bt = unsafe { bt.as_ref() };

unsafe { (bt.close_event)(event.as_ptr()) }.to_result()
}

/// Sets the trigger for an event of type [`TIMER`].
///
/// # Errors
Expand Down