diff --git a/arch/arm/core/aarch32/cortex_a_r/exc_exit.S b/arch/arm/core/aarch32/cortex_a_r/exc_exit.S index a4e864341fb..438f763be95 100644 --- a/arch/arm/core/aarch32/cortex_a_r/exc_exit.S +++ b/arch/arm/core/aarch32/cortex_a_r/exc_exit.S @@ -86,6 +86,10 @@ system_thread_exit\@: */ SECTION_SUBSEC_FUNC(TEXT, _HandlerModeExit, z_arm_int_exit) +#ifdef CONFIG_STACK_SENTINEL + bl z_check_stack_sentinel +#endif /* CONFIG_STACK_SENTINEL */ + #ifdef CONFIG_PREEMPT_ENABLED /* Do not context switch if exiting a nested interrupt */ ldr r3, =_kernel @@ -100,10 +104,6 @@ SECTION_SUBSEC_FUNC(TEXT, _HandlerModeExit, z_arm_int_exit) __EXIT_INT: #endif /* CONFIG_PREEMPT_ENABLED */ -#ifdef CONFIG_STACK_SENTINEL - bl z_check_stack_sentinel -#endif /* CONFIG_STACK_SENTINEL */ - /* Disable nested interrupts while exiting */ cpsid i