1313//! epoch.
1414
1515use crate :: prelude:: { Boot , SystemTable } ;
16- use crate :: Event ;
1716use crate :: Result ;
1817use crate :: StatusExt ;
1918use core:: ffi:: c_void;
2019use core:: ptr;
21- use core:: ptr:: NonNull ;
2220use core:: sync:: atomic:: { AtomicPtr , Ordering } ;
2321#[ doc( hidden) ]
2422pub use println:: _print;
25- use uefi_raw:: table:: boot:: { EventType , Tpl } ;
2623use uefi_raw:: Status ;
2724
2825#[ cfg( feature = "global_allocator" ) ]
@@ -73,10 +70,10 @@ fn system_table() -> SystemTable<Boot> {
7370///
7471/// **PLEASE NOTE** that these helpers are meant for the pre exit boot service
7572/// epoch.
76- pub fn init ( st : & mut SystemTable < Boot > ) -> Result < Option < Event > > {
73+ pub fn init ( st : & mut SystemTable < Boot > ) -> Result < ( ) > {
7774 if system_table_opt ( ) . is_some ( ) {
7875 // Avoid double initialization.
79- return Status :: SUCCESS . to_result_with_val ( || None ) ;
76+ return Status :: SUCCESS . to_result_with_val ( || ( ) ) ;
8077 }
8178
8279 // Setup the system table singleton
@@ -89,23 +86,12 @@ pub fn init(st: &mut SystemTable<Boot>) -> Result<Option<Event>> {
8986 logger:: init ( st) ;
9087
9188 uefi:: allocator:: init ( st) ;
92-
93- // Schedule these tools to be disabled on exit from UEFI boot services
94- let boot_services = st. boot_services ( ) ;
95- boot_services
96- . create_event (
97- EventType :: SIGNAL_EXIT_BOOT_SERVICES ,
98- Tpl :: NOTIFY ,
99- Some ( exit_boot_services) ,
100- None ,
101- )
102- . map ( Some )
10389 }
90+
91+ Ok ( ( ) )
10492}
10593
106- /// Notify the utility library that boot services are not safe to call anymore
107- /// As this is a callback, it must be `extern "efiapi"`.
108- unsafe extern "efiapi" fn exit_boot_services ( _e : Event , _ctx : Option < NonNull < c_void > > ) {
94+ pub ( crate ) fn exit ( ) {
10995 // DEBUG: The UEFI spec does not guarantee that this printout will work, as
11096 // the services used by logging might already have been shut down.
11197 // But it works on current OVMF, and can be used as a handy way to
0 commit comments