File tree 1 file changed +7
-8
lines changed
1 file changed +7
-8
lines changed Original file line number Diff line number Diff line change 1
- use crate :: println;
2
- use crate :: table:: system_table_boot;
1
+ use crate :: { boot, println} ;
3
2
use cfg_if:: cfg_if;
4
3
5
4
#[ panic_handler]
6
5
fn panic_handler ( info : & core:: panic:: PanicInfo ) -> ! {
7
6
println ! ( "[PANIC]: {}" , info) ;
8
7
9
8
// Give the user some time to read the message
10
- if let Some ( st ) = system_table_boot ( ) {
11
- st . boot_services ( ) . stall ( 10_000_000 ) ;
9
+ if boot :: are_boot_services_active ( ) {
10
+ boot :: stall ( 10_000_000 ) ;
12
11
} else {
13
12
let mut dummy = 0u64 ;
14
13
// FIXME: May need different counter values in debug & release builds
@@ -28,10 +27,10 @@ fn panic_handler(info: &core::panic::PanicInfo) -> ! {
28
27
qemu_exit_handle. exit_failure( ) ;
29
28
} else {
30
29
// If the system table is available, use UEFI's standard shutdown mechanism
31
- if let Some ( st) = system_table_boot ( ) {
32
- use crate :: table :: runtime :: ResetType ;
33
- st . runtime_services ( )
34
- . reset ( ResetType :: SHUTDOWN , crate :: Status :: ABORTED , None ) ;
30
+ if let Some ( st) = crate :: table :: system_table_raw ( ) {
31
+ if ! unsafe { st . as_ref ( ) . runtime_services } . is_null ( ) {
32
+ crate :: runtime :: reset ( crate :: runtime :: ResetType :: SHUTDOWN , crate :: Status :: ABORTED , None ) ;
33
+ }
35
34
}
36
35
37
36
// If we don't have any shutdown mechanism handy, the best we can do is loop
You can’t perform that action at this time.
0 commit comments