smpfatal08 fails on SMP RISC-V systems because all cpus are started by the 
boot-loader and clobber the test output. This patch stops the secondary cpus 
with a WFI (wait-for-interrupt). Harmless if only one cpu is started by the 
loader, as in the griscv bsp.

From 722f8363fe131801ebb9f733f836d0bf6cd82c7a Mon Sep 17 00:00:00 2001
From: Jiri Gaisler <j...@gaisler.se>
Date: Sun, 11 Apr 2021 21:15:13 +0200
Subject: [PATCH] smpfatal08: halt secondary RISC-V processors

	* On most RISC-V platforms, all cpus are started by the
	  boot-loader. We need to stop the secondary cpus or they
	  will clobber the test output.
---
 testsuites/smptests/smpfatal08/init.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/testsuites/smptests/smpfatal08/init.c b/testsuites/smptests/smpfatal08/init.c
index 47ea91b29d..d0c9fe276a 100644
--- a/testsuites/smptests/smpfatal08/init.c
+++ b/testsuites/smptests/smpfatal08/init.c
@@ -37,6 +37,9 @@ const char rtems_test_name[] = "SMPFATAL 8";
 void bsp_start_on_secondary_processor(struct Per_CPU_Control *cpu_self)
 {
   /* Provided to avoid multiple definitions of the CPU SMP support functions */
+#if defined(__riscv)
+   asm("wfi");
+#endif
   (void) cpu_self;
 }
 
-- 
2.25.1

_______________________________________________
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Reply via email to