File tree 1 file changed +6
-10
lines changed
1 file changed +6
-10
lines changed Original file line number Diff line number Diff line change @@ -134,25 +134,21 @@ impl LoadedImage {
134
134
self . 0 . image_size = size;
135
135
}
136
136
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`].
137
+ /// Registers a cleanup function that is called when [`boot::unload_image`]
138
+ /// is called.
143
139
///
144
140
/// # Safety
145
141
///
146
- /// Only the driver that this [`LoadedImage`] is attached to should register an
147
- /// unload handler .
142
+ /// The registered function must reside in memory that is not freed until
143
+ /// after the image is unloaded .
148
144
///
149
145
/// [`boot::unload_image`]: crate::boot::unload_image
150
146
pub unsafe fn set_unload (
151
147
& mut self ,
152
148
unload : extern "efiapi" fn ( image_handle : Handle ) -> Status ,
153
149
) {
154
- type RawFn = unsafe extern "efiapi" fn ( image_handle : uefi_raw:: Handle ) -> uefi_raw:: Status ;
155
- let unload : RawFn = mem:: transmute ( unload) ;
150
+ let unload : unsafe extern "efiapi" fn ( image_handle : uefi_raw:: Handle ) -> uefi_raw:: Status =
151
+ mem:: transmute ( unload) ;
156
152
self . 0 . unload = Some ( unload) ;
157
153
}
158
154
You can’t perform that action at this time.
0 commit comments