irq: simplify code by using OSINIT_TASK_READY

Signed-off-by: hujun5 <hujun5@xiaomi.com>
This commit is contained in:
hujun5 2024-09-11 08:51:31 +08:00 committed by Xiang Xiao
parent f063e47c28
commit cd8db329de
1 changed files with 6 additions and 6 deletions

View File

@ -186,7 +186,7 @@ irqstate_t enter_critical_section(void)
* lists are valid.
*/
DEBUGASSERT(g_nx_initstate >= OSINIT_TASKLISTS);
DEBUGASSERT(OSINIT_TASK_READY());
/* If called from an interrupt handler, then just take the spinlock.
* If we are already in a critical section, this will lock the CPU
@ -335,7 +335,7 @@ try_again:
* lists are valid.
*/
DEBUGASSERT(g_nx_initstate >= OSINIT_TASKLISTS);
DEBUGASSERT(OSINIT_TASK_READY());
DEBUGASSERT(!up_interrupt_context());
/* Normal tasking environment.
@ -424,7 +424,7 @@ irqstate_t enter_critical_section(void)
* lists are valid.
*/
DEBUGASSERT(g_nx_initstate >= OSINIT_TASKLISTS);
DEBUGASSERT(OSINIT_TASK_READY());
/* Check if we were called from an interrupt handler */
@ -451,7 +451,7 @@ inline_function irqstate_t enter_critical_section_nonirq(void)
* lists are valid.
*/
DEBUGASSERT(g_nx_initstate >= OSINIT_TASKLISTS);
DEBUGASSERT(OSINIT_TASK_READY());
DEBUGASSERT(!up_interrupt_context());
rtcb = this_task();
@ -546,7 +546,7 @@ inline_function void leave_critical_section_nonirq(irqstate_t flags)
FAR struct tcb_s *rtcb;
int cpu;
DEBUGASSERT(g_nx_initstate >= OSINIT_TASKLISTS);
DEBUGASSERT(OSINIT_TASK_READY());
DEBUGASSERT(!up_interrupt_context());
/* Get the TCB of the currently executing task on this CPU (avoid
@ -620,7 +620,7 @@ inline_function void leave_critical_section_nonirq(irqstate_t flags)
{
FAR struct tcb_s *rtcb = this_task();
DEBUGASSERT(g_nx_initstate >= OSINIT_TASKLISTS);
DEBUGASSERT(OSINIT_TASK_READY());
DEBUGASSERT(!up_interrupt_context());
DEBUGASSERT(rtcb != NULL);