Skip to content

Commit

Permalink
irq: simplify code by using OSINIT_TASK_READY
Browse files Browse the repository at this point in the history
Signed-off-by: hujun5 <[email protected]>
  • Loading branch information
hujun260 authored and xiaoxiang781216 committed Sep 11, 2024
1 parent f063e47 commit cd8db32
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions sched/irq/irq_csection.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -335,7 +335,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());

/* Normal tasking environment.
Expand Down Expand Up @@ -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 */

Expand All @@ -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();
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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);

Expand Down

0 comments on commit cd8db32

Please sign in to comment.