|
|
|
@ -134,7 +134,7 @@ task.h is included from an application file. */
|
|
|
|
|
|
|
|
|
|
/* Constants required to set up the initial stack. */
|
|
|
|
|
#define portINITIAL_XPSR ( 0x01000000UL )
|
|
|
|
|
#define portINITIAL_EXEC_RETURN ( 0xfffffffdUL )
|
|
|
|
|
#define portINITIAL_EXC_RETURN ( 0xfffffffdUL )
|
|
|
|
|
#define portINITIAL_CONTROL_IF_UNPRIVILEGED ( 0x03 )
|
|
|
|
|
#define portINITIAL_CONTROL_IF_PRIVILEGED ( 0x02 )
|
|
|
|
|
|
|
|
|
@ -243,7 +243,7 @@ StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, TaskFunction_t px
|
|
|
|
|
/* A save method is being used that requires each task to maintain its
|
|
|
|
|
own exec return value. */
|
|
|
|
|
pxTopOfStack--;
|
|
|
|
|
*pxTopOfStack = portINITIAL_EXEC_RETURN;
|
|
|
|
|
*pxTopOfStack = portINITIAL_EXC_RETURN;
|
|
|
|
|
|
|
|
|
|
pxTopOfStack -= 9; /* R11, R10, R9, R8, R7, R6, R5 and R4. */
|
|
|
|
|
|
|
|
|
@ -514,7 +514,7 @@ void xPortPendSVHandler( void )
|
|
|
|
|
" stmdb r0!, {r1, r4-r11, r14} \n" /* Save the remaining registers. */
|
|
|
|
|
" str r0, [r2] \n" /* Save the new top of stack into the first member of the TCB. */
|
|
|
|
|
" \n"
|
|
|
|
|
" stmdb sp!, {r3} \n"
|
|
|
|
|
" stmdb sp!, {r0, r3} \n"
|
|
|
|
|
" mov r0, %0 \n"
|
|
|
|
|
" msr basepri, r0 \n"
|
|
|
|
|
" dsb \n"
|
|
|
|
@ -522,7 +522,7 @@ void xPortPendSVHandler( void )
|
|
|
|
|
" bl vTaskSwitchContext \n"
|
|
|
|
|
" mov r0, #0 \n"
|
|
|
|
|
" msr basepri, r0 \n"
|
|
|
|
|
" ldmia sp!, {r3} \n"
|
|
|
|
|
" ldmia sp!, {r0, r3} \n"
|
|
|
|
|
" \n" /* Restore the context. */
|
|
|
|
|
" ldr r1, [r3] \n"
|
|
|
|
|
" ldr r0, [r1] \n" /* The first item in the TCB is the task top of stack. */
|
|
|
|
|