RISC-V Traps 1: Exceptions, Interrupts, mtvec Modes, mepc/mcause/mtval and mret on QEMU
Part 25 of the RISC-V series. We raised traps on QEMU and read mepc, mcause, mtval, MIE, MPIE and MPP. Vectored mode sent MSI and MTI to slots 3 and 7, and enabling MIE before saving let a nested trap overwrite mepc so code meant for S returned to U.