zynq-rs/libsupport_zynq/src/abort.rs

64 lines
1.3 KiB
Rust
Raw Normal View History

use libregister::RegisterR;
use libcortex_a9::regs::{DFSR, MPIDR};
use libboard_zynq::{println, stdio};
2019-11-11 09:37:06 +08:00
2020-07-06 21:02:46 +08:00
#[link_section = ".text.boot"]
2019-11-11 09:37:06 +08:00
#[no_mangle]
2020-07-06 21:02:46 +08:00
pub unsafe extern "C" fn UndefinedInstruction() {
stdio::drop_uart();
2020-07-06 21:02:46 +08:00
println!("UndefinedInstruction");
loop {}
}
2020-07-06 21:02:46 +08:00
#[link_section = ".text.boot"]
#[no_mangle]
pub unsafe extern "C" fn SoftwareInterrupt() {
stdio::drop_uart();
println!("SoftwareInterrupt");
loop {}
}
2020-07-06 21:02:46 +08:00
#[link_section = ".text.boot"]
#[no_mangle]
pub unsafe extern "C" fn PrefetchAbort() {
stdio::drop_uart();
println!("PrefetchAbort");
2019-11-11 09:37:06 +08:00
loop {}
}
2020-07-06 21:02:46 +08:00
#[link_section = ".text.boot"]
2019-11-11 09:37:06 +08:00
#[no_mangle]
pub unsafe extern "C" fn DataAbort() {
stdio::drop_uart();
println!("DataAbort on core {}", MPIDR.read().cpu_id());
2020-06-25 04:23:05 +08:00
println!("DFSR: {:03X}", DFSR.read());
2019-11-11 09:37:06 +08:00
loop {}
}
2020-07-06 21:02:46 +08:00
#[link_section = ".text.boot"]
#[no_mangle]
pub unsafe extern "C" fn ReservedException() {
stdio::drop_uart();
println!("ReservedException");
loop {}
}
#[link_section = ".text.boot"]
#[no_mangle]
#[cfg(feature = "dummy_irq_handler")]
2020-07-06 21:02:46 +08:00
pub unsafe extern "C" fn IRQ() {
stdio::drop_uart();
println!("IRQ");
loop {}
}
#[link_section = ".text.boot"]
#[no_mangle]
pub unsafe extern "C" fn FIQ() {
stdio::drop_uart();
println!("FIQ");
loop {}
}