semihosting: Clean up common_semi_open_cb

Use common_semi_cb to return results instead of calling
set_swi_errno and common_semi_set_ret directly.

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
master
Richard Henderson 2022-05-16 19:37:14 -07:00
parent 84ca0dfd1e
commit 4cfeff4ac1
1 changed files with 2 additions and 4 deletions

View File

@ -364,15 +364,13 @@ static int common_semi_open_guestfd;
static void
common_semi_open_cb(CPUState *cs, target_ulong ret, target_ulong err)
{
if (ret == (target_ulong)-1) {
errno = err;
set_swi_errno(cs, -1);
if (err) {
dealloc_guestfd(common_semi_open_guestfd);
} else {
associate_guestfd(common_semi_open_guestfd, ret);
ret = common_semi_open_guestfd;
}
common_semi_set_ret(cs, ret);
common_semi_cb(cs, ret, err);
}
static target_ulong