summaryrefslogtreecommitdiff
path: root/target/riscv
diff options
context:
space:
mode:
authorRichard Henderson <richard.henderson@linaro.org>2022-04-28 01:10:55 -0700
committerRichard Henderson <richard.henderson@linaro.org>2022-06-28 04:35:07 +0530
commited3a06b10a6abb53589d794ed23accf21be05633 (patch)
tree78e7bb0e6c8432afd1e985f3e8a156402f2821df /target/riscv
parent4cfeff4ac16bf5e3e1df44d5561b83e3bd3aab6c (diff)
semihosting: Return void from do_common_semihosting
Perform the cleanup in the FIXME comment in common_semi_gdb_syscall. Do not modify guest registers until the syscall is complete, which in the gdbstub case is asynchronous. In the synchronous non-gdbstub case, use common_semi_set_ret to set the result. Merge set_swi_errno into common_semi_cb. Rely on the latter for combined return value / errno setting. Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'target/riscv')
-rw-r--r--target/riscv/cpu_helper.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/target/riscv/cpu_helper.c b/target/riscv/cpu_helper.c
index 4a6700c890..be28615e23 100644
--- a/target/riscv/cpu_helper.c
+++ b/target/riscv/cpu_helper.c
@@ -1347,7 +1347,7 @@ void riscv_cpu_do_interrupt(CPUState *cs)
if (cause == RISCV_EXCP_SEMIHOST) {
if (env->priv >= PRV_S) {
- env->gpr[xA0] = do_common_semihosting(cs);
+ do_common_semihosting(cs);
env->pc += 4;
return;
}