mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-16 08:38:26 +00:00
panic directly on illegal instruction
the original stub for illegal instruction handling advances the program counter - this was copypasta from the kernel irq routine, where this behavior is needed to handle syscalls. However, this behavior is contra-indicated for the purpose of dying on a bollard - you don't want to skip past the bollard for any reason.
This commit is contained in:
parent
f462e3dc3c
commit
59bd74a01c
1 changed files with 0 additions and 10 deletions
|
|
@ -164,16 +164,6 @@ pub extern "C" fn trap_handler(
|
|||
// crate::println!("cause {:x}", cause.bits());
|
||||
// 2 is illegal instruction
|
||||
if cause.bits() == 2 {
|
||||
// skip past the illegal instruction, in case that's what we want to do...
|
||||
unsafe {
|
||||
#[rustfmt::skip]
|
||||
core::arch::asm!(
|
||||
"csrr t0, mepc",
|
||||
"addi t0, t0, 4",
|
||||
"csrw mepc, t0",
|
||||
);
|
||||
}
|
||||
// ...but also panic.
|
||||
panic!("Illegal Instruction");
|
||||
} else if cause.bits() == 4 {
|
||||
let epc = riscv::register::mepc::read();
|
||||
|
|
|
|||
Loading…
Reference in a new issue