<p>Jonathan Neuschäfer has uploaded this change for <strong>review</strong>.</p><p><a href="https://review.coreboot.org/21763">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">arch/riscv: Unify trap return<br><br>Change-Id: I9de0c92b3f925e8f4db00d7281222a07db68b2ae<br>Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net><br>---<br>M src/arch/riscv/trap_handler.c<br>M src/arch/riscv/trap_util.S<br>2 files changed, 10 insertions(+), 15 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://review.coreboot.org:29418/coreboot refs/changes/63/21763/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/src/arch/riscv/trap_handler.c b/src/arch/riscv/trap_handler.c<br>index 4359ed9..78b98e4 100644<br>--- a/src/arch/riscv/trap_handler.c<br>+++ b/src/arch/riscv/trap_handler.c<br>@@ -69,7 +69,7 @@<br>    }<br>     tf->gpr[10] = returnValue;<br>         write_csr(mepc, read_csr(mepc) + 4);<br>- asm volatile("j supervisor_call_return");<br>+  asm volatile("j trap_return");<br> }<br> <br> static const char *const exception_names[] = {<br>@@ -262,7 +262,7 @@<br> <br>      // return to where we came from<br>       write_csr(mepc, read_csr(mepc) + 4);<br>- asm volatile("j machine_call_return");<br>+     asm volatile("j trap_return");<br> }<br> <br> void handle_misaligned_store(trapframe *tf) {<br>@@ -290,5 +290,5 @@<br> <br>       // return to where we came from<br>       write_csr(mepc, read_csr(mepc) + 4);<br>- asm volatile("j machine_call_return");<br>+     asm volatile("j trap_return");<br> }<br>diff --git a/src/arch/riscv/trap_util.S b/src/arch/riscv/trap_util.S<br>index 44cfab7..5add7ba 100644<br>--- a/src/arch/riscv/trap_util.S<br>+++ b/src/arch/riscv/trap_util.S<br>@@ -136,15 +136,10 @@<br>   save_tf<br>   move  a0,sp<br>   jal trap_handler<br>-  .global supervisor_call_return<br>-supervisor_call_return:<br>-  csrr a0, mscratch<br>-  restore_regs<br>-  # go back into supervisor call<br>-  mret<br>-  .global machine_call_return<br>-machine_call_return:<br>-    csrr a0, mscratch<br>-    restore_regs<br>-    # go back into machine call<br>-    mret<br>+<br>+      .global trap_return<br>+trap_return:<br>+   csrr    a0, mscratch<br>+ restore_regs<br>+ # go back to the previous mode<br>+       mret<br></pre><p>To view, visit <a href="https://review.coreboot.org/21763">change 21763</a>. To unsubscribe, visit <a href="https://review.coreboot.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://review.coreboot.org/21763"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: coreboot </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: I9de0c92b3f925e8f4db00d7281222a07db68b2ae </div>
<div style="display:none"> Gerrit-Change-Number: 21763 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Jonathan Neuschäfer <j.neuschaefer@gmx.net> </div>