arch: arm: cortex-m: move PSPLIM clearing in the relevant function
We do not need to have the PSPLIM clearing directly inside the PendSV handler and outside the function that configures it, configure_builtin_stack_guard(), since the latter is also invoked inside the PendSV handler. This commit moves the PSPLIM clearing inside configure_builtin_stack_guard(). The patch is not introducing any behavioral change on the stack limit checking mechanism for Cortex-M. Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
This commit is contained in:
parent
36e80673f9
commit
16ce4b6953
2 changed files with 1 additions and 6 deletions
|
@ -322,12 +322,6 @@ _thread_irq_disabled:
|
||||||
#error Unknown ARM architecture
|
#error Unknown ARM architecture
|
||||||
#endif /* CONFIG_ARMV6_M_ARMV8_M_BASELINE */
|
#endif /* CONFIG_ARMV6_M_ARMV8_M_BASELINE */
|
||||||
|
|
||||||
#ifdef CONFIG_BUILTIN_STACK_GUARD
|
|
||||||
/* clear stack pointer limit before setting the PSP */
|
|
||||||
mov r0, #0
|
|
||||||
msr PSPLIM, r0
|
|
||||||
#endif /* CONFIG_BUILTIN_STACK_GUARD */
|
|
||||||
|
|
||||||
#if defined(CONFIG_CPU_CORTEX_M)
|
#if defined(CONFIG_CPU_CORTEX_M)
|
||||||
msr PSP, ip
|
msr PSP, ip
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -205,6 +205,7 @@ void configure_builtin_stack_guard(struct k_thread *thread)
|
||||||
* User threads executing in user mode do not require a stack
|
* User threads executing in user mode do not require a stack
|
||||||
* limit protection.
|
* limit protection.
|
||||||
*/
|
*/
|
||||||
|
__set_PSPLIM(0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
u32_t guard_start = thread->arch.priv_stack_start ?
|
u32_t guard_start = thread->arch.priv_stack_start ?
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue