gila/src/kernel/panic.rs
2025-06-05 00:19:02 -04:00

22 lines
547 B
Rust

// Copyright (c) 2025 shibedrill
// SPDX-License-Identifier: GPL-3.0-or-later
use core::arch::asm;
use core::panic::*;
use crate::format;
use crate::{LOGGER, LogLevel};
#[panic_handler]
pub fn panic(info: &PanicInfo) -> ! {
log_critical!("Panic in {}: {}", info.location().unwrap(), info.message());
// TODO: If any userspace facilities are still working, *attempt* to flush panic info and
// logs to disk or whatever else. Then kill all processes and reboot.
loop {
unsafe {
asm!("nop");
}
}
}