- /* Save the LR and SPSR onto the system mode stack before switching to\r
- system mode to save the remaining system mode registers. */\r
- SRSDB sp!, #SYS_MODE\r
- CPS #SYS_MODE\r
- PUSH {R0-R12, R14}\r
-\r
- /* Push the critical nesting count. */\r
- LDR R2, =ulCriticalNesting\r
- LDR R1, [R2]\r
- PUSH {R1}\r
-\r
- /* Does the task have a floating point context that needs saving? If\r
- ulPortTaskHasFPUContext is 0 then no. */\r
- LDR R2, =ulPortTaskHasFPUContext\r
- LDR R3, [R2]\r
- CMP R3, #0\r
-\r
- /* Save the floating point context, if any. */\r
- FMRXNE R1, FPSCR\r
- VPUSHNE {D0-D15}\r
- VPUSHNE {D16-D31}\r
- PUSHNE {R1}\r
-\r
- /* Save ulPortTaskHasFPUContext itself. */\r
- PUSH {R3}\r
-\r
- /* Save the stack pointer in the TCB. */\r
- LDR R0, =pxCurrentTCB\r
- LDR R1, [R0]\r
- STR SP, [R1]\r
-\r
- LDR R0, =vTaskSwitchContext\r