aboutsummaryrefslogtreecommitdiff
path: root/machine/misaligned_ldst.c
diff options
context:
space:
mode:
authorSaleem Abdulrasool <compnerd@compnerd.org>2021-05-05 11:35:17 -0700
committerGitHub <noreply@github.com>2021-05-05 11:35:17 -0700
commite06e62f4a488eabe76b063fd4bfa694f9079bf5e (patch)
tree38760c4d943a7b3181dc3979a1b70906c5c32002 /machine/misaligned_ldst.c
parentc624e731bd95b61f7f08b885b1897fdb5ccaee00 (diff)
downloadriscv-pk-e06e62f4a488eabe76b063fd4bfa694f9079bf5e.zip
riscv-pk-e06e62f4a488eabe76b063fd4bfa694f9079bf5e.tar.gz
riscv-pk-e06e62f4a488eabe76b063fd4bfa694f9079bf5e.tar.bz2
machine: replace `mbadaddr` with `mtval` (#242)
The LLVM IAS does not support the older name for the `mtval` CSR. This updates the name to the current spelling, which is required to build with the LLVM IAS. This remains compatible with binutils as well.
Diffstat (limited to 'machine/misaligned_ldst.c')
-rw-r--r--machine/misaligned_ldst.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/machine/misaligned_ldst.c b/machine/misaligned_ldst.c
index 707de2a..185897d 100644
--- a/machine/misaligned_ldst.c
+++ b/machine/misaligned_ldst.c
@@ -20,7 +20,7 @@ void misaligned_load_trap(uintptr_t* regs, uintptr_t mcause, uintptr_t mepc)
uintptr_t mstatus;
insn_t insn = get_insn(mepc, &mstatus);
uintptr_t npc = mepc + insn_len(insn);
- uintptr_t addr = read_csr(mbadaddr);
+ uintptr_t addr = read_csr(mtval);
int shift = 0, fp = 0, len;
if ((insn & MASK_LW) == MATCH_LW)
@@ -142,7 +142,7 @@ void misaligned_store_trap(uintptr_t* regs, uintptr_t mcause, uintptr_t mepc)
return truly_illegal_insn(regs, mcause, mepc, mstatus, insn);
}
- uintptr_t addr = read_csr(mbadaddr);
+ uintptr_t addr = read_csr(mtval);
#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
intptr_t offs = (len == 8? 0 : sizeof(val.intx) - len);
#else