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/07/16 15:10:31 UTC

[incubator-nuttx] branch sim created (now 21308a2)

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

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


      at 21308a2  arch/sim: The second CPU shouldn't call up_irqinitialize

This branch includes the following new commits:

     new 21308a2  arch/sim: The second CPU shouldn't call up_irqinitialize

The 1 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.


[incubator-nuttx] 01/01: arch/sim: The second CPU shouldn't call up_irqinitialize

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

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

commit 21308a2d129f050cabac080626fe41c3c2264b7f
Author: Xiang Xiao <xi...@xiaomi.com>
AuthorDate: Fri Jul 16 23:02:57 2021 +0800

    arch/sim: The second CPU shouldn't call up_irqinitialize
    
    since the signal handler the process concept
    
    Signed-off-by: Xiang Xiao <xi...@xiaomi.com>
---
 arch/sim/src/sim/up_hostirq.c   |  2 +-
 arch/sim/src/sim/up_internal.h  |  2 +-
 arch/sim/src/sim/up_simsmp.c    | 10 ----------
 arch/sim/src/sim/up_smpsignal.c |  4 ++--
 4 files changed, 4 insertions(+), 14 deletions(-)

diff --git a/arch/sim/src/sim/up_hostirq.c b/arch/sim/src/sim/up_hostirq.c
index 132bc9e..68173ad 100644
--- a/arch/sim/src/sim/up_hostirq.c
+++ b/arch/sim/src/sim/up_hostirq.c
@@ -114,7 +114,7 @@ void up_irqinitialize(void)
 #ifdef CONFIG_SMP
   /* Register the pause handler */
 
-  up_cpu_set_pause_handler(SIGUSR1);
+  up_init_ipi(SIGUSR1);
 #endif
 }
 
diff --git a/arch/sim/src/sim/up_internal.h b/arch/sim/src/sim/up_internal.h
index 7506d19..5629b15 100644
--- a/arch/sim/src/sim/up_internal.h
+++ b/arch/sim/src/sim/up_internal.h
@@ -173,7 +173,7 @@ void sim_send_ipi(int cpu);
 
 #ifdef CONFIG_SMP
 void up_cpu_started(void);
-int up_cpu_set_pause_handler(int irq);
+int up_init_ipi(int irq);
 #endif
 
 /* up_oneshot.c *************************************************************/
diff --git a/arch/sim/src/sim/up_simsmp.c b/arch/sim/src/sim/up_simsmp.c
index f35d1e2..c802675 100644
--- a/arch/sim/src/sim/up_simsmp.c
+++ b/arch/sim/src/sim/up_simsmp.c
@@ -52,12 +52,6 @@ static pthread_key_t g_cpu_key;
 static pthread_t     g_cpu_thread[CONFIG_SMP_NCPUS];
 
 /****************************************************************************
- * NuttX domain function prototypes
- ****************************************************************************/
-
-void up_irqinitialize(void);
-
-/****************************************************************************
  * Private Functions
  ****************************************************************************/
 
@@ -96,10 +90,6 @@ static void *sim_idle_trampoline(void *arg)
       return NULL;
     }
 
-  /* Initialize IRQ */
-
-  up_irqinitialize();
-
   /* Let up_cpu_start() continue */
 
   pthread_mutex_lock(&cpuinfo->cpu_init_lock);
diff --git a/arch/sim/src/sim/up_smpsignal.c b/arch/sim/src/sim/up_smpsignal.c
index 249bbc6..e2563b1 100644
--- a/arch/sim/src/sim/up_smpsignal.c
+++ b/arch/sim/src/sim/up_smpsignal.c
@@ -273,7 +273,7 @@ int up_cpu_start(int cpu)
 }
 
 /****************************************************************************
- * Name: up_cpu_set_pause_handler
+ * Name: up_init_ipi
  *
  * Description:
  *   Attach the CPU pause request interrupt to the NuttX logic.
@@ -285,7 +285,7 @@ int up_cpu_start(int cpu)
  *   On success returns OK (0), otherwise a negative value.
  ****************************************************************************/
 
-int up_cpu_set_pause_handler(int irq)
+int up_init_ipi(int irq)
 {
   up_enable_irq(irq);
   return irq_attach(irq, sim_cpupause_handler, NULL);