On 9/16/19 7:15 AM, Peter Maydell wrote: > Currently for the semihosting calls which take a file descriptor > (SYS_CLOSE, SYS_WRITE, SYS_READ, SYS_ISTTY, SYS_SEEK, SYS_FLEN) > we have effectively two implementations, one for real host files > and one for when we indirect via the gdbstub. We want to add a > third one to deal with the magic :semihosting-features file. > > Instead of having a three-way if statement in each of these > cases, factor out the implementation of the calls to separate > functions which we dispatch to via function pointers selected > via the GuestFDType for the guest fd. > > In this commit, we set up the framework for the dispatch, > and convert the SYS_CLOSE call to use it. > > Signed-off-by: Peter Maydell <[email protected]> > --- > target/arm/arm-semi.c | 44 ++++++++++++++++++++++++++++++++++++------- > 1 file changed, 37 insertions(+), 7 deletions(-)
Reviewed-by: Richard Henderson <[email protected]> r~
