[coreboot-gerrit] New patch to review for coreboot: [WIP] arch/riscv: change all eret instructions to mret
Jonathan Neuschäfer (j.neuschaefer@gmx.net)
gerrit at coreboot.org
Tue Jun 21 19:46:03 CEST 2016
Jonathan Neuschäfer (j.neuschaefer at gmx.net) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/15290
-gerrit
commit 000636a9c823cc35f341ca1deb1d7e8fb81a65ac
Author: Jonathan Neuschäfer <j.neuschaefer at gmx.net>
Date: Tue Jun 21 19:37:04 2016 +0200
[WIP] arch/riscv: change all eret instructions to mret
I'm not sure if this is correct. It might be that some instances of eret
should be sret/hret instead.
Also, parts of this patch may become irrelevant, if the surrounding code
is removed.
Change-Id: I17e14d4793ae5259f7ce3ce0211cbb27305506cc
Signed-off-by: Jonathan Neuschäfer <j.neuschaefer at gmx.net>
---
src/arch/riscv/boot.c | 2 +-
src/arch/riscv/trap_util.S | 4 ++--
src/arch/riscv/virtual_memory.c | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/arch/riscv/boot.c b/src/arch/riscv/boot.c
index 96526bf..d322e59 100644
--- a/src/arch/riscv/boot.c
+++ b/src/arch/riscv/boot.c
@@ -25,7 +25,7 @@ void arch_prog_run(struct prog *prog)
if (ENV_RAMSTAGE && prog_type(prog) == PROG_PAYLOAD) {
initVirtualMemory();
write_csr(mepc, doit);
- asm volatile("eret");
+ asm volatile("mret");
} else {
doit(prog_entry_arg(prog));
}
diff --git a/src/arch/riscv/trap_util.S b/src/arch/riscv/trap_util.S
index 0118ffc..6608328 100644
--- a/src/arch/riscv/trap_util.S
+++ b/src/arch/riscv/trap_util.S
@@ -124,9 +124,9 @@ trap_entry:
supervisor_call_return:
csrr a0, mscratch
restore_regs
- eret # go back into supervisor call
+ mret # go back into supervisor call
.global machine_call_return
machine_call_return:
csrr a0, mscratch
restore_regs
- eret # go back into machine call
+ mret # go back into machine call
diff --git a/src/arch/riscv/virtual_memory.c b/src/arch/riscv/virtual_memory.c
index 64ea2b1..d9727d1 100644
--- a/src/arch/riscv/virtual_memory.c
+++ b/src/arch/riscv/virtual_memory.c
@@ -31,7 +31,7 @@ void walk_page_table(void) {
void enter_supervisor(void) {
// enter supervisor mode
- asm volatile("la t0, 1f; csrw mepc, t0; eret; 1:" ::: "t0");
+ asm volatile("la t0, 1f; csrw mepc, t0; mret; 1:" ::: "t0");
}
void flush_tlb(void)
More information about the coreboot-gerrit
mailing list