CMSIS-Core (Cortex-A)  
CMSIS-Core support for Cortex-A processor-based devices
 
Loading...
Searching...
No Matches
Stack Pointer (SP/R13)

The processor uses SP as a pointer to the active stack. More...

Functions

__STATIC_FORCEINLINE void __set_SP (uint32_t stack)
 Set Stack Pointer.
 
__STATIC_FORCEINLINE void __set_SP_usr (uint32_t topOfProcStack)
 Set USR/SYS Stack Pointer.
 

Description

The processor uses SP as a pointer to the active stack.

The Stack Pointer is banked per processor mode. Accessing the active stack pointer actually returns/modifies the stack pointer of the current processor execution mode.

Mode Actual SP
User/System SP_usr
Hypervisor SP_hyp
Supervisor SP_svc
Abort SP_abt
Undefined SP_und
Monitor SP_mon
IRQ SP_irq
FIQ SP_fiq

Consider __set_SP and __set_SP_usr to access this register.

Function Documentation

◆ __set_SP()

__STATIC_FORCEINLINE void __set_SP ( uint32_t  stack)

Set Stack Pointer.

Parameters
[in]stackStack Pointer value to set

This function assigns the given value to the current stack pointer.

◆ __set_SP_usr()

__STATIC_FORCEINLINE void __set_SP_usr ( uint32_t  topOfProcStack)

Set USR/SYS Stack Pointer.

Parameters
[in]topOfProcStackUSR/SYS Stack Pointer value to set

This function assigns the given value to the User/System Stack Pointer (SP_usr).