<p>Jonathan Neuschäfer has uploaded this change for <strong>review</strong>.</p><p><a href="https://review.coreboot.org/21764">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">arch/riscv: Return from trap_handler instead of jumping out<br><br>Change-Id: I8dbed5dbe377d3a02e58a3bc16a1ee112b28bea9<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, 3 insertions(+), 7 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://review.coreboot.org:29418/coreboot refs/changes/64/21764/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 78b98e4..1f13bed 100644<br>--- a/src/arch/riscv/trap_handler.c<br>+++ b/src/arch/riscv/trap_handler.c<br>@@ -69,7 +69,6 @@<br> }<br> tf->gpr[10] = returnValue;<br> write_csr(mepc, read_csr(mepc) + 4);<br>- asm volatile("j trap_return");<br> }<br> <br> static const char *const exception_names[] = {<br>@@ -210,16 +209,16 @@<br> case CAUSE_MISALIGNED_LOAD:<br> print_trap_information(tf);<br> handle_misaligned_load(tf);<br>- break;<br>+ return;<br> case CAUSE_MISALIGNED_STORE:<br> print_trap_information(tf);<br> handle_misaligned_store(tf);<br>- break;<br>+ return;<br> case CAUSE_SUPERVISOR_ECALL:<br> /* Don't print so we make console putchar calls look<br> the way they should */<br> handle_supervisor_call(tf);<br>- break;<br>+ return;<br> default:<br> printk(BIOS_EMERG, "================================\n");<br> printk(BIOS_EMERG, "coreboot: can not handle a trap:\n");<br>@@ -262,7 +261,6 @@<br> <br> // return to where we came from<br> write_csr(mepc, read_csr(mepc) + 4);<br>- asm volatile("j trap_return");<br> }<br> <br> void handle_misaligned_store(trapframe *tf) {<br>@@ -290,5 +288,4 @@<br> <br> // return to where we came from<br> write_csr(mepc, read_csr(mepc) + 4);<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 5add7ba..601862d 100644<br>--- a/src/arch/riscv/trap_util.S<br>+++ b/src/arch/riscv/trap_util.S<br>@@ -137,7 +137,6 @@<br> move a0,sp<br> jal trap_handler<br> <br>- .global trap_return<br> trap_return:<br> csrr a0, mscratch<br> restore_regs<br></pre><p>To view, visit <a href="https://review.coreboot.org/21764">change 21764</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/21764"/><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: I8dbed5dbe377d3a02e58a3bc16a1ee112b28bea9 </div>
<div style="display:none"> Gerrit-Change-Number: 21764 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Jonathan Neuschäfer <j.neuschaefer@gmx.net> </div>