Skip to content

Commit 10a3641

Browse files
relicensing: Rewrite PR "loaded_image: Add set_unload"
This covers these commits: d4e88a1
1 parent 83e99f2 commit 10a3641

File tree

1 file changed

+4
-13
lines changed

1 file changed

+4
-13
lines changed

uefi/src/proto/loaded_image.rs

+4-13
Original file line numberDiff line numberDiff line change
@@ -134,25 +134,16 @@ impl LoadedImage {
134134
self.0.image_size = size;
135135
}
136136

137-
/// Set the callback handler to unload the image.
138-
///
139-
/// Drivers that wish to support unloading have to register their unload handler
140-
/// using this protocol. It is responsible for cleaning up any resources the
141-
/// image is using before returning. Unloading a driver is done with
142-
/// [`boot::unload_image`].
143-
///
144-
/// # Safety
145-
///
146-
/// Only the driver that this [`LoadedImage`] is attached to should register an
147-
/// unload handler.
137+
/// Registers a cleanup function that is called when [`boot::unload_image`]
138+
/// is called.
148139
///
149140
/// [`boot::unload_image`]: crate::boot::unload_image
150141
pub unsafe fn set_unload(
151142
&mut self,
152143
unload: extern "efiapi" fn(image_handle: Handle) -> Status,
153144
) {
154-
type RawFn = unsafe extern "efiapi" fn(image_handle: uefi_raw::Handle) -> uefi_raw::Status;
155-
let unload: RawFn = mem::transmute(unload);
145+
let unload: unsafe extern "efiapi" fn(image_handle: uefi_raw::Handle) -> uefi_raw::Status =
146+
mem::transmute(unload);
156147
self.0.unload = Some(unload);
157148
}
158149

0 commit comments

Comments
 (0)