|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH v3 5/6] xen/riscv: introduce early_printk basic stuff
On 10.01.2023 16:17, Oleksii Kurochko wrote:
> --- a/xen/arch/riscv/Kconfig.debug
> +++ b/xen/arch/riscv/Kconfig.debug
> @@ -0,0 +1,7 @@
> +config EARLY_PRINTK
> + bool "Enable early printk"
> + default DEBUG
> + depends on RISCV_64 || RISCV_32
You're in a RISC-V-specific Kconfig - do you really need this line?
> --- /dev/null
> +++ b/xen/arch/riscv/early_printk.c
> @@ -0,0 +1,33 @@
> +/* SPDX-License-Identifier: GPL-2.0 */
> +/*
> + * RISC-V early printk using SBI
> + *
> + * Copyright (C) 2021 Bobby Eshleman <bobbyeshleman@xxxxxxxxx>
> + */
> +#include <asm/early_printk.h>
> +#include <asm/sbi.h>
> +
> +/*
> + * TODO:
> + * sbi_console_putchar is already planned for deprecation
> + * so it should be reworked to use UART directly.
> +*/
> +void early_puts(const char *s, size_t nr)
> +{
> + while ( nr-- > 0 )
> + {
> + if (*s == '\n')
Nit (style): Missing blanks.
> + sbi_console_putchar('\r');
> + sbi_console_putchar(*s);
> + s++;
> + }
> +}
> +
> +void early_printk(const char *str)
> +{
> + while (*str)
Again.
> --- a/xen/arch/riscv/setup.c
> +++ b/xen/arch/riscv/setup.c
> @@ -1,12 +1,16 @@
> #include <xen/compile.h>
> #include <xen/init.h>
>
> +#include <asm/early_printk.h>
> +
> /* Xen stack for bringing up the first CPU. */
> unsigned char __initdata cpu0_boot_stack[STACK_SIZE]
> __aligned(STACK_SIZE);
>
> void __init noreturn start_xen(void)
> {
> + early_printk("Hello from C env\n");
> +
> for ( ;; )
> asm volatile ("wfi");
While this is only context here, it affects an earlier patch in the
series; this wants to be
for ( ; ; )
asm volatile ( "wfi" );
Jan
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |