diff --git a/uefi-raw/CHANGELOG.md b/uefi-raw/CHANGELOG.md index 043c7c50..fce5ce56 100644 --- a/uefi-raw/CHANGELOG.md +++ b/uefi-raw/CHANGELOG.md @@ -7,6 +7,7 @@ ## Changed - Corrected the type of the `driver_image` parameter in `BootServices::connect_controller` from `Handle` to `*const Handle`. +- Corrected signature of `BootServices::exit` from `!` to `Status`. # uefi-raw - v0.14.0 (2026-03-22) diff --git a/uefi-raw/src/table/boot.rs b/uefi-raw/src/table/boot.rs index 00141ef5..6ab19b91 100644 --- a/uefi-raw/src/table/boot.rs +++ b/uefi-raw/src/table/boot.rs @@ -134,7 +134,7 @@ pub struct BootServices { exit_status: Status, exit_data_size: usize, exit_data: *mut Char16, - ) -> !, + ) -> Status, pub unload_image: unsafe extern "efiapi" fn(image_handle: Handle) -> Status, pub exit_boot_services: unsafe extern "efiapi" fn(image_handle: Handle, map_key: usize) -> Status, diff --git a/uefi/CHANGELOG.md b/uefi/CHANGELOG.md index 4a6da7f5..6e468514 100644 --- a/uefi/CHANGELOG.md +++ b/uefi/CHANGELOG.md @@ -9,6 +9,8 @@ - **Breaking:** The `driver_image` parameter of `boot::connect_controller` is now a `None`-terminated slice. Callers that previously passed `None` for this argument should pass in `&[]` instead. +- **Breaking:** Corrected function signature of `boot::exit` to enable handling + errors during exit. # uefi - v0.37.0 (2026-03-22) diff --git a/uefi/src/boot.rs b/uefi/src/boot.rs index b4b240b7..5ec5951e 100644 --- a/uefi/src/boot.rs +++ b/uefi/src/boot.rs @@ -1306,18 +1306,20 @@ pub unsafe fn exit( exit_status: Status, exit_data_size: usize, exit_data: *mut Char16, -) -> ! { +) -> Result { let bt = boot_services_raw_panicking(); let bt = unsafe { bt.as_ref() }; - unsafe { + let result = unsafe { (bt.exit)( image_handle.as_ptr(), exit_status, exit_data_size, exit_data.cast(), ) - } + }; + + result.to_result() } /// Get the current memory map and exit boot services.