13
13
//! epoch.
14
14
15
15
use crate :: prelude:: { Boot , SystemTable } ;
16
- use crate :: Event ;
17
16
use crate :: Result ;
18
17
use crate :: StatusExt ;
19
18
use core:: ffi:: c_void;
20
19
use core:: ptr;
21
- use core:: ptr:: NonNull ;
22
20
use core:: sync:: atomic:: { AtomicPtr , Ordering } ;
23
21
#[ doc( hidden) ]
24
22
pub use println:: _print;
25
- use uefi_raw:: table:: boot:: { EventType , Tpl } ;
26
23
use uefi_raw:: Status ;
27
24
28
25
#[ cfg( feature = "global_allocator" ) ]
@@ -73,10 +70,10 @@ fn system_table() -> SystemTable<Boot> {
73
70
///
74
71
/// **PLEASE NOTE** that these helpers are meant for the pre exit boot service
75
72
/// epoch.
76
- pub fn init ( st : & mut SystemTable < Boot > ) -> Result < Option < Event > > {
73
+ pub fn init ( st : & mut SystemTable < Boot > ) -> Result < ( ) > {
77
74
if system_table_opt ( ) . is_some ( ) {
78
75
// Avoid double initialization.
79
- return Status :: SUCCESS . to_result_with_val ( || None ) ;
76
+ return Status :: SUCCESS . to_result_with_val ( || ( ) ) ;
80
77
}
81
78
82
79
// Setup the system table singleton
@@ -89,23 +86,12 @@ pub fn init(st: &mut SystemTable<Boot>) -> Result<Option<Event>> {
89
86
logger:: init ( st) ;
90
87
91
88
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 )
103
89
}
90
+
91
+ Ok ( ( ) )
104
92
}
105
93
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 ( ) {
109
95
// DEBUG: The UEFI spec does not guarantee that this printout will work, as
110
96
// the services used by logging might already have been shut down.
111
97
// But it works on current OVMF, and can be used as a handy way to
0 commit comments