semihosting: Return void from do_common_semihosting
authorRichard Henderson <richard.henderson@linaro.org>
Thu, 28 Apr 2022 08:10:55 +0000 (01:10 -0700)
committerRichard Henderson <richard.henderson@linaro.org>
Mon, 27 Jun 2022 23:05:07 +0000 (04:35 +0530)
commited3a06b10a6abb53589d794ed23accf21be05633
tree78e7bb0e6c8432afd1e985f3e8a156402f2821df
parent4cfeff4ac16bf5e3e1df44d5561b83e3bd3aab6c
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>
linux-user/aarch64/cpu_loop.c
linux-user/arm/cpu_loop.c
linux-user/riscv/cpu_loop.c
semihosting/arm-compat-semi.c
semihosting/common-semi.h
target/arm/helper.c
target/arm/m_helper.c
target/riscv/cpu_helper.c