Merge pull request #1959 from JarlEvanson/fix-exit

uefi: Fix `boot::exit` signature
This commit is contained in:
Philipp Schuster 2026-06-09 18:31:10 +00:00 committed by GitHub
commit 2dba05059b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 9 additions and 4 deletions

View file

@ -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)

View file

@ -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,

View file

@ -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)

View file

@ -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.