ros666/
language_item.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//! Rust语言项
use core::panic::PanicInfo;

use crate::{error, sbi::sbi_shutdown};

#[panic_handler]
fn panic(info: &PanicInfo) -> ! {
    let message = info.message();
    error!("Kernel panic: {:?}", message);
    if let Some(location) = info.location() {
        let file = location.file();
        let line = location.line();
        let column = location.column();
        error!("\tat {}:{}:{}", file, line, column);
    }

    sbi_shutdown(true);
}