File tree Expand file tree Collapse file tree 2 files changed +6
-11
lines changed Expand file tree Collapse file tree 2 files changed +6
-11
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,3 @@ ram64_start:
23
23
movq $ram_max, %rsp
24
24
25
25
jmp rust64_start
26
-
27
- halt_loop:
28
- hlt
29
- jmp halt_loop
Original file line number Diff line number Diff line change 20
20
21
21
use core:: panic:: PanicInfo ;
22
22
23
+ use x86_64:: instructions:: hlt;
24
+
23
25
#[ macro_use]
24
26
mod serial;
25
27
@@ -40,15 +42,13 @@ mod virtio;
40
42
#[ cfg( not( test) ) ]
41
43
global_asm ! ( include_str!( "asm/ram64.s" ) ) ;
42
44
43
- extern "C" {
44
- fn halt_loop ( ) -> !;
45
- }
46
-
47
45
#[ cfg( all( not( test) , feature = "log-panic" ) ) ]
48
46
#[ panic_handler]
49
47
fn panic ( info : & PanicInfo ) -> ! {
50
48
log ! ( "PANIC: {}" , info) ;
51
- unsafe { halt_loop ( ) }
49
+ loop {
50
+ hlt ( )
51
+ }
52
52
}
53
53
54
54
#[ cfg( all( not( test) , not( feature = "log-panic" ) ) ) ]
@@ -181,6 +181,5 @@ pub extern "C" fn rust64_start() -> ! {
181
181
} ,
182
182
) ;
183
183
184
- log ! ( "Unable to boot from any virtio-blk device. Halting.." ) ;
185
- unsafe { halt_loop ( ) }
184
+ panic ! ( "Unable to boot from any virtio-blk device" )
186
185
}
You can’t perform that action at this time.
0 commit comments