1
0
Fork 0
forked from AbleOS/ableos
ableOS_v1Change/ableos/src/panic.rs

23 lines
480 B
Rust
Raw Normal View History

2022-01-18 06:15:51 -06:00
use {crate::arch::sloop, core::panic::PanicInfo};
2021-11-16 00:09:27 -06:00
/// 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.
2021-11-16 00:09:27 -06:00
#[panic_handler]
fn panic(info: &PanicInfo) -> ! {
2021-12-24 07:03:15 -06:00
error!("{}", info);
// help me use facepalm::start_facepalm;
2021-12-24 07:03:15 -06:00
sloop()
2021-11-16 00:09:27 -06:00
}
pub fn test_panic() {
panic!("test panic!");
}