22 lines
547 B
Rust
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");
|
|
}
|
|
}
|
|
}
|