\r
/* Constants required to set up the initial stack. */\r
#define portINITIAL_XPSR ( 0x01000000 )\r
-#define portINITIAL_EXEC_RETURN ( 0xfffffffd )\r
+#define portINITIAL_EXC_RETURN ( 0xfffffffd )\r
\r
/* The systick is a 24-bit counter. */\r
#define portMAX_24_BIT_NUMBER ( 0xffffffUL )\r
/* A save method is being used that requires each task to maintain its\r
own exec return value. */\r
pxTopOfStack--;\r
- *pxTopOfStack = portINITIAL_EXEC_RETURN;\r
+ *pxTopOfStack = portINITIAL_EXC_RETURN;\r
\r
pxTopOfStack -= 8; /* R11, R10, R9, R8, R7, R6, R5 and R4. */\r
\r
;/* Save the new top of stack into the first member of the TCB. */\r
str r0, [r2]\r
\r
- stmdb sp!, {r3}\r
+ stmdb sp!, {r0, r3}\r
ldr r0, ulMaxSyscallInterruptPriorityConst\r
ldr r1, [r0]\r
msr basepri, r1\r
bl vTaskSwitchContext\r
mov r0, #0\r
msr basepri, r0\r
- ldmia sp!, {r3}\r
+ ldmia sp!, {r0, r3}\r
\r
;/* The first item in pxCurrentTCB is the task top of stack. */\r
ldr r1, [r3]\r
" ldr r3, pxCurrentTCBConst \n" /* Get the location of the current TCB. */\r
" ldr r2, [r3] \n"\r
" \n"\r
- " subs r0, r0, #32 \n" /* Make space for the remaining low registers. */\r
+ " subs r0, r0, #32 \n" /* Make space for the remaining low registers. */\r
" str r0, [r2] \n" /* Save the new top of stack. */\r
" stmia r0!, {r4-r7} \n" /* Store the low registers that are not saved automatically. */\r
" mov r4, r8 \n" /* Store the high registers. */\r
" \n"\r
" ldr r1, [r2] \n"\r
" ldr r0, [r1] \n" /* The first item in pxCurrentTCB is the task top of stack. */\r
- " adds r0, r0, #16 \n" /* Move to the high registers. */\r
+ " adds r0, r0, #16 \n" /* Move to the high registers. */\r
" ldmia r0!, {r4-r7} \n" /* Pop the high registers. */\r
" mov r8, r4 \n"\r
" mov r9, r5 \n"\r
\r
/* Constants required to set up the initial stack. */\r
#define portINITIAL_XPSR ( 0x01000000 )\r
-#define portINITIAL_EXEC_RETURN ( 0xfffffffd )\r
+#define portINITIAL_EXC_RETURN ( 0xfffffffd )\r
\r
/* The systick is a 24-bit counter. */\r
#define portMAX_24_BIT_NUMBER ( 0xffffffUL )\r
/* A save method is being used that requires each task to maintain its\r
own exec return value. */\r
pxTopOfStack--;\r
- *pxTopOfStack = portINITIAL_EXEC_RETURN;\r
+ *pxTopOfStack = portINITIAL_EXC_RETURN;\r
\r
pxTopOfStack -= 8; /* R11, R10, R9, R8, R7, R6, R5 and R4. */\r
\r
" stmdb r0!, {r4-r11, r14} \n" /* Save the core registers. */\r
" str r0, [r2] \n" /* Save the new top of stack into the first member of the TCB. */\r
" \n"\r
- " stmdb sp!, {r3} \n"\r
+ " stmdb sp!, {r0, r3} \n"\r
" mov r0, %0 \n"\r
" msr basepri, r0 \n"\r
" dsb \n"\r
" bl vTaskSwitchContext \n"\r
" mov r0, #0 \n"\r
" msr basepri, r0 \n"\r
- " ldmia sp!, {r3} \n"\r
+ " ldmia sp!, {r0, r3} \n"\r
" \n"\r
" ldr r1, [r3] \n" /* The first item in pxCurrentTCB is the task top of stack. */\r
" ldr r0, [r1] \n"\r
\r
/* Constants required to set up the initial stack. */\r
#define portINITIAL_XPSR ( 0x01000000UL )\r
-#define portINITIAL_EXEC_RETURN ( 0xfffffffdUL )\r
+#define portINITIAL_EXC_RETURN ( 0xfffffffdUL )\r
#define portINITIAL_CONTROL_IF_UNPRIVILEGED ( 0x03 )\r
#define portINITIAL_CONTROL_IF_PRIVILEGED ( 0x02 )\r
\r
/* A save method is being used that requires each task to maintain its\r
own exec return value. */\r
pxTopOfStack--;\r
- *pxTopOfStack = portINITIAL_EXEC_RETURN;\r
+ *pxTopOfStack = portINITIAL_EXC_RETURN;\r
\r
pxTopOfStack -= 9; /* R11, R10, R9, R8, R7, R6, R5 and R4. */\r
\r
" stmdb r0!, {r1, r4-r11, r14} \n" /* Save the remaining registers. */\r
" str r0, [r2] \n" /* Save the new top of stack into the first member of the TCB. */\r
" \n"\r
- " stmdb sp!, {r3} \n"\r
+ " stmdb sp!, {r0, r3} \n"\r
" mov r0, %0 \n"\r
" msr basepri, r0 \n"\r
" dsb \n"\r
" bl vTaskSwitchContext \n"\r
" mov r0, #0 \n"\r
" msr basepri, r0 \n"\r
- " ldmia sp!, {r3} \n"\r
- " \n" /* Restore the context. */\r
+ " ldmia sp!, {r0, r3} \n"\r
+ " \n" /* Restore the context. */\r
" ldr r1, [r3] \n"\r
" ldr r0, [r1] \n" /* The first item in the TCB is the task top of stack. */\r
" add r1, r1, #4 \n" /* Move onto the second item in the TCB... */\r
\r
/* Constants required to set up the initial stack. */\r
#define portINITIAL_XPSR ( 0x01000000 )\r
-#define portINITIAL_EXEC_RETURN ( 0xfffffffd )\r
+#define portINITIAL_EXC_RETURN ( 0xfffffffd )\r
\r
/* The systick is a 24-bit counter. */\r
#define portMAX_24_BIT_NUMBER ( 0xffffffUL )\r
/* A save method is being used that requires each task to maintain its\r
own exec return value. */\r
pxTopOfStack--;\r
- *pxTopOfStack = portINITIAL_EXEC_RETURN;\r
+ *pxTopOfStack = portINITIAL_EXC_RETURN;\r
\r
pxTopOfStack -= 8; /* R11, R10, R9, R8, R7, R6, R5 and R4. */\r
\r
" stmdb r0!, {r4-r11, r14} \n" /* Save the core registers. */\r
" str r0, [r2] \n" /* Save the new top of stack into the first member of the TCB. */\r
" \n"\r
- " stmdb sp!, {r3} \n"\r
+ " stmdb sp!, {r0, r3} \n"\r
" mov r0, %0 \n"\r
" cpsid i \n" /* Errata workaround. */\r
" msr basepri, r0 \n"\r
" bl vTaskSwitchContext \n"\r
" mov r0, #0 \n"\r
" msr basepri, r0 \n"\r
- " ldmia sp!, {r3} \n"\r
+ " ldmia sp!, {r0, r3} \n"\r
" \n"\r
" ldr r1, [r3] \n" /* The first item in pxCurrentTCB is the task top of stack. */\r
" ldr r0, [r1] \n"\r
\r
/* Constants required to set up the initial stack. */\r
#define portINITIAL_XPSR ( 0x01000000 )\r
-#define portINITIAL_EXEC_RETURN ( 0xfffffffd )\r
+#define portINITIAL_EXC_RETURN ( 0xfffffffd )\r
\r
/* The systick is a 24-bit counter. */\r
#define portMAX_24_BIT_NUMBER ( 0xffffffUL )\r
/* A save method is being used that requires each task to maintain its\r
own exec return value. */\r
pxTopOfStack--;\r
- *pxTopOfStack = portINITIAL_EXEC_RETURN;\r
+ *pxTopOfStack = portINITIAL_EXC_RETURN;\r
\r
pxTopOfStack -= 8; /* R11, R10, R9, R8, R7, R6, R5 and R4. */\r
\r
/* Save the new top of stack into the first member of the TCB. */\r
str r0, [r2]\r
\r
- stmdb sp!, {r3}\r
+ stmdb sp!, {r0, r3}\r
mov r0, #configMAX_SYSCALL_INTERRUPT_PRIORITY\r
msr basepri, r0\r
dsb\r
bl vTaskSwitchContext\r
mov r0, #0\r
msr basepri, r0\r
- ldmia sp!, {r3}\r
+ ldmia sp!, {r0, r3}\r
\r
/* The first item in pxCurrentTCB is the task top of stack. */\r
ldr r1, [r3]\r
\r
/* Constants required to set up the initial stack. */\r
#define portINITIAL_XPSR ( 0x01000000 )\r
-#define portINITIAL_EXEC_RETURN ( 0xfffffffd )\r
+#define portINITIAL_EXC_RETURN ( 0xfffffffd )\r
\r
/* The systick is a 24-bit counter. */\r
#define portMAX_24_BIT_NUMBER ( 0xffffffUL )\r
/* A save method is being used that requires each task to maintain its\r
own exec return value. */\r
pxTopOfStack--;\r
- *pxTopOfStack = portINITIAL_EXEC_RETURN;\r
+ *pxTopOfStack = portINITIAL_EXC_RETURN;\r
\r
pxTopOfStack -= 8; /* R11, R10, R9, R8, R7, R6, R5 and R4. */\r
\r
/* Save the new top of stack into the first member of the TCB. */\r
str r0, [r2]\r
\r
- stmdb sp!, {r3}\r
+ stmdb sp!, {r0, r3}\r
mov r0, #configMAX_SYSCALL_INTERRUPT_PRIORITY\r
cpsid i\r
msr basepri, r0\r
bl vTaskSwitchContext\r
mov r0, #0\r
msr basepri, r0\r
- ldmia sp!, {r3}\r
+ ldmia sp!, {r0, r3}\r
\r
/* The first item in pxCurrentTCB is the task top of stack. */\r
ldr r1, [r3]\r
\r
/* Constants required to set up the initial stack. */\r
#define portINITIAL_XPSR ( 0x01000000 )\r
-#define portINITIAL_EXEC_RETURN ( 0xfffffffd )\r
+#define portINITIAL_EXC_RETURN ( 0xfffffffd )\r
\r
/* The systick is a 24-bit counter. */\r
#define portMAX_24_BIT_NUMBER ( 0xffffffUL )\r
/* A save method is being used that requires each task to maintain its\r
own exec return value. */\r
pxTopOfStack--;\r
- *pxTopOfStack = portINITIAL_EXEC_RETURN;\r
+ *pxTopOfStack = portINITIAL_EXC_RETURN;\r
\r
pxTopOfStack -= 8; /* R11, R10, R9, R8, R7, R6, R5 and R4. */\r
\r
\r
str r0, [r2] /* Save the new top of stack into the first member of the TCB. */\r
\r
- stmdb sp!, (r3)\r
+ stmdb sp!, (r0, r3)\r
ldr r0, =_ucMaxSyscallInterruptPriority\r
ldr r1, [r0]\r
msr basepri, r1\r
dsb\r
- isb\r
+ isb\r
bl _vTaskSwitchContext\r
mov r0, #0\r
msr basepri, r0\r
- ldm sp!, (r3)\r
+ ldm sp!, (r0, r3)\r
\r
ldr r1, [r3] /* The first item in pxCurrentTCB is the task top of stack. */\r
ldr r0, [r1]\r
__asm { "cpsid i" };\r
__asm { "dsb" };\r
__asm { "isb" };\r
- \r
- /* Disable the SysTick clock without reading the \r
+\r
+ /* Disable the SysTick clock without reading the\r
portNVIC_SYSTICK_CTRL_REG register to ensure the\r
- portNVIC_SYSTICK_COUNT_FLAG_BIT is not cleared if it is set. Again, \r
- the time the SysTick is stopped for is accounted for as best it can \r
- be, but using the tickless mode will inevitably result in some tiny \r
- drift of the time maintained by the kernel with respect to calendar \r
+ portNVIC_SYSTICK_COUNT_FLAG_BIT is not cleared if it is set. Again,\r
+ the time the SysTick is stopped for is accounted for as best it can\r
+ be, but using the tickless mode will inevitably result in some tiny\r
+ drift of the time maintained by the kernel with respect to calendar\r
time*/\r
portNVIC_SYSTICK_CTRL_REG = ( portNVIC_SYSTICK_CLK_BIT | portNVIC_SYSTICK_INT_BIT );\r
\r
\r
/* Constants required to set up the initial stack. */\r
#define portINITIAL_XPSR ( 0x01000000 )\r
-#define portINITIAL_EXEC_RETURN ( 0xfffffffd )\r
+#define portINITIAL_EXC_RETURN ( 0xfffffffd )\r
\r
/* The systick is a 24-bit counter. */\r
#define portMAX_24_BIT_NUMBER ( 0xffffffUL )\r
/* A save method is being used that requires each task to maintain its\r
own exec return value. */\r
pxTopOfStack--;\r
- *pxTopOfStack = portINITIAL_EXEC_RETURN;\r
+ *pxTopOfStack = portINITIAL_EXC_RETURN;\r
\r
pxTopOfStack -= 8; /* R11, R10, R9, R8, R7, R6, R5 and R4. */\r
\r
/* Save the new top of stack into the first member of the TCB. */\r
str r0, [r2]\r
\r
- stmdb sp!, {r3}\r
+ stmdb sp!, {r0, r3}\r
mov r0, #configMAX_SYSCALL_INTERRUPT_PRIORITY\r
msr basepri, r0\r
dsb\r
bl vTaskSwitchContext\r
mov r0, #0\r
msr basepri, r0\r
- ldmia sp!, {r3}\r
+ ldmia sp!, {r0, r3}\r
\r
/* The first item in pxCurrentTCB is the task top of stack. */\r
ldr r1, [r3]\r
__disable_irq();\r
__dsb( portSY_FULL_READ_WRITE );\r
__isb( portSY_FULL_READ_WRITE );\r
- \r
- /* Disable the SysTick clock without reading the \r
+\r
+ /* Disable the SysTick clock without reading the\r
portNVIC_SYSTICK_CTRL_REG register to ensure the\r
- portNVIC_SYSTICK_COUNT_FLAG_BIT is not cleared if it is set. Again, \r
- the time the SysTick is stopped for is accounted for as best it can \r
- be, but using the tickless mode will inevitably result in some tiny \r
- drift of the time maintained by the kernel with respect to calendar \r
+ portNVIC_SYSTICK_COUNT_FLAG_BIT is not cleared if it is set. Again,\r
+ the time the SysTick is stopped for is accounted for as best it can\r
+ be, but using the tickless mode will inevitably result in some tiny\r
+ drift of the time maintained by the kernel with respect to calendar\r
time*/\r
portNVIC_SYSTICK_CTRL_REG = ( portNVIC_SYSTICK_CLK_BIT | portNVIC_SYSTICK_INT_BIT );\r
\r
\r
/* Constants required to set up the initial stack. */\r
#define portINITIAL_XPSR ( 0x01000000UL )\r
-#define portINITIAL_EXEC_RETURN ( 0xfffffffdUL )\r
+#define portINITIAL_EXC_RETURN ( 0xfffffffdUL )\r
#define portINITIAL_CONTROL_IF_UNPRIVILEGED ( 0x03 )\r
#define portINITIAL_CONTROL_IF_PRIVILEGED ( 0x02 )\r
\r
/* A save method is being used that requires each task to maintain its\r
own exec return value. */\r
pxTopOfStack--;\r
- *pxTopOfStack = portINITIAL_EXEC_RETURN;\r
+ *pxTopOfStack = portINITIAL_EXC_RETURN;\r
\r
pxTopOfStack -= 9; /* R11, R10, R9, R8, R7, R6, R5 and R4. */\r
\r
\r
mrs r0, psp\r
\r
- ldr r3, =pxCurrentTCB /* Get the location of the current TCB. */\r
- ldr r2, [r3]\r
+ ldr r3, =pxCurrentTCB /* Get the location of the current TCB. */\r
+ ldr r2, [r3]\r
\r
tst r14, #0x10 /* Is the task using the FPU context? If so, push high vfp registers. */\r
it eq\r
stmdb r0!, {r1, r4-r11, r14} /* Save the remaining registers. */\r
str r0, [r2] /* Save the new top of stack into the first member of the TCB. */\r
\r
- stmdb sp!, {r3}\r
+ stmdb sp!, {r0, r3}\r
mov r0, #configMAX_SYSCALL_INTERRUPT_PRIORITY\r
msr basepri, r0\r
dsb\r
bl vTaskSwitchContext\r
mov r0, #0\r
msr basepri, r0\r
- ldmia sp!, {r3}\r
+ ldmia sp!, {r0, r3}\r
/* Restore the context. */\r
ldr r1, [r3]\r
ldr r0, [r1] /* The first item in the TCB is the task top of stack. */\r
\r
/* Constants required to set up the initial stack. */\r
#define portINITIAL_XPSR ( 0x01000000 )\r
-#define portINITIAL_EXEC_RETURN ( 0xfffffffd )\r
+#define portINITIAL_EXC_RETURN ( 0xfffffffd )\r
\r
/* The systick is a 24-bit counter. */\r
#define portMAX_24_BIT_NUMBER ( 0xffffffUL )\r
/* A save method is being used that requires each task to maintain its\r
own exec return value. */\r
pxTopOfStack--;\r
- *pxTopOfStack = portINITIAL_EXEC_RETURN;\r
+ *pxTopOfStack = portINITIAL_EXC_RETURN;\r
\r
pxTopOfStack -= 8; /* R11, R10, R9, R8, R7, R6, R5 and R4. */\r
\r
/* Save the new top of stack into the first member of the TCB. */\r
str r0, [r2]\r
\r
- stmdb sp!, {r3}\r
+ stmdb sp!, {r0, r3}\r
mov r0, #configMAX_SYSCALL_INTERRUPT_PRIORITY\r
cpsid i\r
msr basepri, r0\r
bl vTaskSwitchContext\r
mov r0, #0\r
msr basepri, r0\r
- ldmia sp!, {r3}\r
+ ldmia sp!, {r0, r3}\r
\r
/* The first item in pxCurrentTCB is the task top of stack. */\r
ldr r1, [r3]\r
__disable_irq();\r
__dsb( portSY_FULL_READ_WRITE );\r
__isb( portSY_FULL_READ_WRITE );\r
- \r
- /* Disable the SysTick clock without reading the \r
+\r
+ /* Disable the SysTick clock without reading the\r
portNVIC_SYSTICK_CTRL_REG register to ensure the\r
- portNVIC_SYSTICK_COUNT_FLAG_BIT is not cleared if it is set. Again, \r
- the time the SysTick is stopped for is accounted for as best it can \r
- be, but using the tickless mode will inevitably result in some tiny \r
- drift of the time maintained by the kernel with respect to calendar \r
+ portNVIC_SYSTICK_COUNT_FLAG_BIT is not cleared if it is set. Again,\r
+ the time the SysTick is stopped for is accounted for as best it can\r
+ be, but using the tickless mode will inevitably result in some tiny\r
+ drift of the time maintained by the kernel with respect to calendar\r
time*/\r
portNVIC_SYSTICK_CTRL_REG = ( portNVIC_SYSTICK_CLK_BIT | portNVIC_SYSTICK_INT_BIT );\r
\r
\r
/* Constants required to set up the initial stack. */\r
#define portINITIAL_XPSR ( 0x01000000 )\r
-#define portINITIAL_EXEC_RETURN ( 0xfffffffd )\r
+#define portINITIAL_EXC_RETURN ( 0xfffffffd )\r
\r
/* Let the user override the pre-loading of the initial LR with the address of\r
prvTaskExitError() in case it messes up unwinding of the stack in the\r
/* A save method is being used that requires each task to maintain its\r
own exec return value. */\r
pxTopOfStack--;\r
- *pxTopOfStack = portINITIAL_EXEC_RETURN;\r
+ *pxTopOfStack = portINITIAL_EXC_RETURN;\r
\r
pxTopOfStack -= 8; /* R11, R10, R9, R8, R7, R6, R5 and R4. */\r
\r
;Save the new top of stack into the first member of the TCB.\r
str r0, [r2]\r
\r
- stmdb sp!, {r3}\r
+ stmdb sp!, {r0, r3}\r
ldr.w r0, =ulMaxSyscallInterruptPriorityConst\r
ldr r0, [r0]\r
msr basepri, r0\r
bl vTaskSwitchContext\r
mov r0, #0\r
msr basepri, r0\r
- ldmia sp!, {r3}\r
+ ldmia sp!, {r0, r3}\r
\r
;The first item in pxCurrentTCB is the task top of stack.\r
ldr r1, [r3]\r