48
11100B–ATARM–31-Jul-12
SAM4S Series [Preliminary]
11.4
Cortex-M4 Models
11.4.1
Programmers Model
This section describes the Cortex-M4 programmers model. In addition to the individual core reg-
ister descriptions, it contains information about the processor modes and privilege levels for
software execution and stacks.
11.4.1.1
Processor Modes And Privilege Levels for Software Execution
The processor modes are:
• Thread mode
Used to execute application software. The processor enters the Thread mode when it comes
out of reset.
• Handler mode
Used to handle exceptions. The processor returns to the Thread mode when it has finished
exception processing.
The privilege levels for software execution are:
• Unprivileged
The software:
– has limited access to the MSR and MRS instructions, and cannot use the CPS
instruction
– cannot access the System Timer, NVIC, or System Control Block
– might have a restricted access to memory or peripherals.
Unprivileged software executes at the unprivileged level.
• Privileged
The software can use all the instructions and has access to all resources. Privileged software
executes at the privileged level.
In Thread mode, the CONTROL register controls whether the software execution is privileged or
unprivileged, see
. In Handler mode, software execution is always
privileged.
Only privileged software can write to the CONTROL register to change the privilege level for
software execution in Thread mode. Unprivileged software can use the SVC instruction to make
a supervisor call to transfer control to privileged software.
11.4.1.2
Stacks
The processor uses a full descending stack. This means the stack pointer holds the address of
the last stacked item in memory When the processor pushes a new item onto the stack, it decre-
ments the stack pointer and then writes the item to the new memory location. The processor
implements two stacks, the main stack and the process stack, with a pointer for each held in
independent registers, see
In Thread mode, the CONTROL register controls whether the processor uses the main stack or
the process stack, see
.
In Handler mode, the processor always uses the main stack.
Содержание SAM4S Series
Страница 44: ...44 11100B ATARM 31 Jul 12 SAM4S Series Preliminary ...
Страница 412: ...412 11100B ATARM 31 Jul 12 SAM4S Series Preliminary ...
Страница 1105: ...1105 11100B ATARM 31 Jul 12 SAM4S Series Preliminary ...
Страница 1142: ...1142 11100B ATARM 31 Jul 12 SAM4S Series Preliminary Figure 43 3 100 ball VFBGA Package Drawing ...
Страница 1143: ...1143 11100B ATARM 31 Jul 12 SAM4S Series Preliminary Figure 43 4 64 lead LQFP Package Drawing ...
Страница 1145: ...1145 11100B ATARM 31 Jul 12 SAM4S Series Preliminary Figure 43 5 64 lead QFN Package Drawing ...