diff mbox series

[v1,7/8] xen/riscv: print hello message from C env

Message ID 21fb02aa340fe3a7a95dfbb950b33ae7a363496e.1673009740.git.oleksii.kurochko@gmail.com (mailing list archive)
State Superseded
Headers show
Series Basic early_printk and smoke test implementation | expand

Commit Message

Oleksii Kurochko Jan. 6, 2023, 1:14 p.m. UTC
Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 xen/arch/riscv/riscv64/head.S |  4 +---
 xen/arch/riscv/setup.c        | 12 ++++++++++++
 2 files changed, 13 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/xen/arch/riscv/riscv64/head.S b/xen/arch/riscv/riscv64/head.S
index ddc7104701..4e399016e9 100644
--- a/xen/arch/riscv/riscv64/head.S
+++ b/xen/arch/riscv/riscv64/head.S
@@ -5,6 +5,4 @@  ENTRY(start)
         li      t0, PAGE_SIZE
         add     sp, sp, t0
 
-_start_hang:
-        wfi
-        j  _start_hang
+        tail    start_xen
diff --git a/xen/arch/riscv/setup.c b/xen/arch/riscv/setup.c
index 2c7dca1daa..785566103b 100644
--- a/xen/arch/riscv/setup.c
+++ b/xen/arch/riscv/setup.c
@@ -1,6 +1,18 @@ 
 #include <xen/init.h>
 #include <xen/compile.h>
 
+#include <asm/early_printk.h>
+
 /* Xen stack for bringing up the first CPU. */
 unsigned char __initdata cpu0_boot_stack[PAGE_SIZE]
     __aligned(PAGE_SIZE);
+
+void __init noreturn start_xen(void)
+{
+    early_printk("Hello from C env\n");
+
+    for ( ;; )
+        asm volatile ("wfi");
+
+    unreachable();
+}