2018-04-04 16:56:56 +04:00
|
|
|
// Rust language features implementions
|
|
|
|
|
|
|
|
use core;
|
2018-04-09 13:02:18 +04:00
|
|
|
use arch::cpu;
|
2018-04-04 16:56:56 +04:00
|
|
|
|
|
|
|
#[lang = "eh_personality"]
|
|
|
|
extern fn eh_personality() {
|
|
|
|
}
|
|
|
|
|
|
|
|
#[lang = "panic_fmt"]
|
|
|
|
#[no_mangle]
|
|
|
|
pub extern fn panic_fmt(fmt: core::fmt::Arguments, file: &'static str, line: u32) -> ! {
|
2018-05-20 13:14:05 +04:00
|
|
|
error!("\n\nPANIC in {} at line {}:", file, line);
|
|
|
|
error!(" {}", fmt);
|
2018-04-09 13:02:18 +04:00
|
|
|
if cfg!(feature = "qemu_auto_exit") {
|
2018-04-09 17:20:47 +04:00
|
|
|
unsafe{ cpu::exit_in_qemu(3) }
|
2018-04-09 13:02:18 +04:00
|
|
|
} else {
|
|
|
|
loop { }
|
|
|
|
}
|
|
|
|
}
|