Skip to content

Commit d704933

Browse files
authored
Merge branch 'main' into snp
2 parents 0e003b2 + 5b083a3 commit d704933

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

uefi/src/table/boot.rs

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -717,7 +717,7 @@ impl BootServices {
717717
///
718718
/// This function directly calls the UEFI function `EFI_BOOT_SERVICES.SignalEvent()`.
719719
///
720-
/// Since the UEFI function does not return any errors, this function shouldn't either.
720+
/// Currently, (as of UEFI Spec v2.9) this only returns `EFI_SUCCESS`.
721721
/// See the function definition in the UEFI Specification, Chapter 7.1 for more details.
722722
pub fn signal_event(&self, event: &Event) -> Result {
723723
// Safety: cloning this event should be safe, as we're directly passing it to firmware
@@ -729,9 +729,17 @@ impl BootServices {
729729
/// registered with `register_protocol_notify()`, then the corresponding registration will
730730
/// be removed. It is safe to call this function within the corresponding notify function.
731731
///
732+
/// # Errors
733+
///
734+
/// This function directly calls the UEFI function `EFI_BOOT_SERVICES.CloseEvent()`.
732735
///
733736
/// Note: The UEFI Specification v2.9 states that this may only return `EFI_SUCCESS`, but,
734737
/// at least for application based on EDK2 (such as OVMF), it may also return `EFI_INVALID_PARAMETER`.
738+
/// To be safe, ensure that error codes are handled properly.
739+
///
740+
/// See the function definition in the UEFI Specification, Chapter 7.1 for more details.
741+
///
742+
/// * [`uefi::Status::INVALID_PARAMETER`]
735743
pub fn close_event(&self, event: Event) -> Result {
736744
unsafe { (self.close_event)(event).into() }
737745
}
@@ -740,6 +748,17 @@ impl BootServices {
740748
///
741749
/// The returned value will be `true` if the event is in the signaled state,
742750
/// otherwise `false` is returned.
751+
///
752+
/// # Errors
753+
///
754+
/// This function returns errors from the UEFI function `EFI_BOOT_SERVICES.CheckEvent()`.
755+
///
756+
/// Note: Instead of returning the `EFI_NOT_READY` error from `EFI_BOOT_SERVICES.CheckEvent()`,
757+
/// as listed in the UEFI Specification, this function will return `false`.
758+
///
759+
/// See the function definition in the UEFI Specification, Chapter 7.1 for more details.
760+
///
761+
/// * [`uefi::Status::INVALID_PARAMETER`]
743762
pub fn check_event(&self, event: Event) -> Result<bool> {
744763
let status = unsafe { (self.check_event)(event) };
745764
match status {

0 commit comments

Comments
 (0)