qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v4 50/53] semihosting: Remove qemu_semihosting_console_outc


From: Luc Michel
Subject: Re: [PATCH v4 50/53] semihosting: Remove qemu_semihosting_console_outc
Date: Mon, 27 Jun 2022 10:42:00 +0200
User-agent: Mutt/1.9.4 (2018-02-28)

On 13:45 Tue 07 Jun     , Richard Henderson wrote:
> This function has been replaced by *_write.
> 
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

Reviewed-by: Luc Michel <lmichel@kalray.eu>

> ---
>  include/semihosting/console.h | 13 -------------
>  linux-user/semihost.c         | 16 ----------------
>  semihosting/console.c         | 18 ------------------
>  3 files changed, 47 deletions(-)
> 
> diff --git a/include/semihosting/console.h b/include/semihosting/console.h
> index 6994f23c82..d6c1cc58ab 100644
> --- a/include/semihosting/console.h
> +++ b/include/semihosting/console.h
> @@ -24,19 +24,6 @@
>   */
>  int qemu_semihosting_console_outs(CPUArchState *env, target_ulong s);
>  
> -/**
> - * qemu_semihosting_console_outc:
> - * @env: CPUArchState
> - * @s: host address of null terminated guest string
> - *
> - * Send single character from guest memory to the debug console. This
> - * may be the remote gdb session if a softmmu guest is currently being
> - * debugged.
> - *
> - * Returns: nothing
> - */
> -void qemu_semihosting_console_outc(CPUArchState *env, target_ulong c);
> -
>  /**
>   * qemu_semihosting_console_read:
>   * @cs: CPUState
> diff --git a/linux-user/semihost.c b/linux-user/semihost.c
> index 871edf993a..f8bc8889f3 100644
> --- a/linux-user/semihost.c
> +++ b/linux-user/semihost.c
> @@ -33,22 +33,6 @@ int qemu_semihosting_console_outs(CPUArchState *env, 
> target_ulong addr)
>      return len;
>  }
>  
> -void qemu_semihosting_console_outc(CPUArchState *env, target_ulong addr)
> -{
> -    char c;
> -
> -    if (get_user_u8(c, addr)) {
> -        qemu_log_mask(LOG_GUEST_ERROR,
> -                      "%s: passed inaccessible address " TARGET_FMT_lx,
> -                      __func__, addr);
> -    } else {
> -        if (write(STDERR_FILENO, &c, 1) != 1) {
> -            qemu_log_mask(LOG_UNIMP, "%s: unexpected write to stdout 
> failure",
> -                          __func__);
> -        }
> -    }
> -}
> -
>  /*
>   * For linux-user we can safely block. However as we want to return as
>   * soon as a character is read we need to tweak the termio to disable
> diff --git a/semihosting/console.c b/semihosting/console.c
> index 677ec2b176..f6fab5933a 100644
> --- a/semihosting/console.c
> +++ b/semihosting/console.c
> @@ -96,24 +96,6 @@ int qemu_semihosting_console_outs(CPUArchState *env, 
> target_ulong addr)
>      return out;
>  }
>  
> -void qemu_semihosting_console_outc(CPUArchState *env, target_ulong addr)
> -{
> -    CPUState *cpu = env_cpu(env);
> -    uint8_t c;
> -
> -    if (cpu_memory_rw_debug(cpu, addr, &c, 1, 0) == 0) {
> -        if (use_gdb_syscalls()) {
> -            gdb_do_syscall(semihosting_cb, "write,2,%x,%x", addr, 1);
> -        } else {
> -            qemu_semihosting_log_out((const char *) &c, 1);
> -        }
> -    } else {
> -        qemu_log_mask(LOG_GUEST_ERROR,
> -                      "%s: passed inaccessible address " TARGET_FMT_lx,
> -                      __func__, addr);
> -    }
> -}
> -
>  #define FIFO_SIZE   1024
>  
>  static int console_can_read(void *opaque)
> -- 
> 2.34.1
> 
> 
> 
> 
> To declare a filtering error, please use the following link : 
> https://www.security-mail.net/reporter.php?mid=17199.629fd830.873a5.0&r=lmichel%40kalrayinc.com&s=qemu-devel-bounces%2Blmichel%3Dkalrayinc.com%40nongnu.org&o=%5BPATCH+v4+50%2F53%5D+semihosting%3A+Remove+qemu_semihosting_console_outc&verdict=C&c=17fd1d8aafc59b73861d5d8e80dfec815f24e02d
> 

-- 







reply via email to

[Prev in Thread] Current Thread [Next in Thread]