@@ -13,6 +13,7 @@ extern crate alloc;
13
13
14
14
use alloc:: vec:: Vec ;
15
15
use log:: info;
16
+ use uefi:: boot;
16
17
use uefi:: prelude:: * ;
17
18
use uefi:: proto:: device_path:: build:: { self , DevicePathBuilder } ;
18
19
use uefi:: proto:: device_path:: { DevicePath , DeviceSubType , DeviceType , LoadedImageDevicePath } ;
@@ -21,13 +22,10 @@ use uefi::table::boot::LoadImageSource;
21
22
22
23
/// Get the device path of the shell app. This is the same as the
23
24
/// 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 ( storage : & mut Vec < u8 > ) -> & DevicePath {
26
+ let loaded_image_device_path =
27
+ boot:: open_protocol_exclusive :: < LoadedImageDevicePath > ( boot:: image_handle ( ) )
28
+ . expect ( "failed to open LoadedImageDevicePath protocol" ) ;
31
29
32
30
let mut builder = DevicePathBuilder :: with_vec ( storage) ;
33
31
for node in loaded_image_device_path. node_iter ( ) {
@@ -50,7 +48,7 @@ fn efi_main(image: Handle, st: SystemTable<Boot>) -> Status {
50
48
let boot_services = st. boot_services ( ) ;
51
49
52
50
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) ;
54
52
55
53
// Load the shell app.
56
54
let shell_image_handle = boot_services
@@ -65,8 +63,7 @@ fn efi_main(image: Handle, st: SystemTable<Boot>) -> Status {
65
63
66
64
// Set the command line passed to the shell app so that it will run the
67
65
// 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)
70
67
. expect ( "failed to open LoadedImage protocol" ) ;
71
68
let load_options = cstr16 ! ( r"shell.efi test_runner.efi arg1 arg2" ) ;
72
69
unsafe {
0 commit comments