File tree Expand file tree Collapse file tree 10 files changed +23
-19
lines changed Expand file tree Collapse file tree 10 files changed +23
-19
lines changed Original file line number Diff line number Diff line change 44use uefi:: prelude:: * ;
55
66#[ entry]
7- fn main ( _handle : Handle , mut system_table : SystemTable < Boot > ) -> Status {
8- uefi:: helpers:: init ( & mut system_table ) . unwrap ( ) ;
7+ fn main ( _handle : Handle , system_table : SystemTable < Boot > ) -> Status {
8+ uefi:: helpers:: init ( ) . unwrap ( ) ;
99
1010 Status :: SUCCESS
1111}
Original file line number Diff line number Diff line change @@ -11,10 +11,10 @@ use uefi::prelude::*;
1111
1212// ANCHOR: entry
1313#[ entry]
14- fn main ( _image_handle : Handle , mut system_table : SystemTable < Boot > ) -> Status {
14+ fn main ( _image_handle : Handle , system_table : SystemTable < Boot > ) -> Status {
1515 // ANCHOR_END: entry
1616 // ANCHOR: services
17- uefi:: helpers:: init ( & mut system_table ) . unwrap ( ) ;
17+ uefi:: helpers:: init ( ) . unwrap ( ) ;
1818 // ANCHOR_END: services
1919 // ANCHOR: log
2020 info ! ( "Hello world!" ) ;
Original file line number Diff line number Diff line change @@ -13,8 +13,8 @@ use uefi::{Identify, Result};
1313
1414// ANCHOR: main
1515#[ entry]
16- fn main ( image_handle : Handle , mut system_table : SystemTable < Boot > ) -> Status {
17- uefi:: helpers:: init ( & mut system_table ) . unwrap ( ) ;
16+ fn main ( image_handle : Handle , system_table : SystemTable < Boot > ) -> Status {
17+ uefi:: helpers:: init ( ) . unwrap ( ) ;
1818 let boot_services = system_table. boot_services ( ) ;
1919
2020 print_image_path ( boot_services) . unwrap ( ) ;
Original file line number Diff line number Diff line change @@ -17,10 +17,10 @@ use alloc::vec::Vec;
1717
1818// ANCHOR: entry
1919#[ entry]
20- fn main ( image_handle : Handle , mut system_table : SystemTable < Boot > ) -> Status {
20+ fn main ( image_handle : Handle , system_table : SystemTable < Boot > ) -> Status {
2121 // ANCHOR_END: entry
2222 // ANCHOR: services
23- uefi:: helpers:: init ( & mut system_table ) . unwrap ( ) ;
23+ uefi:: helpers:: init ( ) . unwrap ( ) ;
2424 let boot_services = system_table. boot_services ( ) ;
2525 // ANCHOR_END: services
2626
Original file line number Diff line number Diff line change @@ -144,8 +144,8 @@ fn draw_sierpinski(bt: &BootServices) -> Result {
144144}
145145
146146#[ entry]
147- fn main ( _handle : Handle , mut system_table : SystemTable < Boot > ) -> Status {
148- uefi:: helpers:: init ( & mut system_table ) . unwrap ( ) ;
147+ fn main ( _handle : Handle , system_table : SystemTable < Boot > ) -> Status {
148+ uefi:: helpers:: init ( ) . unwrap ( ) ;
149149 let bt = system_table. boot_services ( ) ;
150150 draw_sierpinski ( bt) . unwrap ( ) ;
151151 Status :: SUCCESS
Original file line number Diff line number Diff line change @@ -16,10 +16,10 @@ use uefi::proto::misc::Timestamp;
1616
1717// ANCHOR: entry
1818#[ entry]
19- fn main ( image_handle : Handle , mut system_table : SystemTable < Boot > ) -> Status {
19+ fn main ( image_handle : Handle , system_table : SystemTable < Boot > ) -> Status {
2020 // ANCHOR_END: entry
2121 // ANCHOR: services
22- uefi:: helpers:: init ( & mut system_table ) . unwrap ( ) ;
22+ uefi:: helpers:: init ( ) . unwrap ( ) ;
2323 let boot_services = system_table. boot_services ( ) ;
2424 // ANCHOR_END: services
2525
Original file line number Diff line number Diff line change @@ -45,8 +45,8 @@ fn get_shell_app_device_path<'a>(
4545}
4646
4747#[ entry]
48- fn efi_main ( image : Handle , mut st : SystemTable < Boot > ) -> Status {
49- uefi:: helpers:: init ( & mut st ) . unwrap ( ) ;
48+ fn efi_main ( image : Handle , st : SystemTable < Boot > ) -> Status {
49+ uefi:: helpers:: init ( ) . unwrap ( ) ;
5050 let boot_services = st. boot_services ( ) ;
5151
5252 let mut storage = Vec :: new ( ) ;
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ mod runtime;
2323#[ entry]
2424fn efi_main ( image : Handle , mut st : SystemTable < Boot > ) -> Status {
2525 // Initialize utilities (logging, memory allocation...)
26- uefi:: helpers:: init ( & mut st ) . expect ( "Failed to initialize utilities" ) ;
26+ uefi:: helpers:: init ( ) . expect ( "Failed to initialize utilities" ) ;
2727
2828 // unit tests here
2929
Original file line number Diff line number Diff line change 11# uefi - [ Unreleased]
22
3+ ## Changed
4+ - ** Breaking:** ` uefi::helpers::init ` no longer takes an argument.
5+
36
47# uefi - 0.29.0 (2024-07-02)
58
Original file line number Diff line number Diff line change @@ -54,18 +54,19 @@ pub fn system_table() -> SystemTable<Boot> {
5454/// **PLEASE NOTE** that these helpers are meant for the pre exit boot service
5555/// epoch. Limited functionality might work after exiting them, such as logging
5656/// to the debugcon device.
57- #[ allow( unused_variables) ] // `st` is unused if logger and allocator are disabled
58- pub fn init ( st : & mut SystemTable < Boot > ) -> Result < ( ) > {
57+ pub fn init ( ) -> Result < ( ) > {
5958 // Setup logging and memory allocation
6059
6160 #[ cfg( feature = "logger" ) ]
6261 unsafe {
63- logger:: init ( st) ;
62+ let mut st = table:: system_table_boot ( ) . expect ( "boot services are not active" ) ;
63+ logger:: init ( & mut st) ;
6464 }
6565
6666 #[ cfg( feature = "global_allocator" ) ]
6767 unsafe {
68- crate :: allocator:: init ( st) ;
68+ let mut st = table:: system_table_boot ( ) . expect ( "boot services are not active" ) ;
69+ crate :: allocator:: init ( & mut st) ;
6970 }
7071
7172 Ok ( ( ) )
You can’t perform that action at this time.
0 commit comments