qemu-cr16/semihosting
Sean Anderson 4f45b2c352 semihosting: Fix GDB File-I/O FLEN
fstat returns 0 on success and -1 on error. Since we have already
checked for error, ret must be zero. Therefore, any call to fstat on a
non-empty file will return -1/EOVERFLOW.

Restore the original logic that just did a byteswap. I don't really know
what the intention of the fixed commit was.

Fixes: a6300ed6b7 ("semihosting: Split out semihost_sys_flen")
Signed-off-by: Sean Anderson <sean.anderson@linux.dev>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Message-ID: <20251027110344.2289945-36-alex.bennee@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
2025-10-29 14:13:40 +00:00
..
arm-compat-semi-stub.c semihosting/guestfd: compile once for system/user 2025-09-26 09:55:19 +01:00
arm-compat-semi.c semihosting: Fix GDB File-I/O FLEN 2025-10-29 14:13:40 +00:00
config.c semihosting: fix memleak at semihosting_arg_fallback 2023-10-31 14:10:21 +00:00
console.c char: rename CharBackend->CharFrontend 2025-10-28 14:49:52 +01:00
guestfd.c semihosting/guestfd: compile once for system/user 2025-09-26 09:55:19 +01:00
Kconfig semihosting: Restrict to TCG 2024-07-22 09:38:16 +01:00
meson.build semihosting/arm-compat-semi: compile once in system and per target for user mode 2025-09-26 10:07:53 +01:00
stubs-all.c semihosting: Move user-only implementation out-of-line 2025-04-23 14:08:32 -07:00
stubs-system.c semihosting: Move user-only implementation out-of-line 2025-04-23 14:08:32 -07:00
syscalls.c semihosting/syscalls: replace uint64_t with vaddr where appropriate 2025-09-26 09:55:19 +01:00
uaccess.c semihosting/uaccess: Remove uses of target_ulong type 2025-07-02 10:09:48 +01:00
user.c semihosting: Assert is_user in user-only semihosting_enabled 2025-04-23 14:08:33 -07:00