diff options
author | Saleem Abdulrasool <compnerd@compnerd.org> | 2021-05-05 11:35:17 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-05 11:35:17 -0700 |
commit | e06e62f4a488eabe76b063fd4bfa694f9079bf5e (patch) | |
tree | 38760c4d943a7b3181dc3979a1b70906c5c32002 /machine/mtrap.c | |
parent | c624e731bd95b61f7f08b885b1897fdb5ccaee00 (diff) | |
download | pk-e06e62f4a488eabe76b063fd4bfa694f9079bf5e.zip pk-e06e62f4a488eabe76b063fd4bfa694f9079bf5e.tar.gz 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/mtrap.c')
-rw-r--r-- | machine/mtrap.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/machine/mtrap.c b/machine/mtrap.c index 1794675..dcff050 100644 --- a/machine/mtrap.c +++ b/machine/mtrap.c @@ -196,7 +196,7 @@ void redirect_trap(uintptr_t epc, uintptr_t mstatus, uintptr_t badaddr) void pmp_trap(uintptr_t* regs, uintptr_t mcause, uintptr_t mepc) { - redirect_trap(mepc, read_csr(mstatus), read_csr(mbadaddr)); + redirect_trap(mepc, read_csr(mstatus), read_csr(mtval)); } static void machine_page_fault(uintptr_t* regs, uintptr_t mcause, uintptr_t mepc) @@ -218,7 +218,7 @@ static void machine_page_fault(uintptr_t* regs, uintptr_t mcause, uintptr_t mepc goto fail; } - return redirect_trap(regs[12], regs[13], read_csr(mbadaddr)); + return redirect_trap(regs[12], regs[13], read_csr(mtval)); } fail: |