diff options
Diffstat (limited to 'ports/rxv1/ccrx/src/tx_thread_context_save.src')
| -rw-r--r-- | ports/rxv1/ccrx/src/tx_thread_context_save.src | 53 |
1 files changed, 27 insertions, 26 deletions
diff --git a/ports/rxv1/ccrx/src/tx_thread_context_save.src b/ports/rxv1/ccrx/src/tx_thread_context_save.src index 8d84f9a1..9bb04a0e 100644 --- a/ports/rxv1/ccrx/src/tx_thread_context_save.src +++ b/ports/rxv1/ccrx/src/tx_thread_context_save.src @@ -40,7 +40,7 @@ ;/* FUNCTION RELEASE */ ;/* */ ;/* _tx_thread_context_save RXv1/CCRX */ -;/* 6.1.8 */ +;/* 6.1.9 */ ;/* AUTHOR */ ;/* */ ;/* William E. Lamie, Microsoft Corporation */ @@ -72,6 +72,8 @@ ;/* DATE NAME DESCRIPTION */ ;/* */ ;/* 08-02-2021 William E. Lamie Initial Version 6.1.8 */ +;/* 10-15-2021 William E. Lamie Modified comment(s), */ +;/* resulting in version 6.1.9 */ ;/* */ ;/**************************************************************************/ ;VOID _tx_thread_context_save(VOID) @@ -93,23 +95,23 @@ __tx_thread_context_save: ; { ; - MOV.L #__tx_thread_system_state, R1 ; pick up address of system state - MOV.L [R1], R2 ; pick up system state - CMP #0, R2 ; 0 -> no nesting + MOV.L #__tx_thread_system_state, R1 ; Pick up address of system state + MOV.L [R1], R2 ; Pick up system state + CMP #0, R2 ; 0 -> no nesting BEQ __tx_thread_not_nested_save ; ; /* Nested interrupt condition. */ ; - ADD #1, r2 ; _tx_thread_system_state++ + ADD #1, r2 ; _tx_thread_system_state++ MOV.L r2, [r1] ; ; /* Save the rest of the scratch registers on the interrupt stack and return to the ; calling ISR. */ - POP R1 ; recuperate return address from stack + POP R1 ; Recuperate return address from stack PUSHM R3-R5 PUSHM R14-R15 - JMP R1 ; return address was preserved in R1 + JMP R1 ; Return address was preserved in R1 ; __tx_thread_not_nested_save: @@ -119,7 +121,7 @@ __tx_thread_not_nested_save: ; else if (_tx_thread_current_ptr) ; { ; - ADD #1, R2 ; _tx_thread_system_state++ + ADD #1, R2 ; _tx_thread_system_state++ MOV.L R2, [R1] MOV.L #__tx_thread_current_ptr, R2 ; Pickup current thread pointer @@ -130,25 +132,25 @@ __tx_thread_not_nested_save: ; /* Move stack frame over to the current threads stack. */ ; /* complete stack frame with registers not saved yet (R3-R5, R14-R15) */ ; - MVFC USP, R1 ; pick up user stack pointer + MVFC USP, R1 ; Pick up user stack pointer MOV.L 16[R0], R2 - MOV.L R2, [-R1] ; save PSW on thread stack + MOV.L R2, [-R1] ; Save PSW on thread stack MOV.L 12[R0], R2 - MOV.L R2, [-R1] ; save PC on thread stack + MOV.L R2, [-R1] ; Save PC on thread stack MOV.L 8[R0], R2 - MOV.L R2, [-R1] ; save R2 on thread stack + MOV.L R2, [-R1] ; Save R2 on thread stack MOV.L 4[R0], R2 - MOV.L R2, [-R1] ; save R1 on thread stack - MOV.L R5, [-R1] ; save R5 on thread stack - MOV.L R4, [-R1] ; save R4 on thread stack - MOV.L R3, [-R1] ; save R3 on thread stack - MOV.L R15, [-R1] ; save R15 on thread stack - MOV.L R14, [-R1] ; save R14 on thread stack + MOV.L R2, [-R1] ; Save R1 on thread stack + MOV.L R5, [-R1] ; Save R5 on thread stack + MOV.L R4, [-R1] ; Save R4 on thread stack + MOV.L R3, [-R1] ; Save R3 on thread stack + MOV.L R15, [-R1] ; Save R15 on thread stack + MOV.L R14, [-R1] ; Save R14 on thread stack - POP R2 ; pick up return address from interrupt stack - ADD #16, R0, R0 ; correct interrupt stack pointer back to the bottom - MVTC R1, USP ; set user/thread stack pointer - JMP R2 ; return to ISR + POP R2 ; Pick up return address from interrupt stack + ADD #16, R0, R0 ; Correct interrupt stack pointer back to the bottom + MVTC R1, USP ; Set user/thread stack pointer + JMP R2 ; Return to ISR ; } ; else @@ -158,11 +160,10 @@ __tx_thread_idle_system_save: ; ; /* Interrupt occurred in the scheduling loop. */ ; - POP R1 ; pick up return address - ADD #16, R0, R0 ; correct interrupt stack pointer back to the bottom (PC), don't care about saved registers - JMP R1 ; return to caller + POP R1 ; Pick up return address + ADD #16, R0, R0 ; Correct interrupt stack pointer back to the bottom (PC), don't care about saved registers + JMP R1 ; Return to caller ; ; } ;} .END - |
