2024-03-06 16:00:58 +08:00
|
|
|
use libregister::{RegisterR, RegisterW};
|
|
|
|
use libcortex_a9::{regs::{DFSR, MPIDR, VBAR}, interrupt_handler};
|
|
|
|
use libboard_zynq::{println, stdio};
|
2024-10-22 12:04:08 +08:00
|
|
|
use core::arch::asm;
|
2024-03-06 16:00:58 +08:00
|
|
|
|
|
|
|
pub fn set_vector_table(base_addr: u32){
|
|
|
|
VBAR.write(base_addr);
|
|
|
|
}
|
2019-11-11 09:37:06 +08:00
|
|
|
|
2021-01-28 11:57:52 +08:00
|
|
|
interrupt_handler!(UndefinedInstruction, undefined_instruction, __irq_stack0_start, __irq_stack1_start, {
|
2020-01-24 05:34:37 +08:00
|
|
|
stdio::drop_uart();
|
2020-07-06 21:02:46 +08:00
|
|
|
println!("UndefinedInstruction");
|
|
|
|
loop {}
|
2021-01-28 10:58:17 +08:00
|
|
|
});
|
2020-01-24 05:34:37 +08:00
|
|
|
|
2021-01-28 11:57:52 +08:00
|
|
|
interrupt_handler!(SoftwareInterrupt, software_interrupt, __irq_stack0_start, __irq_stack1_start, {
|
2020-07-06 21:02:46 +08:00
|
|
|
stdio::drop_uart();
|
|
|
|
println!("SoftwareInterrupt");
|
|
|
|
loop {}
|
2021-01-28 10:58:17 +08:00
|
|
|
});
|
2020-01-24 05:45:05 +08:00
|
|
|
|
2021-01-28 11:57:52 +08:00
|
|
|
interrupt_handler!(PrefetchAbort, prefetch_abort, __irq_stack0_start, __irq_stack1_start, {
|
2020-07-06 21:02:46 +08:00
|
|
|
stdio::drop_uart();
|
|
|
|
println!("PrefetchAbort");
|
2019-11-11 09:37:06 +08:00
|
|
|
loop {}
|
2021-01-28 10:58:17 +08:00
|
|
|
});
|
2019-11-11 09:37:06 +08:00
|
|
|
|
2021-01-28 11:57:52 +08:00
|
|
|
interrupt_handler!(DataAbort, data_abort, __irq_stack0_start, __irq_stack1_start, {
|
2020-01-24 05:34:37 +08:00
|
|
|
stdio::drop_uart();
|
|
|
|
|
2020-07-08 05:51:33 +08:00
|
|
|
println!("DataAbort on core {}", MPIDR.read().cpu_id());
|
2020-06-25 04:23:05 +08:00
|
|
|
println!("DFSR: {:03X}", DFSR.read());
|
2020-01-24 05:45:05 +08:00
|
|
|
|
2019-11-11 09:37:06 +08:00
|
|
|
loop {}
|
2021-01-28 10:58:17 +08:00
|
|
|
});
|
2020-07-06 21:02:46 +08:00
|
|
|
|
2021-01-28 11:57:52 +08:00
|
|
|
interrupt_handler!(ReservedException, reserved_exception, __irq_stack0_start, __irq_stack1_start, {
|
2020-07-06 21:02:46 +08:00
|
|
|
stdio::drop_uart();
|
|
|
|
println!("ReservedException");
|
|
|
|
loop {}
|
2021-01-28 10:58:17 +08:00
|
|
|
});
|
2020-07-06 21:02:46 +08:00
|
|
|
|
2020-08-03 13:24:25 +08:00
|
|
|
#[cfg(feature = "dummy_irq_handler")]
|
2021-01-28 11:57:52 +08:00
|
|
|
interrupt_handler!(IRQ, irq, __irq_stack0_start, __irq_stack1_start, {
|
2020-07-06 21:02:46 +08:00
|
|
|
stdio::drop_uart();
|
|
|
|
println!("IRQ");
|
|
|
|
loop {}
|
2021-01-28 10:58:17 +08:00
|
|
|
});
|
2020-07-06 21:02:46 +08:00
|
|
|
|
2024-02-02 17:01:07 +08:00
|
|
|
#[cfg(feature = "dummy_fiq_handler")]
|
2021-01-28 11:57:52 +08:00
|
|
|
interrupt_handler!(FIQ, fiq, __irq_stack0_start, __irq_stack1_start, {
|
2020-07-06 21:02:46 +08:00
|
|
|
stdio::drop_uart();
|
|
|
|
println!("FIQ");
|
|
|
|
loop {}
|
2021-01-28 10:58:17 +08:00
|
|
|
});
|