OSDN Git Service

semihosting: Use console_out_gf for SYS_WRITE0
authorRichard Henderson <richard.henderson@linaro.org>
Mon, 2 May 2022 01:02:53 +0000 (18:02 -0700)
committerRichard Henderson <richard.henderson@linaro.org>
Mon, 27 Jun 2022 23:10:47 +0000 (04:40 +0530)
Reviewed-by: Luc Michel <lmichel@kalray.eu>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
semihosting/arm-compat-semi.c

index d61b773..1a1e2a6 100644 (file)
@@ -437,8 +437,15 @@ void do_common_semihosting(CPUState *cs)
         break;
 
     case TARGET_SYS_WRITE0:
-        ret = qemu_semihosting_console_outs(env, args);
-        common_semi_set_ret(cs, ret);
+        {
+            ssize_t len = target_strlen(args);
+            if (len < 0) {
+                common_semi_dead_cb(cs, -1, EFAULT);
+            } else {
+                semihost_sys_write_gf(cs, common_semi_dead_cb,
+                                      &console_out_gf, args, len);
+            }
+        }
         break;
 
     case TARGET_SYS_WRITE: