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:
2323 movq $ram_max, %rsp
2424
2525 jmp rust64_start
26-
27- halt_loop:
28- hlt
29- jmp halt_loop
Original file line number Diff line number Diff line change 2020
2121use core:: panic:: PanicInfo ;
2222
23+ use x86_64:: instructions:: hlt;
24+
2325#[ macro_use]
2426mod serial;
2527
@@ -40,15 +42,13 @@ mod virtio;
4042#[ cfg( not( test) ) ]
4143global_asm ! ( include_str!( "asm/ram64.s" ) ) ;
4244
43- extern "C" {
44- fn halt_loop ( ) -> !;
45- }
46-
4745#[ cfg( all( not( test) , feature = "log-panic" ) ) ]
4846#[ panic_handler]
4947fn panic ( info : & PanicInfo ) -> ! {
5048 log ! ( "PANIC: {}" , info) ;
51- unsafe { halt_loop ( ) }
49+ loop {
50+ hlt ( )
51+ }
5252}
5353
5454#[ cfg( all( not( test) , not( feature = "log-panic" ) ) ) ]
@@ -181,6 +181,5 @@ pub extern "C" fn rust64_start() -> ! {
181181 } ,
182182 ) ;
183183
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" )
186185}
You can’t perform that action at this time.
0 commit comments