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

masayuki pushed a commit to branch revert-5577-mine
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit 170381496cb17cc4be046da11847884ba8a7fa0d
Author: Masayuki Ishikawa <masayuki.ishik...@gmail.com>
AuthorDate: Tue Feb 22 17:33:14 2022 +0900

    Revert "os init_state: add new state OSINIT_IDLELOOP"
    
    This reverts commit 051bb32010608831f838158848c03f20c1458e93.
---
 include/nuttx/init.h          | 4 +---
 sched/init/nx_start.c         | 4 ----
 sched/semaphore/sem_trywait.c | 4 +---
 sched/semaphore/sem_wait.c    | 4 +---
 4 files changed, 3 insertions(+), 13 deletions(-)

diff --git a/include/nuttx/init.h b/include/nuttx/init.h
index 3bdc67f..1d73ba7 100644
--- a/include/nuttx/init.h
+++ b/include/nuttx/init.h
@@ -41,7 +41,6 @@
 #define OSINIT_MM_READY()        (g_nx_initstate >= OSINIT_MEMORY)
 #define OSINIT_HW_READY()        (g_nx_initstate >= OSINIT_HARDWARE)
 #define OSINIT_OS_READY()        (g_nx_initstate >= OSINIT_OSREADY)
-#define OSINIT_IDLELOOP()        (g_nx_initstate >= OSINIT_IDLELOOP)
 #define OSINIT_OS_INITIALIZING() (g_nx_initstate  < OSINIT_OSREADY)
 
 /****************************************************************************
@@ -66,9 +65,8 @@ enum nx_initstate_e
                           * to support the hardware are also available but
                           * the OS has not yet completed its full
                           * initialization. */
-  OSINIT_OSREADY   = 5,  /* The OS is fully initialized and multi-tasking is
+  OSINIT_OSREADY   = 5   /* The OS is fully initialized and multi-tasking is
                           * active. */
-  OSINIT_IDLELOOP  = 6   /* The OS enter idle loop */
 };
 
 /****************************************************************************
diff --git a/sched/init/nx_start.c b/sched/init/nx_start.c
index 74473e8..d789464 100644
--- a/sched/init/nx_start.c
+++ b/sched/init/nx_start.c
@@ -776,10 +776,6 @@ void nx_start(void)
 
   DEBUGVERIFY(nx_bringup());
 
-  /* Enter to idleloop */
-
-  g_nx_initstate = OSINIT_IDLELOOP;
-
   /* Let other threads have access to the memory manager */
 
   sched_unlock();
diff --git a/sched/semaphore/sem_trywait.c b/sched/semaphore/sem_trywait.c
index 1083dd9..2da2139 100644
--- a/sched/semaphore/sem_trywait.c
+++ b/sched/semaphore/sem_trywait.c
@@ -29,7 +29,6 @@
 #include <assert.h>
 #include <errno.h>
 
-#include <nuttx/init.h>
 #include <nuttx/irq.h>
 #include <nuttx/arch.h>
 
@@ -70,10 +69,9 @@ int nxsem_trywait(FAR sem_t *sem)
   irqstate_t flags;
   int ret;
 
-  /* This API should not be called from interrupt handlers & idleloop */
+  /* This API should not be called from interrupt handlers */
 
   DEBUGASSERT(sem != NULL && up_interrupt_context() == false);
-  DEBUGASSERT(OSINIT_IDLELOOP() && !sched_idletask());
 
   if (sem != NULL)
     {
diff --git a/sched/semaphore/sem_wait.c b/sched/semaphore/sem_wait.c
index 0e1acc4..eec6772 100644
--- a/sched/semaphore/sem_wait.c
+++ b/sched/semaphore/sem_wait.c
@@ -28,7 +28,6 @@
 #include <errno.h>
 #include <assert.h>
 
-#include <nuttx/init.h>
 #include <nuttx/irq.h>
 #include <nuttx/arch.h>
 #include <nuttx/cancelpt.h>
@@ -74,10 +73,9 @@ int nxsem_wait(FAR sem_t *sem)
   irqstate_t flags;
   int ret = -EINVAL;
 
-  /* This API should not be called from interrupt handlers & idleloop */
+  /* This API should not be called from interrupt handlers */
 
   DEBUGASSERT(sem != NULL && up_interrupt_context() == false);
-  DEBUGASSERT(OSINIT_IDLELOOP() && !sched_idletask());
 
   /* The following operations must be performed with interrupts
    * disabled because nxsem_post() may be called from an interrupt

Reply via email to