summaryrefslogtreecommitdiffstats
path: root/src/arch
diff options
context:
space:
mode:
authorArthur Heymans <arthur@aheymans.xyz>2023-04-19 21:25:08 +0200
committerFelix Held <felix-coreboot@felixheld.de>2023-04-21 20:12:42 +0000
commit917261d11c23eeaee4e3474a88d0baf351a5c9c2 (patch)
treedf32c4a4c06a03b7b0ee7dfba93211879dfdd22f /src/arch
parent0d504c8c0fb8f5dc2ab54e679eeb2b2ec313c59c (diff)
downloadcoreboot-917261d11c23eeaee4e3474a88d0baf351a5c9c2.tar.gz
coreboot-917261d11c23eeaee4e3474a88d0baf351a5c9c2.tar.bz2
coreboot-917261d11c23eeaee4e3474a88d0baf351a5c9c2.zip
arch/riscv/trap_handler.c: Use new names for CSR
sbadaddr and mbadaddr are deprecated names. This fixes compilation with clang. Change-Id: I5c8fa82b6131dec10f55e8ebcf36b34e30b57bad Signed-off-by: Arthur Heymans <arthur@aheymans.xyz> Reviewed-on: https://review.coreboot.org/c/coreboot/+/74569 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Elyes Haouas <ehaouas@noos.fr>
Diffstat (limited to 'src/arch')
-rw-r--r--src/arch/riscv/trap_handler.c2
-rw-r--r--src/arch/riscv/trap_util.S2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/arch/riscv/trap_handler.c b/src/arch/riscv/trap_handler.c
index f5953d32eddd..8cb27de04559 100644
--- a/src/arch/riscv/trap_handler.c
+++ b/src/arch/riscv/trap_handler.c
@@ -150,7 +150,7 @@ void trap_handler(trapframe *tf)
/* This function used to redirect trap to s-mode. */
void redirect_trap(void)
{
- write_csr(sbadaddr, read_csr(mbadaddr));
+ write_csr(stval, read_csr(mtval));
write_csr(sepc, read_csr(mepc));
write_csr(scause, read_csr(mcause));
write_csr(mepc, read_csr(stvec));
diff --git a/src/arch/riscv/trap_util.S b/src/arch/riscv/trap_util.S
index 6b03eb55121d..c5691c595f77 100644
--- a/src/arch/riscv/trap_util.S
+++ b/src/arch/riscv/trap_util.S
@@ -80,7 +80,7 @@
csrrw t0,mscratch,x0
csrr s0,mstatus
csrr t1,mepc
- csrr t2,mbadaddr
+ csrr t2,mtval
csrr t3,mcause
STORE t0,2*REGBYTES(x2)
STORE s0,32*REGBYTES(x2)