3 typical working mode usage scenarios, 1 dual-stack rtos, Typical working mode usage scenarios -38 – Freescale Semiconductor StarCore SC140 User Manual

Page 218: Dual-stack rtos -38

Advertising
background image

5-38

SC140 DSP Core Reference Manual

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.1 Dual-stack RTOS

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

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.

Normal Mode

Reset

Exception Mode

RTOS call (via TRAP),
or exception,
or external interrupt
request

nested exceptions

and external interrupt

requests

return from exception via

RTE/D

EXP SP

0

NSP

EXP SP

1

ESP

Advertising