From fccdcf7011b6b4b1604c584fad0782cccd7bb71a Mon Sep 17 00:00:00 2001 From: Masayuki Ishikawa Date: Tue, 22 Feb 2022 17:33:14 +0900 Subject: [PATCH] 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 3bdc67f6ec..1d73ba7aee 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 74473e8f7a..d7894640e9 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 1083dd97f5..2da213907d 100644 --- a/sched/semaphore/sem_trywait.c +++ b/sched/semaphore/sem_trywait.c @@ -29,7 +29,6 @@ #include #include -#include #include #include @@ -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 0e1acc4886..eec67723d7 100644 --- a/sched/semaphore/sem_wait.c +++ b/sched/semaphore/sem_wait.c @@ -28,7 +28,6 @@ #include #include -#include #include #include #include @@ -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