mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-06-07 04:49:04 -04:00
Add in the critical nesting save and restore.
This commit is contained in:
parent
9269733ed0
commit
7c183b2f1c
|
@ -45,6 +45,7 @@ EXTERN SIG_UART_DATA
|
||||||
EXTERN vTaskSwitchContext
|
EXTERN vTaskSwitchContext
|
||||||
EXTERN pxCurrentTCB
|
EXTERN pxCurrentTCB
|
||||||
EXTERN vTaskIncrementTick
|
EXTERN vTaskIncrementTick
|
||||||
|
EXTERN uxCriticalNesting
|
||||||
|
|
||||||
; Functions implemented in this file
|
; Functions implemented in this file
|
||||||
; ----------------------------------
|
; ----------------------------------
|
||||||
|
@ -140,6 +141,8 @@ portSAVE_CONTEXT MACRO
|
||||||
st -y, r27
|
st -y, r27
|
||||||
st -y, r30
|
st -y, r30
|
||||||
st -y, r31
|
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 r26, pxCurrentTCB ; Finally save the software stack pointer (Y ...
|
||||||
lds r27, pxCurrentTCB + 1 ; ... register) into the TCB.
|
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 r28, x+ ; the TCB into the software stack pointer (...
|
||||||
ld r29, x+ ; ... the Y register).
|
ld r29, x+ ; ... the Y register).
|
||||||
|
|
||||||
|
ld r0, y+
|
||||||
|
sts uxCriticalNesting, r0
|
||||||
ld r31, y+ ; Restore the registers down to R0. The Y
|
ld r31, y+ ; Restore the registers down to R0. The Y
|
||||||
ld r30, y+ ; register is missing from this list as it
|
ld r30, y+ ; register is missing from this list as it
|
||||||
ld r27, y+ ; has already been restored.
|
ld r27, y+ ; has already been restored.
|
||||||
|
|
Loading…
Reference in a new issue