1616//! [println_macro]: uefi::println!
1717
1818use crate :: prelude:: { Boot , SystemTable } ;
19- use crate :: Event ;
2019use crate :: Result ;
2120use crate :: StatusExt ;
2221use core:: ffi:: c_void;
2322use core:: ptr;
24- use core:: ptr:: NonNull ;
2523use core:: sync:: atomic:: { AtomicPtr , Ordering } ;
2624#[ doc( hidden) ]
2725pub use println:: _print;
28- use uefi_raw:: table:: boot:: { EventType , Tpl } ;
2926use uefi_raw:: Status ;
3027
3128#[ cfg( feature = "global_allocator" ) ]
@@ -77,10 +74,10 @@ pub fn system_table() -> SystemTable<Boot> {
7774///
7875/// **PLEASE NOTE** that these helpers are meant for the pre exit boot service
7976/// epoch.
80- pub fn init ( st : & mut SystemTable < Boot > ) -> Result < Option < Event > > {
77+ pub fn init ( st : & mut SystemTable < Boot > ) -> Result < ( ) > {
8178 if system_table_opt ( ) . is_some ( ) {
8279 // Avoid double initialization.
83- return Status :: SUCCESS . to_result_with_val ( || None ) ;
80+ return Status :: SUCCESS . to_result_with_val ( || ( ) ) ;
8481 }
8582
8683 // Setup the system table singleton
@@ -92,24 +89,14 @@ pub fn init(st: &mut SystemTable<Boot>) -> Result<Option<Event>> {
9289 #[ cfg( feature = "logger" ) ]
9390 logger:: init ( st) ;
9491
92+ #[ cfg( feature = "global_allocator" ) ]
9593 uefi:: allocator:: init ( st) ;
96-
97- // Schedule these tools to be disabled on exit from UEFI boot services
98- let boot_services = st. boot_services ( ) ;
99- boot_services
100- . create_event (
101- EventType :: SIGNAL_EXIT_BOOT_SERVICES ,
102- Tpl :: NOTIFY ,
103- Some ( exit_boot_services) ,
104- None ,
105- )
106- . map ( Some )
10794 }
95+
96+ Ok ( ( ) )
10897}
10998
110- /// Notify the utility library that boot services are not safe to call anymore
111- /// As this is a callback, it must be `extern "efiapi"`.
112- unsafe extern "efiapi" fn exit_boot_services ( _e : Event , _ctx : Option < NonNull < c_void > > ) {
99+ pub ( crate ) fn exit ( ) {
113100 // DEBUG: The UEFI spec does not guarantee that this printout will work, as
114101 // the services used by logging might already have been shut down.
115102 // But it works on current OVMF, and can be used as a handy way to
0 commit comments