@ -59,10 +59,13 @@ rtos_interrupt_callback_common:
/* The stack was extended for this by the wrapper function. */
/* Begin only by saving some registers. The rest will be saved */
/* later if vTaskSwitchContext() needs to be called. */
/* DP and CP need to be saved because these are restored for the kernel ISR. */
/* LR needs to be saved because it is clobbered when calling the callback. */
/* r0-r3, and r11 need to be saved because the callback may clobber them. */
/* r4 is saved because it is used here to hold the task SP. */
stw d p , s p [ 5 ]
stw c p , s p [ 6 ]
stw l r , s p [ 7 ]
stw r0 , s p [ 8 ]
/*stw r1, sp[9] already saved by the wrapper function. */
@ -78,7 +81,9 @@ rtos_interrupt_callback_common:
/* that it saves to KSP[0]. We already have it in r4. */
get r11 , e d } / * G e t t h e e v e n t d a t a . . . * /
{ mov r0 , r11 / * i n t o t h e f i r s t a r g u m e n t f o r t h e c a l l b a c k f u n c t i o n . . . * /
ldw d p , s p [ 3 ] / * ( R e s t o r e C P a n d D P r e q u i r e d f o r t h e R T O S I S R * /
ldw c p , s p [ 4 ] / * i n c a s e t h e a c t i v e t h r e a d h a s m o d i f i e d t h e m . ) * /
{ mov r0 , r11 / * . . . i n t o t h e f i r s t a r g u m e n t f o r t h e c a l l b a c k f u n c t i o n , * /
bla r1 } / * a n d c a l l t h e c a l l b a c k f u n c t i o n . * /
{ set s p , r4 / * R e s t o r e t h e t a s k ' s S P n o w . * /
@ -100,8 +105,6 @@ _yield_continue:
stw s s r , s p [ 2 ]
stw s e d , s p [ 3 ]
stw e t , s p [ 4 ]
stw d p , s p [ 5 ]
stw c p , s p [ 6 ]
stw r5 , s p [ 1 3 ]
stw r6 , s p [ 1 4 ]
stw r7 , s p [ 1 5 ]
@ -160,8 +163,6 @@ _freertos_restore_ctx:
ldw s s r , s p [ 2 ]
ldw s e d , s p [ 3 ]
ldw e t , s p [ 4 ]
ldw d p , s p [ 5 ]
ldw c p , s p [ 6 ]
ldw r5 , s p [ 1 3 ]
ldw r6 , s p [ 1 4 ]
ldw r7 , s p [ 1 5 ]
@ -169,6 +170,8 @@ _freertos_restore_ctx:
ldw r9 , s p [ 1 7 ]
ldw r10 , s p [ 1 8 ]
_freertos_restore_ctx_partial :
ldw d p , s p [ 5 ]
ldw c p , s p [ 6 ]
ldw l r , s p [ 7 ]
ldw r0 , s p [ 8 ]
ldw r1 , s p [ 9 ]