unified/arm: fix missing setting of default _Swap() return value

The unified kernel expect the default return value from a _Swap() call
to be set to -EAGAIN by the architecture code. Cortex-M3/M4 does this in
the SVC call handler, and it was missing from the Cortex-M0/M0+ before
pending PendSV.

Change-Id: I3316901186ab409f49043eb4f1972c4b0dd9a4a2
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
This commit is contained in:
Benjamin Walsh 2016-11-04 12:02:50 -04:00 committed by Anas Nashif
commit 1bfa7e3d93

View file

@ -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