|
32 | 32 | ;
|
33 | 33 | ;Define Assembly language external references...
|
34 | 34 | ;
|
| 35 | + |
| 36 | + SWI0 .EQU 872E0H |
| 37 | + |
35 | 38 | .GLB __tx_timer_time_slice
|
36 | 39 | .GLB __tx_timer_system_clock
|
37 | 40 | .GLB __tx_timer_current_ptr
|
|
43 | 46 | .GLB __tx_thread_context_save
|
44 | 47 | .GLB __tx_thread_time_slice
|
45 | 48 | .GLB __tx_thread_context_restore
|
| 49 | + .GLB __tx_thread_preempt_disable |
| 50 | + .GLB __tx_thread_execute_ptr |
| 51 | + .GLB __tx_thread_current_ptr |
46 | 52 | ;
|
47 | 53 | .SECTION P,CODE
|
48 | 54 | ;/**************************************************************************/
|
49 | 55 | ;/* */
|
50 | 56 | ;/* FUNCTION RELEASE */
|
51 | 57 | ;/* */
|
52 | 58 | ;/* _tx_timer_interrupt RXv1/CCRX */
|
53 |
| -;/* 6.1.9 */ |
| 59 | +;/* 6.1.10 */ |
54 | 60 | ;/* AUTHOR */
|
55 | 61 | ;/* */
|
56 | 62 | ;/* William E. Lamie, Microsoft Corporation */
|
|
89 | 95 | ;/* 08-02-2021 William E. Lamie Initial Version 6.1.8 */
|
90 | 96 | ;/* 10-15-2021 William E. Lamie Modified comment(s), */
|
91 | 97 | ;/* resulting in version 6.1.9 */
|
| 98 | +;/* 01-31-2022 William E. Lamie Modified comment(s), and */ |
| 99 | +;/* added missing thread */ |
| 100 | +;/* preemption logic, */ |
| 101 | +;/* resulting in version 6.1.10 */ |
92 | 102 | ;/* */
|
93 | 103 | ;/**************************************************************************/
|
94 | 104 | ;VOID _tx_timer_interrupt(VOID)
|
@@ -236,6 +246,23 @@ __tx_timer_dont_activate:
|
236 | 246 | ; _tx_thread_time_slice();
|
237 | 247 |
|
238 | 248 | BSR __tx_thread_time_slice ; Call time-slice processing
|
| 249 | + |
| 250 | +; /* Check if we must trigger a context switch. */ |
| 251 | + MOV.L #__tx_thread_preempt_disable, R1 ; Load prempt disable flag. |
| 252 | + MOV.L [R1], R1 |
| 253 | + CMP #0, R1 |
| 254 | + BNE __tx_timer_not_ts_expiration ; Skip if prempt disabled. |
| 255 | + |
| 256 | + MOV.L #__tx_thread_execute_ptr, R1 |
| 257 | + MOV.L [R1], R1 |
| 258 | + MOV.L #__tx_thread_current_ptr, R2 |
| 259 | + MOV.L [R2], R2 |
| 260 | + CMP R1, R2 |
| 261 | + BEQ __tx_timer_not_ts_expiration |
| 262 | + |
| 263 | + MOV.L #SWI0, R1 |
| 264 | + MOV.L #1, [R1] |
| 265 | + |
239 | 266 | ; }
|
240 | 267 | ;
|
241 | 268 | __tx_timer_not_ts_expiration:
|
|
0 commit comments