File tree 1 file changed +21
-0
lines changed
1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -332,6 +332,27 @@ pub fn unload_image(image_handle: Handle) -> Result {
332
332
unsafe { ( bt. unload_image ) ( image_handle. as_ptr ( ) ) } . to_result ( )
333
333
}
334
334
335
+ /// Transfers control to a loaded image's entry point.
336
+ ///
337
+ /// # Errors
338
+ ///
339
+ /// * [`Status::INVALID_PARAMETER`]: `image_handle` is not valid, or the image
340
+ /// has already been initialized with `start_image`.
341
+ /// * [`Status::SECURITY_VIOLATION`]: a security policy specifies that the image
342
+ /// should not be started.
343
+ pub fn start_image ( image_handle : Handle ) -> Result {
344
+ let bt = boot_services_raw_panicking ( ) ;
345
+ let bt = unsafe { bt. as_ref ( ) } ;
346
+
347
+ // TODO: implement returning exit data to the caller.
348
+ let mut exit_data_size: usize = 0 ;
349
+ let mut exit_data: * mut u16 = ptr:: null_mut ( ) ;
350
+
351
+ unsafe {
352
+ ( bt. start_image ) ( image_handle. as_ptr ( ) , & mut exit_data_size, & mut exit_data) . to_result ( )
353
+ }
354
+ }
355
+
335
356
/// A buffer returned by [`locate_handle_buffer`] that contains an array of
336
357
/// [`Handle`]s that support the requested protocol.
337
358
#[ derive( Debug , Eq , PartialEq ) ]
You can’t perform that action at this time.
0 commit comments