Ver código fonte

semihosting: Use console_out_gf for SYS_WRITE0

Reviewed-by: Luc Michel <lmichel@kalray.eu>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Richard Henderson 3 anos atrás
pai
commit
7281550cfb
1 arquivos alterados com 9 adições e 2 exclusões
  1. 9 2
      semihosting/arm-compat-semi.c

+ 9 - 2
semihosting/arm-compat-semi.c

@@ -437,8 +437,15 @@ void do_common_semihosting(CPUState *cs)
         break;
         break;
 
 
     case TARGET_SYS_WRITE0:
     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;
         break;
 
 
     case TARGET_SYS_WRITE:
     case TARGET_SYS_WRITE: