Thursday, April 30, 2020

ARM Coretex A9 Tutorial | Core Register Access

Stack Pointer (SP/R13)
The processor uses SP as a pointer to the active stack. More...

Functions

__STATIC_INLINE __ASM void __set_SP (uint32_t stack)
 Set Stack Pointer. More...
 
__STATIC_INLINE __ASM void __set_SP_usr (uint32_t topOfProcStack)
 Set USR/SYS Stack Pointer. More...
 

Description

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.
ModeActual SP
User/SystemSP_usr
HypervisorSP_hyp
SupervisorSP_svc
AbortSP_abt
UndefinedSP_und
MonitorSP_mon
IRQSP_irq
FIQSP_fiq
Consider __set_SP and __set_SP_usr to access this register.

Function Documentation

__STATIC_INLINE __ASM void __set_SP(uint32_t stack)
Parameters
[in]stackStack Pointer value to set
This function assigns the given value to the current stack pointer.
__STATIC_INLINE __ASM void __set_SP_usr(uint32_t topOfProcStack)
Parameters
[in]topOfProcStackUSR/SYS Stack Pointer value to set
This function assigns the given value to the User/System Stack Pointer (SP_usr).

Example:
To set value for Stack Pointer Register:
uint32_t maskValue = 0x0001;

__set_SP(maskValue);








No comments:

Post a Comment

Back to Top