aboutsummaryrefslogtreecommitdiff
path: root/linux-user/main.c
diff options
context:
space:
mode:
authorRichard Henderson <richard.henderson@linaro.org>2022-05-01 17:21:00 -0700
committerRichard Henderson <richard.henderson@linaro.org>2022-06-28 04:36:50 +0530
commite4a4aaa51b4c71914a6f30ca504ab78e8f695aee (patch)
treeb36e1de06b9d0165a59f06d284808ef546e725eb /linux-user/main.c
parent008e147572863a7a54c54403e626aaed3e50574f (diff)
semihosting: Create qemu_semihosting_guestfd_init
For arm-compat, initialize console_{in,out}_gf; otherwise, initialize stdio file descriptors. This will go some way to cleaning up arm-compat, and will allow other semihosting to use normal stdio. Reviewed-by: Luc Michel <lmichel@kalray.eu> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'linux-user/main.c')
-rw-r--r--linux-user/main.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/linux-user/main.c b/linux-user/main.c
index 651e32f5f2..e44bdb17b8 100644
--- a/linux-user/main.c
+++ b/linux-user/main.c
@@ -54,6 +54,10 @@
#include "loader.h"
#include "user-mmap.h"
+#ifdef CONFIG_SEMIHOSTING
+#include "semihosting/semihost.h"
+#endif
+
#ifndef AT_FLAGS_PRESERVE_ARGV0
#define AT_FLAGS_PRESERVE_ARGV0_BIT 0
#define AT_FLAGS_PRESERVE_ARGV0 (1 << AT_FLAGS_PRESERVE_ARGV0_BIT)
@@ -906,6 +910,11 @@ int main(int argc, char **argv, char **envp)
}
gdb_handlesig(cpu, 0);
}
+
+#ifdef CONFIG_SEMIHOSTING
+ qemu_semihosting_guestfd_init();
+#endif
+
cpu_loop(env);
/* never exits */
return 0;