ableos/ableos/src/panic.rs

25 lines
516 B
Rust

use {crate::arch::sloop, core::panic::PanicInfo};
/// A function to handle a panic in the kernel.
/// # Example
/// ```
/// use ableos::panic::panic;
/// panic!("This is a panic!");
/// ```
///
/// # Safety
/// This function is unsafe because it does not guarantee that the panic is handled.
// #[cfg(not(target_os = "uefi"))]
#[panic_handler]
fn panic(info: &PanicInfo) -> ! {
error!("{}", info);
// help me use facepalm::start_facepalm;
sloop()
}
pub fn test_panic() {
panic!("test panic!");
}