File tree 1 file changed +20
-0
lines changed
1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -149,6 +149,26 @@ impl LoadedImage {
149
149
self . image_size = size;
150
150
}
151
151
152
+ /// Set the callback handler to unload the image.
153
+ ///
154
+ /// Drivers that wish to support unloading have to register their unload handler
155
+ /// using this protocol. It is responsible for cleaning up any resources the
156
+ /// image is using before returning. Unloading a driver is done with
157
+ /// [`BootServices::unload_image`].
158
+ ///
159
+ /// # Safety
160
+ ///
161
+ /// Only the driver that this [`LoadedImage`] is attached to should register an
162
+ /// unload handler.
163
+ ///
164
+ /// [`BootServices::unload_image`]: crate::table::boot::BootServices
165
+ pub unsafe fn set_unload (
166
+ & mut self ,
167
+ unload : extern "efiapi" fn ( image_handle : Handle ) -> Status ,
168
+ ) {
169
+ self . unload = unload;
170
+ }
171
+
152
172
/// Set the load options for the image. This can be used prior to
153
173
/// calling `BootServices.start_image` to control the command line
154
174
/// passed to the image.
You can’t perform that action at this time.
0 commit comments