aboutsummaryrefslogtreecommitdiff
path: root/riscv/trap.h
diff options
context:
space:
mode:
authorChih-Min Chao <chihmin.chao@sifive.com>2021-07-17 12:47:57 -0700
committerChih-Min Chao <chihmin.chao@sifive.com>2021-07-17 13:08:11 -0700
commit54bff740b79afc71a4d49a01d677285e0289281a (patch)
treec96a9d25bab88df6e3dcd6edc48e48c28608fb06 /riscv/trap.h
parent4506ac36121e326f68c3eb9a0c5673a5daa3dc1d (diff)
downloadspike-54bff740b79afc71a4d49a01d677285e0289281a.zip
spike-54bff740b79afc71a4d49a01d677285e0289281a.tar.gz
spike-54bff740b79afc71a4d49a01d677285e0289281a.tar.bz2
ext-h: handle mis-aligned exception for guest world
It has been discussed that mis-aligned exception needs to update mstata.GVA ref: https://github.com/riscv/riscv-isa-manual/issues/673 Signed-off-by: Chih-Min Chao <chihmin.chao@sifive.com>
Diffstat (limited to 'riscv/trap.h')
-rw-r--r--riscv/trap.h12
1 files changed, 3 insertions, 9 deletions
diff --git a/riscv/trap.h b/riscv/trap.h
index 46114ec..da8da65 100644
--- a/riscv/trap.h
+++ b/riscv/trap.h
@@ -72,24 +72,18 @@ class mem_trap_t : public trap_t
const char* name() { return "trap_"#x; } \
};
-#define DECLARE_MEM_NOGVA_TRAP(n, x) class trap_##x : public mem_trap_t { \
- public: \
- trap_##x(reg_t tval, reg_t tval2, reg_t tinst) : mem_trap_t(n, false, tval, tval2, tinst) {} \
- const char* name() { return "trap_"#x; } \
-};
-
#define DECLARE_MEM_GVA_TRAP(n, x) class trap_##x : public mem_trap_t { \
public: \
trap_##x(reg_t tval, reg_t tval2, reg_t tinst) : mem_trap_t(n, true, tval, tval2, tinst) {} \
const char* name() { return "trap_"#x; } \
};
-DECLARE_MEM_NOGVA_TRAP(CAUSE_MISALIGNED_FETCH, instruction_address_misaligned)
+DECLARE_MEM_TRAP(CAUSE_MISALIGNED_FETCH, instruction_address_misaligned)
DECLARE_MEM_TRAP(CAUSE_FETCH_ACCESS, instruction_access_fault)
DECLARE_INST_TRAP(CAUSE_ILLEGAL_INSTRUCTION, illegal_instruction)
DECLARE_INST_TRAP(CAUSE_BREAKPOINT, breakpoint)
-DECLARE_MEM_NOGVA_TRAP(CAUSE_MISALIGNED_LOAD, load_address_misaligned)
-DECLARE_MEM_NOGVA_TRAP(CAUSE_MISALIGNED_STORE, store_address_misaligned)
+DECLARE_MEM_TRAP(CAUSE_MISALIGNED_LOAD, load_address_misaligned)
+DECLARE_MEM_TRAP(CAUSE_MISALIGNED_STORE, store_address_misaligned)
DECLARE_MEM_TRAP(CAUSE_LOAD_ACCESS, load_access_fault)
DECLARE_MEM_TRAP(CAUSE_STORE_ACCESS, store_access_fault)
DECLARE_TRAP(CAUSE_USER_ECALL, user_ecall)