Working Modes

5.6.3 Typical Working Mode Usage Scenarios

The core changes its working modein different ways, depending on the protection and stack paradigm in use. The sections immediately below illustrate two common task management paradigms supported by the SC140 core, that may be used by an RTOS: Dual-stack, and Single-stack

The terms “single” or “dual” stack refer to the number of stack pointer registers that are used by the system. When using a dual stack-pointer configuration, the RTOS can implement what is termed a multi-stack system. In such configurations, the stack pointer allocated for user tasks can be changed at each task switch to point to a different memory location for each task.

5.6.3.1Dual-stack RTOS

Figure 5-8 illustrates the working mode transitions for dual-stack operating systems.

Reset

nested exceptions

and external interrupt

requests

Exception Mode

EXP SP

1

ESP

return from exception via

RTOS call (via TRAP),RTE/D or exception,

or external interrupt request

Normal Mode

EXP SP

0

NSP

Figure 5-8. Working mode Transitions - Unprotected Dual-stack RTOS

The dual-stack operating system kernel executes in the Exception working mode. User task context is initialized while in the Exception working mode. User task invocation occurs when an RTE/D instruction is executed that restores EXP=0 in the SR. The user task executes in the Normal working mode until it requests operating system services using a TRAP instruction, or an exception or external interrupt request occurs. When the working mode changes from Normal to Exception mode, EXP is set by the core, and the previous SR is pushed on the exception stack.

5-38

SC140 DSP Core Reference Manual

Page 218
Image 218
Freescale Semiconductor SC140 specifications Typical Working Mode Usage Scenarios, Dual-stack Rtos