[PATCH 2/2] lib: utils/serial: remove semihosting_putc

Guo Ren guoren at kernel.org
Tue Oct 24 23:51:47 PDT 2023


On Wed, Oct 25, 2023 at 12:31 PM Xiang W <wxjstz at 126.com> wrote:
>
> For some debuggers that do not implement SYSWRITEC and SYSREADC
> operations, we can use SYSWRITE and SYSREAD instead like the
> implementation of semihosting_putc(). This makes
> semihosting_putc/semihosting_puts similar. Since
> console_putc/console_puts are now interchangeable, removing the
> semihosting_putc.
>
> Signed-off-by: Chen Pei <cp0613 at linux.alibaba.com>
> Signed-off-by: Xiang W <wxjstz at 126.com>
> ---
>  lib/utils/serial/semihosting.c | 6 ------
>  1 file changed, 6 deletions(-)
>
> diff --git a/lib/utils/serial/semihosting.c b/lib/utils/serial/semihosting.c
> index ce65887..19ebaa0 100644
> --- a/lib/utils/serial/semihosting.c
> +++ b/lib/utils/serial/semihosting.c
> @@ -160,11 +160,6 @@ static long semihosting_write(long fd, const void *memp, size_t len)
>
>  /* clang-format on */
>
> -static void semihosting_putc(char ch)
> -{
> -       semihosting_trap(SYSWRITEC, &ch);
> -}
> -
>  static unsigned long semihosting_puts(const char *str, unsigned long len)
>  {
>         char ch;
> @@ -199,7 +194,6 @@ static int semihosting_getc(void)
>
>  static struct sbi_console_device semihosting_console = {
>         .name = "semihosting",
> -       .console_putc = semihosting_putc,
Reviewed-by: Guo Ren <guoren at kerenl.org>

>         .console_puts = semihosting_puts,
>         .console_getc = semihosting_getc
>  };
> --
> 2.42.0
>
>
> --
> opensbi mailing list
> opensbi at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/opensbi



-- 
Best Regards
 Guo Ren



More information about the opensbi mailing list