irq: simplify code by using OSINIT_TASK_READY
Signed-off-by: hujun5 <hujun5@xiaomi.com>
This commit is contained in:
parent
f063e47c28
commit
cd8db329de
|
@ -186,7 +186,7 @@ irqstate_t enter_critical_section(void)
|
||||||
* lists are valid.
|
* 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 called from an interrupt handler, then just take the spinlock.
|
||||||
* If we are already in a critical section, this will lock the CPU
|
* If we are already in a critical section, this will lock the CPU
|
||||||
|
@ -335,7 +335,7 @@ try_again:
|
||||||
* lists are valid.
|
* lists are valid.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
DEBUGASSERT(g_nx_initstate >= OSINIT_TASKLISTS);
|
DEBUGASSERT(OSINIT_TASK_READY());
|
||||||
DEBUGASSERT(!up_interrupt_context());
|
DEBUGASSERT(!up_interrupt_context());
|
||||||
|
|
||||||
/* Normal tasking environment.
|
/* Normal tasking environment.
|
||||||
|
@ -424,7 +424,7 @@ irqstate_t enter_critical_section(void)
|
||||||
* lists are valid.
|
* lists are valid.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
DEBUGASSERT(g_nx_initstate >= OSINIT_TASKLISTS);
|
DEBUGASSERT(OSINIT_TASK_READY());
|
||||||
|
|
||||||
/* Check if we were called from an interrupt handler */
|
/* 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.
|
* lists are valid.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
DEBUGASSERT(g_nx_initstate >= OSINIT_TASKLISTS);
|
DEBUGASSERT(OSINIT_TASK_READY());
|
||||||
DEBUGASSERT(!up_interrupt_context());
|
DEBUGASSERT(!up_interrupt_context());
|
||||||
|
|
||||||
rtcb = this_task();
|
rtcb = this_task();
|
||||||
|
@ -546,7 +546,7 @@ inline_function void leave_critical_section_nonirq(irqstate_t flags)
|
||||||
FAR struct tcb_s *rtcb;
|
FAR struct tcb_s *rtcb;
|
||||||
int cpu;
|
int cpu;
|
||||||
|
|
||||||
DEBUGASSERT(g_nx_initstate >= OSINIT_TASKLISTS);
|
DEBUGASSERT(OSINIT_TASK_READY());
|
||||||
DEBUGASSERT(!up_interrupt_context());
|
DEBUGASSERT(!up_interrupt_context());
|
||||||
|
|
||||||
/* Get the TCB of the currently executing task on this CPU (avoid
|
/* 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();
|
FAR struct tcb_s *rtcb = this_task();
|
||||||
|
|
||||||
DEBUGASSERT(g_nx_initstate >= OSINIT_TASKLISTS);
|
DEBUGASSERT(OSINIT_TASK_READY());
|
||||||
DEBUGASSERT(!up_interrupt_context());
|
DEBUGASSERT(!up_interrupt_context());
|
||||||
DEBUGASSERT(rtcb != NULL);
|
DEBUGASSERT(rtcb != NULL);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue