3.2.5. Stack Pointer selection

Stack Pointer behavior depends on the Execution state, as follows:

AArch64

In EL0, the Stack Pointer (SP) maps to the SP_EL0 Stack Pointer register.

Taking an exception selects the default Stack Pointer for the target Exception level, meaning SP maps to the SP_ELx Stack Pointer register, where x is the Exception level.

Software executing in the target Exception level can execute an MSR SPSel, #Imm1 instruction to select whether to use the default SP_ELx Stack Pointer or the SP_EL0 Stack Pointer.

The selected Stack Pointer can be indicated by a suffix to the Exception level:

t

Indicates use of the SP0 Stack Pointer.

h

Indicates use of the SPx Stack Pointer.

Note

The t and h suffixes are based on the terminology of thread and handler, introduced in ARMv7-M.

Table 3.1 shows the set of AArch64 Stack Pointer options.

Table 3.1. AArch64 Stack Pointer options

Exception levelAArch64 Stack Pointer options
EL0EL0t
EL1EL1t, EL1h
EL2EL2t, EL2h
EL3EL3t, EL3h

AArch32

In AArch32 state, each mode that can be the target of an exception has its own Banked copy of the Stack Pointer. For example, the Banked Stack Pointer for Hyp mode is called SP_hyp. Software executing in one of these modes uses the Banked Stack Pointer for that mode.

The modes that have Banked copies of the Stack Pointer are FIQ mode, IRQ mode, Supervisor mode, Abort mode, Undefined mode, Hyp mode, and Monitor mode. Software executing in User mode or System mode uses the User mode Stack Pointer, SP_usr.

For more information, see AArch32 execution modes.

Copyright © 2013, 2014 ARM. All rights reserved.ARM DDI 0488D
Non-ConfidentialID012914