Add in the critical nesting save and restore.

This commit is contained in:
Richard Barry 2006-08-28 10:19:21 +00:00
parent 9269733ed0
commit 7c183b2f1c

View File

@ -45,6 +45,7 @@ EXTERN SIG_UART_DATA
EXTERN vTaskSwitchContext
EXTERN pxCurrentTCB
EXTERN vTaskIncrementTick
EXTERN uxCriticalNesting
; Functions implemented in this file
; ----------------------------------
@ -140,6 +141,8 @@ portSAVE_CONTEXT MACRO
st -y, r27
st -y, r30
st -y, r31
lds r0, uxCriticalNesting
st -y, r0 ; Store the critical nesting counter.
lds r26, pxCurrentTCB ; Finally save the software stack pointer (Y ...
lds r27, pxCurrentTCB + 1 ; ... register) into the TCB.
@ -155,6 +158,8 @@ portRESTORE_CONTEXT MACRO
ld r28, x+ ; the TCB into the software stack pointer (...
ld r29, x+ ; ... the Y register).
ld r0, y+
sts uxCriticalNesting, r0
ld r31, y+ ; Restore the registers down to R0. The Y
ld r30, y+ ; register is missing from this list as it
ld r27, y+ ; has already been restored.