diff --git a/arch/arm/core/swap.S b/arch/arm/core/swap.S index 28e9e5efa98..be148f9de8c 100644 --- a/arch/arm/core/swap.S +++ b/arch/arm/core/swap.S @@ -352,6 +352,12 @@ SECTION_FUNC(TEXT, _Swap) ldr r2, =_SCS_ICSR_PENDSV str r2, [r1, #0] +#ifdef CONFIG_KERNEL_V2 + /* load -EAGAIN as the default return value */ + ldr r0, =_k_neg_eagain + ldr r0, [r0] +#endif + /* Unlock interrupts to allow PendSV, since it's running at prio 0xff * * PendSV handler will be called if there are no other interrupts