mirror of
https://github.com/apache/nuttx.git
synced 2026-06-05 15:58:59 +08:00
sched: replace some global variables to macro
replace to macro will help to extend the scheduling implementation Signed-off-by: chao an <anchao@lixiang.com>
This commit is contained in:
@@ -192,7 +192,7 @@ try_again:
|
||||
* lists are valid.
|
||||
*/
|
||||
|
||||
if (g_nx_initstate >= OSINIT_TASKLISTS)
|
||||
if (nxsched_initstate() >= OSINIT_TASKLISTS)
|
||||
{
|
||||
/* If called from an interrupt handler, then just take the spinlock.
|
||||
* If we are already in a critical section, this will lock the CPU
|
||||
@@ -416,7 +416,7 @@ irqstate_t enter_critical_section(void)
|
||||
* lists have been initialized.
|
||||
*/
|
||||
|
||||
if (!up_interrupt_context() && g_nx_initstate >= OSINIT_TASKLISTS)
|
||||
if (!up_interrupt_context() && nxsched_initstate() >= OSINIT_TASKLISTS)
|
||||
{
|
||||
FAR struct tcb_s *rtcb = this_task();
|
||||
DEBUGASSERT(rtcb != NULL);
|
||||
@@ -463,7 +463,7 @@ void leave_critical_section(irqstate_t flags)
|
||||
* lists are valid.
|
||||
*/
|
||||
|
||||
if (g_nx_initstate >= OSINIT_TASKLISTS)
|
||||
if (nxsched_initstate() >= OSINIT_TASKLISTS)
|
||||
{
|
||||
/* If called from an interrupt handler, then just release the
|
||||
* spinlock. The interrupt handling logic should already hold the
|
||||
@@ -608,7 +608,7 @@ void leave_critical_section(irqstate_t flags)
|
||||
* lists have been initialized.
|
||||
*/
|
||||
|
||||
if (!up_interrupt_context() && g_nx_initstate >= OSINIT_TASKLISTS)
|
||||
if (!up_interrupt_context() && nxsched_initstate() >= OSINIT_TASKLISTS)
|
||||
{
|
||||
FAR struct tcb_s *rtcb = this_task();
|
||||
DEBUGASSERT(rtcb != NULL);
|
||||
@@ -667,7 +667,7 @@ bool irq_cpu_locked(int cpu)
|
||||
|
||||
/* g_cpu_irqset is not valid in early phases of initialization */
|
||||
|
||||
if (g_nx_initstate < OSINIT_OSREADY)
|
||||
if (nxsched_initstate() < OSINIT_OSREADY)
|
||||
{
|
||||
/* We are still single threaded. In either state of g_cpu_irqlock,
|
||||
* the correct return value should always be false.
|
||||
|
||||
Reference in New Issue
Block a user