semihosting: Split out semihost_sys_isatty
commita2212474301bc354bea46e3bdc6c21e33e0b5b2b
authorRichard Henderson <richard.henderson@linaro.org>
Thu, 28 Apr 2022 19:31:25 +0000 (28 12:31 -0700)
committerRichard Henderson <richard.henderson@linaro.org>
Mon, 27 Jun 2022 23:05:52 +0000 (28 04:35 +0530)
treef4fcc2215eea0b78cebd2cc7796df2d5e7213f68
parent9a89470449a5171eb1bd06f681361e0888d15cf7
semihosting: Split out semihost_sys_isatty

Split out the non-ARM specific portions of SYS_ISTTY to a
reusable function.  This handles all GuestFD.

Add a common_semi_istty_cb helper to translate the Posix
error return, 0+ENOTTY, to the Arm semihosting not-a-file
success result.

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