You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2021/12/02 17:21:59 UTC

[incubator-nuttx] branch master updated (917f1a6 -> 50d217a)

This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git.


    from 917f1a6  libdsp: Fix compile error with the standard math library
     new b34951e  esp32_cpustart.c: Remove the CONFIG_SMP condition on some part of code because the whole file is only built if CONFIG_SMP is enabled.
     new 50d217a  esp32_cpustart.c: Improve comments around the usage of the inter-cpu startup handshake.

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 arch/xtensa/src/esp32/esp32_cpustart.c | 18 +++++++-----------
 1 file changed, 7 insertions(+), 11 deletions(-)

[incubator-nuttx] 02/02: esp32_cpustart.c: Improve comments around the usage of the inter-cpu startup handshake.

Posted by xi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit 50d217a9e86c85f68621a0af470dedb62472e49d
Author: Abdelatif Guettouche <ab...@espressif.com>
AuthorDate: Thu Dec 2 16:34:56 2021 +0100

    esp32_cpustart.c: Improve comments around the usage of the inter-cpu
    startup handshake.
    
    Signed-off-by: Abdelatif Guettouche <ab...@espressif.com>
---
 arch/xtensa/src/esp32/esp32_cpustart.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/arch/xtensa/src/esp32/esp32_cpustart.c b/arch/xtensa/src/esp32/esp32_cpustart.c
index 2ef5358..15afe48 100644
--- a/arch/xtensa/src/esp32/esp32_cpustart.c
+++ b/arch/xtensa/src/esp32/esp32_cpustart.c
@@ -164,7 +164,9 @@ void xtensa_appcpu_start(void)
   sched_note_cpu_started(tcb);
 #endif
 
-  /* Handle interlock */
+  /* Release the spinlock to signal to the PRO CPU that the APP CPU has
+   * started.
+   */
 
   g_appcpu_started = true;
   spin_unlock(&g_appcpu_interlock);
@@ -268,8 +270,9 @@ int up_cpu_start(int cpu)
       sched_note_cpu_start(this_task(), cpu);
 #endif
 
-      /* The waitsem semaphore is used for signaling and, hence, should not
-       * have priority inheritance enabled.
+      /* This spinlock will be used as a handshake between the two CPUs.
+       * It's first initialized to its locked state, later the PRO CPU will
+       * try to lock it but spins until the APP CPU starts and unlocks it.
        */
 
       spin_initialize(&g_appcpu_interlock, SP_LOCKED);
@@ -313,7 +316,7 @@ int up_cpu_start(int cpu)
 
       ets_set_appcpu_boot_addr((uint32_t)xtensa_appcpu_start);
 
-      /* And wait for the initial task to run on CPU1 */
+      /* And wait until the APP CPU starts and releases the spinlock. */
 
       spin_lock(&g_appcpu_interlock);
       DEBUGASSERT(g_appcpu_started);

[incubator-nuttx] 01/02: esp32_cpustart.c: Remove the CONFIG_SMP condition on some part of code because the whole file is only built if CONFIG_SMP is enabled.

Posted by xi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit b34951e3a05a1c35a924d5e09ba5c8ce3bf3f801
Author: Abdelatif Guettouche <ab...@espressif.com>
AuthorDate: Thu Dec 2 16:24:52 2021 +0100

    esp32_cpustart.c: Remove the CONFIG_SMP condition on some part of code
    because the whole file is only built if CONFIG_SMP is enabled.
    
    Signed-off-by: Abdelatif Guettouche <ab...@espressif.com>
---
 arch/xtensa/src/esp32/esp32_cpustart.c | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/arch/xtensa/src/esp32/esp32_cpustart.c b/arch/xtensa/src/esp32/esp32_cpustart.c
index c915b08..2ef5358 100644
--- a/arch/xtensa/src/esp32/esp32_cpustart.c
+++ b/arch/xtensa/src/esp32/esp32_cpustart.c
@@ -46,8 +46,6 @@
 #include "esp32_smp.h"
 #include "esp32_gpio.h"
 
-#ifdef CONFIG_SMP
-
 /****************************************************************************
  * Private Data
  ****************************************************************************/
@@ -88,7 +86,6 @@ static inline void xtensa_registerdump(struct tcb_s *tcb)
  * Name: xtensa_attach_fromcpu0_interrupt
  ****************************************************************************/
 
-#ifdef CONFIG_SMP
 static inline void xtensa_attach_fromcpu0_interrupt(void)
 {
   int cpuint;
@@ -106,7 +103,6 @@ static inline void xtensa_attach_fromcpu0_interrupt(void)
 
   up_enable_irq(ESP32_IRQ_CPU_CPU0);
 }
-#endif
 
 /****************************************************************************
  * Public Functions
@@ -191,11 +187,9 @@ void xtensa_appcpu_start(void)
 
   /* Attach and enable internal interrupts */
 
-#ifdef CONFIG_SMP
   /* Attach and enable the inter-CPU interrupt */
 
   xtensa_attach_fromcpu0_interrupt();
-#endif
 
 #if 0 /* Does it make since to have co-processors enabled on the IDLE thread? */
 #if XTENSA_CP_ALLSET != 0
@@ -328,4 +322,3 @@ int up_cpu_start(int cpu)
   return OK;
 }
 
-#endif /* CONFIG_SMP */