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:
Ioannis Glaropoulos 2020-02-12 20:39:40 +01:00 committed by Andrew Boie
commit 16ce4b6953
2 changed files with 1 additions and 6 deletions

View file

@ -322,12 +322,6 @@ _thread_irq_disabled:
#error Unknown ARM architecture
#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)
msr PSP, ip
#endif

View file

@ -205,6 +205,7 @@ void configure_builtin_stack_guard(struct k_thread *thread)
* User threads executing in user mode do not require a stack
* limit protection.
*/
__set_PSPLIM(0);
return;
}
u32_t guard_start = thread->arch.priv_stack_start ?