1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
use crate::{itm, processor}; use core::{alloc::Layout, panic::PanicInfo}; #[panic_handler] fn begin_panic(pi: &PanicInfo<'_>) -> ! { eprintln!("{}", pi); abort() } #[lang = "oom"] fn oom(layout: Layout) -> ! { eprintln!( "Couldn't allocate memory of size {}. Aborting!", layout.size() ); abort() } fn abort() -> ! { itm::flush(); processor::self_reset() }