From a5c49b8d434d4a99e86c3e79c2b7f1c461aad577 Mon Sep 17 00:00:00 2001 From: Jonathan Neuschäfer Date: Fri, 16 Feb 2018 13:36:46 +0100 Subject: arch/riscv: Update encoding.h and adjust related code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Update encoding.h to the version shipped with spike commit 0185d36 ("Merge pull request #165 from riscv/small_progbuf"), and copy the license header from the LICENSE file. Change-Id: I517042e5865986e88a589dc8623745f8d584d6b8 Signed-off-by: Jonathan Neuschäfer Reviewed-on: https://review.coreboot.org/23773 Tested-by: build bot (Jenkins) Reviewed-by: Ronald G. Minnich --- src/arch/riscv/trap_handler.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'src/arch/riscv/trap_handler.c') diff --git a/src/arch/riscv/trap_handler.c b/src/arch/riscv/trap_handler.c index 8fd037507a..7b35c2e7cd 100644 --- a/src/arch/riscv/trap_handler.c +++ b/src/arch/riscv/trap_handler.c @@ -14,6 +14,7 @@ * GNU General Public License for more details. */ +#include #include #include #include @@ -33,8 +34,12 @@ static const char *const exception_names[] = { "Store access fault", "Environment call from U-mode", "Environment call from S-mode", - "Environment call from H-mode", - "Environment call from M-mode" + "Reserved (10)", + "Environment call from M-mode", + "Instruction page fault", + "Load page fault", + "Reserved (14)", + "Store page fault", }; static const char *mstatus_to_previous_mode(uintptr_t ms) @@ -119,7 +124,7 @@ static void interrupt_handler(trapframe *tf) // at present, as we only search for // "core{0{0{timecmp" above. ssie = read_csr(sie); - if (!(ssie & SIE_STIE)) + if (!(ssie & SIP_STIP)) break; if (!timecmp) @@ -149,11 +154,11 @@ void trap_handler(trapframe *tf) switch(tf->cause) { case CAUSE_MISALIGNED_FETCH: - case CAUSE_FAULT_FETCH: + case CAUSE_FETCH_ACCESS: case CAUSE_ILLEGAL_INSTRUCTION: case CAUSE_BREAKPOINT: - case CAUSE_FAULT_LOAD: - case CAUSE_FAULT_STORE: + case CAUSE_LOAD_ACCESS: + case CAUSE_STORE_ACCESS: case CAUSE_USER_ECALL: case CAUSE_SUPERVISOR_ECALL: case CAUSE_HYPERVISOR_ECALL: -- cgit v1.2.3