summaryrefslogtreecommitdiff
path: root/kernel/src/testing/panic.rs
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/src/testing/panic.rs')
-rw-r--r--kernel/src/testing/panic.rs14
1 files changed, 5 insertions, 9 deletions
diff --git a/kernel/src/testing/panic.rs b/kernel/src/testing/panic.rs
index de07ba8..11469f2 100644
--- a/kernel/src/testing/panic.rs
+++ b/kernel/src/testing/panic.rs
@@ -1,17 +1,15 @@
-use crate::io::{qemu, serial, vga_text};
+use crate::io::{qemu, serial};
use core::fmt::Write;
use core::panic::PanicInfo;
use qemu::{exit_qemu, QemuExitCode};
use serial::SerialStream;
-use vga_text::OStream;
use x86_64::instructions::interrupts;
-pub fn serial_should_panic(info: &PanicInfo) -> ! {
+pub fn serial_should_panic(_info: &PanicInfo) -> ! {
interrupts::disable();
let mut stdout = SerialStream::new();
write!(stdout, "\nOK\nsuccessfully panicked\n").unwrap();
- exit_qemu(QemuExitCode::Success);
- loop {}
+ exit_qemu(QemuExitCode::Success)
}
pub fn serial_panic(info: &PanicInfo) -> ! {
@@ -24,14 +22,12 @@ pub fn serial_panic(info: &PanicInfo) -> ! {
info
)
.unwrap();
- exit_qemu(QemuExitCode::Failed);
- loop {}
+ exit_qemu(QemuExitCode::Failed)
}
pub fn should_panic(_info: &PanicInfo) -> ! {
interrupts::disable();
- exit_qemu(QemuExitCode::Success);
- loop {}
+ exit_qemu(QemuExitCode::Success)
}
pub fn panic(info: &PanicInfo) -> ! {