semihosting: Split out semihost_sys_lseek
commit9a89470449a5171eb1bd06f681361e0888d15cf7
authorRichard Henderson <richard.henderson@linaro.org>
Thu, 28 Apr 2022 19:04:44 +0000 (28 12:04 -0700)
committerRichard Henderson <richard.henderson@linaro.org>
Mon, 27 Jun 2022 23:05:52 +0000 (28 04:35 +0530)
treeb7b7537fe55caf844a34969fc229ded15d46998e
parent40f1219a8b2f95808ed5a18798dbce1b57fef211
semihosting: Split out semihost_sys_lseek

Split out the non-ARM specific portions of SYS_SEEK to a
reusable function.  This handles all GuestFD.  Isolate the
curious ARM-specific return value processing to a new
callback, common_semi_seek_cb.

Expand the internal type of the offset to int64_t, and
provide the whence argument, which will be required by
m68k and nios2 semihosting.

Note that gdb_do_syscall %x reads target_ulong, not int.

Reviewed-by: Luc Michel <lmichel@kalray.eu>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
include/exec/gdbstub.h
include/semihosting/syscalls.h
semihosting/arm-compat-semi.c
semihosting/syscalls.c