[coreboot-gerrit] Change in coreboot[master]: arch/riscv: Unify trap return

Jonathan Neuschäfer (Code Review) gerrit at coreboot.org
Fri Sep 29 06:52:19 CEST 2017


Jonathan Neuschäfer has uploaded this change for review. ( https://review.coreboot.org/21763


Change subject: arch/riscv: Unify trap return
......................................................................

arch/riscv: Unify trap return

Change-Id: I9de0c92b3f925e8f4db00d7281222a07db68b2ae
Signed-off-by: Jonathan Neuschäfer <j.neuschaefer at gmx.net>
---
M src/arch/riscv/trap_handler.c
M src/arch/riscv/trap_util.S
2 files changed, 10 insertions(+), 15 deletions(-)



  git pull ssh://review.coreboot.org:29418/coreboot refs/changes/63/21763/1

diff --git a/src/arch/riscv/trap_handler.c b/src/arch/riscv/trap_handler.c
index 4359ed9..78b98e4 100644
--- a/src/arch/riscv/trap_handler.c
+++ b/src/arch/riscv/trap_handler.c
@@ -69,7 +69,7 @@
 	}
 	tf->gpr[10] = returnValue;
 	write_csr(mepc, read_csr(mepc) + 4);
-	asm volatile("j supervisor_call_return");
+	asm volatile("j trap_return");
 }
 
 static const char *const exception_names[] = {
@@ -262,7 +262,7 @@
 
 	// return to where we came from
 	write_csr(mepc, read_csr(mepc) + 4);
-	asm volatile("j machine_call_return");
+	asm volatile("j trap_return");
 }
 
 void handle_misaligned_store(trapframe *tf) {
@@ -290,5 +290,5 @@
 
 	// return to where we came from
 	write_csr(mepc, read_csr(mepc) + 4);
-	asm volatile("j machine_call_return");
+	asm volatile("j trap_return");
 }
diff --git a/src/arch/riscv/trap_util.S b/src/arch/riscv/trap_util.S
index 44cfab7..5add7ba 100644
--- a/src/arch/riscv/trap_util.S
+++ b/src/arch/riscv/trap_util.S
@@ -136,15 +136,10 @@
   save_tf
   move  a0,sp
   jal trap_handler
-  .global supervisor_call_return
-supervisor_call_return:
-  csrr a0, mscratch
-  restore_regs
-  # go back into supervisor call
-  mret
-  .global machine_call_return
-machine_call_return:
-    csrr a0, mscratch
-    restore_regs
-    # go back into machine call
-    mret
+
+	.global trap_return
+trap_return:
+	csrr	a0, mscratch
+	restore_regs
+	# go back to the previous mode
+	mret

-- 
To view, visit https://review.coreboot.org/21763
To unsubscribe, visit https://review.coreboot.org/settings

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I9de0c92b3f925e8f4db00d7281222a07db68b2ae
Gerrit-Change-Number: 21763
Gerrit-PatchSet: 1
Gerrit-Owner: Jonathan Neuschäfer <j.neuschaefer at gmx.net>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20170929/ba6e7422/attachment.html>


More information about the coreboot-gerrit mailing list