diff mbox series

[2/4] arch: arm/xen: add putc() for debugging

Message ID 20201015042516.41197-3-takahiro.akashi@linaro.org
State New
Headers show
Series xen: improve console outputs | expand

Commit Message

AKASHI Takahiro Oct. 15, 2020, 4:25 a.m. UTC
This new function, xen_debug_putc(), is intended to be used to
enable CONFIG_DEBUG_UART on xen guest.

Please note that the underlying functionality in Xen is available
only when Xen is configured with !NDEBUG but is much simpler than
a generic HYPERVISOR_console_io().

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>

---
 arch/arm/include/asm/xen/hypercall.h | 6 ++++++
 1 file changed, 6 insertions(+)

-- 
2.28.0

Comments

Peng Fan Oct. 15, 2020, 6:52 a.m. UTC | #1
> Subject: [PATCH 2/4] arch: arm/xen: add putc() for debugging

> 

> This new function, xen_debug_putc(), is intended to be used to enable

> CONFIG_DEBUG_UART on xen guest.

> 

> Please note that the underlying functionality in Xen is available only when Xen

> is configured with !NDEBUG but is much simpler than a generic

> HYPERVISOR_console_io().

> 

> Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>

> ---

>  arch/arm/include/asm/xen/hypercall.h | 6 ++++++

>  1 file changed, 6 insertions(+)

> 

> diff --git a/arch/arm/include/asm/xen/hypercall.h

> b/arch/arm/include/asm/xen/hypercall.h

> index a4fd077079a9..121ccfcc608f 100644

> --- a/arch/arm/include/asm/xen/hypercall.h

> +++ b/arch/arm/include/asm/xen/hypercall.h

> @@ -19,4 +19,10 @@ int HYPERVISOR_sched_op(int cmd, void *arg);  int

> HYPERVISOR_event_channel_op(int cmd, void *arg);  unsigned long

> HYPERVISOR_hvm_op(int op, void *arg);  int

> HYPERVISOR_memory_op(unsigned int cmd, void *arg);

> +

> +static inline void xen_debug_putc(int c) {

> +	register int v __asm__ ("x0") = c;

> +	__asm__ __volatile__("hvc 0xfffe" : "=r" (v) : "0" (v)); }

>  #endif /* _ASM_ARM_XEN_HYPERCALL_H */


Reviewed-by: Peng Fan <peng.fan@nxp.com>


> --

> 2.28.0
Tom Rini Oct. 23, 2020, 12:31 a.m. UTC | #2
On Thu, Oct 15, 2020 at 01:25:14PM +0900, AKASHI Takahiro wrote:

> This new function, xen_debug_putc(), is intended to be used to

> enable CONFIG_DEBUG_UART on xen guest.

> 

> Please note that the underlying functionality in Xen is available

> only when Xen is configured with !NDEBUG but is much simpler than

> a generic HYPERVISOR_console_io().

> 

> Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>

> Reviewed-by: Peng Fan <peng.fan@nxp.com>


Applied to u-boot/master, thanks!

-- 
Tom
diff mbox series

Patch

diff --git a/arch/arm/include/asm/xen/hypercall.h b/arch/arm/include/asm/xen/hypercall.h
index a4fd077079a9..121ccfcc608f 100644
--- a/arch/arm/include/asm/xen/hypercall.h
+++ b/arch/arm/include/asm/xen/hypercall.h
@@ -19,4 +19,10 @@  int HYPERVISOR_sched_op(int cmd, void *arg);
 int HYPERVISOR_event_channel_op(int cmd, void *arg);
 unsigned long HYPERVISOR_hvm_op(int op, void *arg);
 int HYPERVISOR_memory_op(unsigned int cmd, void *arg);
+
+static inline void xen_debug_putc(int c)
+{
+	register int v __asm__ ("x0") = c;
+	__asm__ __volatile__("hvc 0xfffe" : "=r" (v) : "0" (v));
+}
 #endif /* _ASM_ARM_XEN_HYPERCALL_H */