summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAKASHI Takahiro <takahiro.akashi@linaro.org>2020-10-15 13:25:14 +0900
committerTom Rini <trini@konsulko.com>2020-10-22 11:26:14 -0400
commit3a51b2a2c3cedc0d2a9ce981b8e00ab8cefcb6b7 (patch)
tree26fa9a221f069691d0364ededd0b39c04b5c2546
parent18426bf02217de2e9bb2b41eaa74d769892c55ef (diff)
downloadu-boot-3a51b2a2c3cedc0d2a9ce981b8e00ab8cefcb6b7.tar.gz
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> Reviewed-by: Peng Fan <peng.fan@nxp.com>
-rw-r--r--arch/arm/include/asm/xen/hypercall.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/arm/include/asm/xen/hypercall.h b/arch/arm/include/asm/xen/hypercall.h
index a4fd077079..121ccfcc60 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 */