@@ -13,6 +13,7 @@ extern crate alloc;
1313
1414use alloc:: vec:: Vec ;
1515use log:: info;
16+ use uefi:: boot;
1617use uefi:: prelude:: * ;
1718use uefi:: proto:: device_path:: build:: { self , DevicePathBuilder } ;
1819use uefi:: proto:: device_path:: { DevicePath , DeviceSubType , DeviceType , LoadedImageDevicePath } ;
@@ -21,13 +22,10 @@ use uefi::table::boot::LoadImageSource;
2122
2223/// Get the device path of the shell app. This is the same as the
2324/// currently-loaded image's device path, but with the file path part changed.
24- fn get_shell_app_device_path < ' a > (
25- boot_services : & BootServices ,
26- storage : & ' a mut Vec < u8 > ,
27- ) -> & ' a DevicePath {
28- let loaded_image_device_path = boot_services
29- . open_protocol_exclusive :: < LoadedImageDevicePath > ( boot_services. image_handle ( ) )
30- . expect ( "failed to open LoadedImageDevicePath protocol" ) ;
25+ fn get_shell_app_device_path < ' a > ( storage : & ' a mut Vec < u8 > ) -> & ' a DevicePath {
26+ let loaded_image_device_path =
27+ boot:: open_protocol_exclusive :: < LoadedImageDevicePath > ( boot:: image_handle ( ) )
28+ . expect ( "failed to open LoadedImageDevicePath protocol" ) ;
3129
3230 let mut builder = DevicePathBuilder :: with_vec ( storage) ;
3331 for node in loaded_image_device_path. node_iter ( ) {
@@ -50,7 +48,7 @@ fn efi_main(image: Handle, st: SystemTable<Boot>) -> Status {
5048 let boot_services = st. boot_services ( ) ;
5149
5250 let mut storage = Vec :: new ( ) ;
53- let shell_image_path = get_shell_app_device_path ( boot_services , & mut storage) ;
51+ let shell_image_path = get_shell_app_device_path ( & mut storage) ;
5452
5553 // Load the shell app.
5654 let shell_image_handle = boot_services
@@ -65,8 +63,7 @@ fn efi_main(image: Handle, st: SystemTable<Boot>) -> Status {
6563
6664 // Set the command line passed to the shell app so that it will run the
6765 // test-runner app. This automatically turns off the five-second delay.
68- let mut shell_loaded_image = boot_services
69- . open_protocol_exclusive :: < LoadedImage > ( shell_image_handle)
66+ let mut shell_loaded_image = boot:: open_protocol_exclusive :: < LoadedImage > ( shell_image_handle)
7067 . expect ( "failed to open LoadedImage protocol" ) ;
7168 let load_options = cstr16 ! ( r"shell.efi test_runner.efi arg1 arg2" ) ;
7269 unsafe {
0 commit comments