rtel wrote on Tuesday, November 24, 2015:
Each port has a different mechanism for yielding to a different task,
and each case has to be considered on its own.
More often than not, yielding is done using a standard or software
interrupt, in which cases the hardware will either itself disable
interrupts on interrupt entry, or otherwise the interrupt priority
mechanism and/or asm code is used to manage interrupt nesting to ensure
the context switch can occur cleanly.
Also, some ports can/must yield in a critical section and the RTOS must
save/restore the critical section nesting as part of the task context,
while other ports (Cortex-M and RX for example) can’t possibly yield
from a critical section.
You are looking at a very basic port (as its a basic microcontroller),
in which yielding is performed using a function call, and in that case
interrupts are disabled manually. This is not really a critical section
- the RTOS manages the yield, so is responsible for ensuring interrupts
are left in the correct state when a task starts to run.