We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 652c66f commit cb85a91Copy full SHA for cb85a91
src/main.rs
@@ -38,9 +38,16 @@ mod pci;
38
mod pe;
39
mod virtio;
40
41
+fn halt() -> ! {
42
+ loop {
43
+ unsafe { asm!("hlt") };
44
+ }
45
+}
46
+
47
#[cfg_attr(not(test), panic_handler)]
-fn panic(_info: &PanicInfo) -> ! {
- loop {}
48
+fn panic(info: &PanicInfo) -> ! {
49
+ log!("PANIC: {}", info);
50
+ halt()
51
}
52
53
/// Enable SSE2 for XMM registers (needed for EFI calling)
@@ -179,10 +186,5 @@ pub extern "C" fn _start() -> ! {
179
186
let mut device = block::VirtioBlockDevice::new(&mut mmio_transport);
180
187
boot_from_device(&mut device);
181
188
182
- #[allow(clippy::empty_loop)]
183
- loop {
184
- unsafe {
185
- asm!("hlt");
- }
189
190
0 commit comments