target/arm/arm-semi: Implement support for semihosting feature detection
commitc46a653c3a2f96c55a47241ba9c67add0e7a3b22
authorPeter Maydell <peter.maydell@linaro.org>
Mon, 16 Sep 2019 14:15:42 +0000 (16 15:15 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Tue, 15 Oct 2019 17:09:03 +0000 (15 18:09 +0100)
treecbb78cc6e8eed1582ae8ad7b0204e127faf004ae
parent1631a7be3a22859e0b490c631a0c969d6b8b6230
target/arm/arm-semi: Implement support for semihosting feature detection

Version 2.0 of the semihosting specification added support for
allowing a guest to detect whether the implementation supported
particular features. This works by the guest opening a magic
file ":semihosting-features", which contains a fixed set of
data with some magic numbers followed by a sequence of bytes
with feature flags. The file is expected to behave sensibly
for the various semihosting calls which operate on files
(SYS_FLEN, SYS_SEEK, etc).

Implement this as another kind of guest FD using our function
table dispatch mechanism. Initially we report no extended
features, so we have just one feature flag byte which is zero.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Message-id: 20190916141544.17540-14-peter.maydell@linaro.org
target/arm/arm-semi.c