xiaoxiang781216 commented on code in PR #7247:
URL: https://github.com/apache/incubator-nuttx/pull/7247#discussion_r988703547


##########
arch/risc-v/src/qemu-rv/qemu_rv_start.c:
##########
@@ -144,9 +148,25 @@ void qemu_rv_start(int mhartid)
 
 #ifdef CONFIG_BUILD_KERNEL
 
+static bool g_bss_cleared = false;
+
 void qemu_rv_start_s(int mhartid)
 {
-  qemu_rv_clear_bss();
+  if (0 == mhartid)
+    {
+      qemu_rv_clear_bss();
+      g_bss_cleared = true;
+      __DMB();
+    }
+#ifdef CONFIG_SMP
+  else
+    {
+      while (!g_bss_cleared)

Review Comment:
   If the secondary core boot too fast(before primary core clear .bss section), 
g_bss_cleared is a random number.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to