Skip to content

Commit fd40352

Browse files
committed
Add rxv1, v2, v3 port: removed system state macro, added missing interrupt control defines, and added missing thread preemption logic.
1 parent f7f0957 commit fd40352

File tree

90 files changed

+600
-165
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

90 files changed

+600
-165
lines changed

ports/rxv1/ccrx/inc/tx_port.h

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
/* PORT SPECIFIC C INFORMATION RELEASE */
2727
/* */
2828
/* tx_port.h RXv1/CCRX */
29-
/* 6.1.9 */
29+
/* 6.1.10 */
3030
/* */
3131
/* AUTHOR */
3232
/* */
@@ -50,6 +50,11 @@
5050
/* 08-02-2021 William E. Lamie Initial Version 6.1.8 */
5151
/* 10-15-2021 William E. Lamie Modified comment(s), */
5252
/* resulting in version 6.1.9 */
53+
/* 01-31-2022 William E. Lamie Modified comment(s), removed */
54+
/* system state macro, and */
55+
/* added missing interrupt */
56+
/* control defines, */
57+
/* resulting in version 6.1.10 */
5358
/* */
5459
/**************************************************************************/
5560

@@ -80,6 +85,12 @@ typedef short SHORT;
8085
typedef unsigned short USHORT;
8186

8287

88+
/* Define interrupt control options. */
89+
90+
#define TX_INT_DISABLE 0x00000000
91+
#define TX_INT_ENABLE 0x00010000
92+
93+
8394
/* Define the priority levels for ThreadX. Legal values range
8495
from 32 to 1024 and MUST be evenly divisible by 32. */
8596

@@ -246,19 +257,6 @@ static void _tx_thread_system_return_inline(void)
246257
}
247258

248259

249-
#ifndef TX_THREAD_GET_SYSTEM_STATE
250-
251-
#pragma inline_asm _get_psw
252-
static UINT _get_psw(void){
253-
MVFC PSW,R1 ;
254-
}
255-
256-
extern volatile ULONG _tx_thread_system_state;
257-
#define TX_THREAD_GET_SYSTEM_STATE() (_tx_thread_system_state | ((~_get_psw()) & (1u << 17u)))
258-
#endif
259-
260-
261-
262260
/* Define the interrupt lockout macros for each ThreadX object. */
263261

264262
#define TX_BLOCK_POOL_DISABLE TX_DISABLE
@@ -273,7 +271,7 @@ extern volatile ULONG _tx_thread_system_state;
273271

274272
#ifdef TX_THREAD_INIT
275273
CHAR _tx_version_id[] =
276-
"Copyright (c) Microsoft Corporation. All rights reserved. * ThreadX RXv1/CCRX Version 6.1.9 *";
274+
"Copyright (c) Microsoft Corporation. All rights reserved. * ThreadX RXv1/CCRX Version 6.1.10 *";
277275
#else
278276
extern CHAR _tx_version_id[];
279277
#endif

ports/rxv1/ccrx/readme_threadx.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,11 @@ For generic code revision information, please refer to the readme_threadx_generi
150150
file, which is included in your distribution. The following details the revision
151151
information associated with this specific port of ThreadX:
152152

153+
01-31-2022 Release 6.1.10 changes:
154+
tx_port.h Removed system state macro, and added
155+
missing interrupt control defines
156+
tx_timer_interrupt.src Added missing thread preemption logic
157+
153158
10-15-2021 Release 6.1.9 changes:
154159
tx_thread_context_restore.src Removed unnecessary stack type placement
155160
tx_thread_schedule.src Removed unnecessary stack type checking
@@ -158,7 +163,7 @@ information associated with this specific port of ThreadX:
158163
08-02-2021 Initial ThreadX release for the RXv1 using CC-RXX tools, version 6.1.8
159164

160165

161-
Copyright(c) 1996-2021 Microsoft Corporation
166+
Copyright(c) 1996-2022 Microsoft Corporation
162167

163168

164169
https://azure.com/rtos

ports/rxv1/ccrx/src/tx_initialize_low_level.src

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
;/* FUNCTION RELEASE */
3535
;/* */
3636
;/* _tx_initialize_low_level RXv1/CCRX */
37-
;/* 6.1.9 */
37+
;/* 6.1.10 */
3838
;/* AUTHOR */
3939
;/* */
4040
;/* William E. Lamie, Microsoft Corporation */
@@ -70,6 +70,8 @@
7070
;/* 08-02-2021 William E. Lamie Initial Version 6.1.8 */
7171
;/* 10-15-2021 William E. Lamie Modified comment(s), */
7272
;/* resulting in version 6.1.9 */
73+
;/* 01-31-2022 William E. Lamie Modified comment(s), */
74+
;/* resulting in version 6.1.10 */
7375
;/* */
7476
;/**************************************************************************/
7577

ports/rxv1/ccrx/src/tx_thread_context_restore.src

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
;/* FUNCTION RELEASE */
4646
;/* */
4747
;/* _tx_thread_context_restore RXv1/CCRX */
48-
;/* 6.1.9 */
48+
;/* 6.1.10 */
4949
;/* AUTHOR */
5050
;/* */
5151
;/* William E. Lamie, Microsoft Corporation */
@@ -82,6 +82,8 @@
8282
;/* removed unnecessary stack */
8383
;/* type placement, */
8484
;/* resulting in version 6.1.9 */
85+
;/* 01-31-2022 William E. Lamie Modified comment(s), */
86+
;/* resulting in version 6.1.10 */
8587
;/* */
8688
;/**************************************************************************/
8789
;VOID _tx_thread_context_restore(VOID)

ports/rxv1/ccrx/src/tx_thread_context_save.src

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
;/* FUNCTION RELEASE */
4141
;/* */
4242
;/* _tx_thread_context_save RXv1/CCRX */
43-
;/* 6.1.9 */
43+
;/* 6.1.10 */
4444
;/* AUTHOR */
4545
;/* */
4646
;/* William E. Lamie, Microsoft Corporation */
@@ -74,6 +74,8 @@
7474
;/* 08-02-2021 William E. Lamie Initial Version 6.1.8 */
7575
;/* 10-15-2021 William E. Lamie Modified comment(s), */
7676
;/* resulting in version 6.1.9 */
77+
;/* 01-31-2022 William E. Lamie Modified comment(s), */
78+
;/* resulting in version 6.1.10 */
7779
;/* */
7880
;/**************************************************************************/
7981
;VOID _tx_thread_context_save(VOID)

ports/rxv1/ccrx/src/tx_thread_interrupt_control.src

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
;/* FUNCTION RELEASE */
3636
;/* */
3737
;/* _tx_thread_interrupt_control RXv1/CCRX */
38-
;/* 6.1.9 */
38+
;/* 6.1.10 */
3939
;/* AUTHOR */
4040
;/* */
4141
;/* William E. Lamie, Microsoft Corporation */
@@ -68,6 +68,8 @@
6868
;/* 08-02-2021 William E. Lamie Initial Version 6.1.8 */
6969
;/* 10-15-2021 William E. Lamie Modified comment(s), */
7070
;/* resulting in version 6.1.9 */
71+
;/* 01-31-2022 William E. Lamie Modified comment(s), */
72+
;/* resulting in version 6.1.10 */
7173
;/* */
7274
;/**************************************************************************/
7375
;UINT _tx_thread_interrupt_control(UINT new_posture)

ports/rxv1/ccrx/src/tx_thread_schedule.src

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
;/* FUNCTION RELEASE */
4343
;/* */
4444
;/* _tx_thread_schedule RXv1/CCRX */
45-
;/* 6.1.9 */
45+
;/* 6.1.10 */
4646
;/* AUTHOR */
4747
;/* */
4848
;/* William E. Lamie, Microsoft Corporation */
@@ -80,6 +80,8 @@
8080
;/* removed unnecessary stack */
8181
;/* type checking, */
8282
;/* resulting in version 6.1.9 */
83+
;/* 01-31-2022 William E. Lamie Modified comment(s), */
84+
;/* resulting in version 6.1.10 */
8385
;/* */
8486
;/**************************************************************************/
8587
;VOID _tx_thread_schedule(VOID)

ports/rxv1/ccrx/src/tx_thread_stack_build.src

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
;/* FUNCTION RELEASE */
3737
;/* */
3838
;/* _tx_thread_stack_build RXv1/CCRX */
39-
;/* 6.1.9 */
39+
;/* 6.1.10 */
4040
;/* AUTHOR */
4141
;/* */
4242
;/* William E. Lamie, Microsoft Corporation */
@@ -73,6 +73,8 @@
7373
;/* removed unnecessary stack */
7474
;/* type placement, */
7575
;/* resulting in version 6.1.9 */
76+
;/* 01-31-2022 William E. Lamie Modified comment(s), */
77+
;/* resulting in version 6.1.10 */
7678
;/* */
7779
;/**************************************************************************/
7880
;VOID _tx_thread_stack_build(TX_THREAD *thread_ptr, VOID (*function_ptr)(VOID))

ports/rxv1/ccrx/src/tx_thread_system_return.src

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
;/* FUNCTION RELEASE */
4141
;/* */
4242
;/* _tx_thread_system_return RXv1/CCRX */
43-
;/* 6.1.9 */
43+
;/* 6.1.10 */
4444
;/* AUTHOR */
4545
;/* */
4646
;/* William E. Lamie, Microsoft Corporation */
@@ -76,6 +76,8 @@
7676
;/* 10-15-2021 William E. Lamie Modified comment(s), and */
7777
;/* removed unused code, */
7878
;/* resulting in version 6.1.9 */
79+
;/* 01-31-2022 William E. Lamie Modified comment(s), */
80+
;/* resulting in version 6.1.10 */
7981
;/* */
8082
;/**************************************************************************/
8183
;VOID _tx_thread_system_return(VOID)

ports/rxv1/ccrx/src/tx_timer_interrupt.src

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@
3232
;
3333
;Define Assembly language external references...
3434
;
35+
36+
SWI0 .EQU 872E0H
37+
3538
.GLB __tx_timer_time_slice
3639
.GLB __tx_timer_system_clock
3740
.GLB __tx_timer_current_ptr
@@ -43,14 +46,17 @@
4346
.GLB __tx_thread_context_save
4447
.GLB __tx_thread_time_slice
4548
.GLB __tx_thread_context_restore
49+
.GLB __tx_thread_preempt_disable
50+
.GLB __tx_thread_execute_ptr
51+
.GLB __tx_thread_current_ptr
4652
;
4753
.SECTION P,CODE
4854
;/**************************************************************************/
4955
;/* */
5056
;/* FUNCTION RELEASE */
5157
;/* */
5258
;/* _tx_timer_interrupt RXv1/CCRX */
53-
;/* 6.1.9 */
59+
;/* 6.1.10 */
5460
;/* AUTHOR */
5561
;/* */
5662
;/* William E. Lamie, Microsoft Corporation */
@@ -89,6 +95,10 @@
8995
;/* 08-02-2021 William E. Lamie Initial Version 6.1.8 */
9096
;/* 10-15-2021 William E. Lamie Modified comment(s), */
9197
;/* 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 */
92102
;/* */
93103
;/**************************************************************************/
94104
;VOID _tx_timer_interrupt(VOID)
@@ -236,6 +246,23 @@ __tx_timer_dont_activate:
236246
; _tx_thread_time_slice();
237247

238248
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+
239266
; }
240267
;
241268
__tx_timer_not_ts_expiration:

0 commit comments

Comments
 (0)