Add rxv1, v2, v3 port: removed system state macro, added missing interrupt control defines, and added missing thread preemption logic.

This commit is contained in:
Yuxin Zhou
2022-02-01 23:21:49 -08:00
parent f7f0957188
commit fd403521e9
90 changed files with 600 additions and 165 deletions

View File

@@ -31,7 +31,7 @@
;/* FUNCTION RELEASE */
;/* */
;/* _tx_initialize_low_level RXv3/IAR */
;/* 6.1.9 */
;/* 6.1.10 */
;/* AUTHOR */
;/* */
;/* William E. Lamie, Microsoft Corporation */
@@ -67,6 +67,8 @@
;/* 06-02-2021 William E. Lamie Initial Version 6.1.7 */
;/* 10-15-2021 William E. Lamie Modified comment(s), */
;/* resulting in version 6.1.9 */
;/* 01-31-2022 William E. Lamie Modified comment(s), */
;/* resulting in version 6.1.10 */
;/* */
;/**************************************************************************/
public __tx_initialize_low_level

View File

@@ -45,7 +45,7 @@
;/* FUNCTION RELEASE */
;/* */
;/* _tx_thread_context_restore RXv3/IAR */
;/* 6.1.9 */
;/* 6.1.10 */
;/* AUTHOR */
;/* */
;/* William E. Lamie, Microsoft Corporation */
@@ -81,6 +81,8 @@
;/* 10-15-2021 William E. Lamie Modified comment(s), and */
;/* added FPU support, */
;/* resulting in version 6.1.9 */
;/* 01-31-2022 William E. Lamie Modified comment(s), */
;/* resulting in version 6.1.10 */
;/* */
;/**************************************************************************/
public __tx_thread_context_restore

View File

@@ -39,7 +39,7 @@
;/* FUNCTION RELEASE */
;/* */
;/* _tx_thread_context_save RXv3/IAR */
;/* 6.1.9 */
;/* 6.1.10 */
;/* AUTHOR */
;/* */
;/* William E. Lamie, Microsoft Corporation */
@@ -73,6 +73,8 @@
;/* 06-02-2021 William E. Lamie Initial Version 6.1.7 */
;/* 10-15-2021 William E. Lamie Modified comment(s), */
;/* resulting in version 6.1.9 */
;/* 01-31-2022 William E. Lamie Modified comment(s), */
;/* resulting in version 6.1.10 */
;/* */
;/**************************************************************************/
;VOID _tx_thread_context_save(VOID)

View File

@@ -34,7 +34,7 @@
;/* FUNCTION RELEASE */
;/* */
;/* _tx_thread_interrupt_control RXv3/IAR */
;/* 6.1.9 */
;/* 6.1.10 */
;/* AUTHOR */
;/* */
;/* William E. Lamie, Microsoft Corporation */
@@ -67,6 +67,8 @@
;/* 06-02-2021 William E. Lamie Initial Version 6.1.7 */
;/* 10-15-2021 William E. Lamie Modified comment(s), */
;/* resulting in version 6.1.9 */
;/* 01-31-2022 William E. Lamie Modified comment(s), */
;/* resulting in version 6.1.10 */
;/* */
;/**************************************************************************/
;UINT _tx_thread_interrupt_control(UINT new_posture)

View File

@@ -42,7 +42,7 @@
;/* FUNCTION RELEASE */
;/* */
;/* _tx_thread_schedule RXv3/IAR */
;/* 6.1.9 */
;/* 6.1.10 */
;/* AUTHOR */
;/* */
;/* William E. Lamie, Microsoft Corporation */
@@ -79,6 +79,8 @@
;/* 10-15-2021 William E. Lamie Modified comment(s), and */
;/* added FPU support, */
;/* resulting in version 6.1.9 */
;/* 01-31-2022 William E. Lamie Modified comment(s), */
;/* resulting in version 6.1.10 */
;/* */
;/**************************************************************************/
;VOID _tx_thread_schedule(VOID)

View File

@@ -28,7 +28,7 @@
;/* FUNCTION RELEASE */
;/* */
;/* _tx_thread_stack_build RXv3/IAR */
;/* 6.1.9 */
;/* 6.1.10 */
;/* AUTHOR */
;/* */
;/* William E. Lamie, Microsoft Corporation */
@@ -63,6 +63,8 @@
;/* 06-02-2021 William E. Lamie Initial Version 6.1.7 */
;/* 10-15-2021 William E. Lamie Modified comment(s), */
;/* resulting in version 6.1.9 */
;/* 01-31-2022 William E. Lamie Modified comment(s), */
;/* resulting in version 6.1.10 */
;/* */
;/**************************************************************************/

View File

@@ -27,7 +27,7 @@
;/* FUNCTION RELEASE */
;/* */
;/* _tx_thread_system_return RXv3/IAR */
;/* 6.1.9 */
;/* 6.1.10 */
;/* AUTHOR */
;/* */
;/* William E. Lamie, Microsoft Corporation */
@@ -62,6 +62,8 @@
;/* 06-02-2021 William E. Lamie Initial Version 6.1.7 */
;/* 10-15-2021 William E. Lamie Modified comment(s), */
;/* resulting in version 6.1.9 */
;/* 01-31-2022 William E. Lamie Modified comment(s), */
;/* resulting in version 6.1.10 */
;/* */
;/**************************************************************************/

View File

@@ -20,6 +20,8 @@
;/**************************************************************************/
;/**************************************************************************/
SWI0 EQU 0x872E0
extern __tx_timer_expiration_process
extern __tx_timer_system_clock
extern __tx_timer_expired_time_slice
@@ -29,6 +31,10 @@
extern __tx_timer_time_slice
extern __tx_timer_list_end
extern __tx_thread_time_slice
extern __tx_thread_preempt_disable
extern __tx_thread_execute_ptr
extern __tx_thread_current_ptr
section .text:CODE:ROOT
@@ -37,7 +43,7 @@
;/* FUNCTION RELEASE */
;/* */
;/* _tx_timer_interrupt RXv3/IAR */
;/* 6.1.9 */
;/* 6.1.10 */
;/* AUTHOR */
;/* */
;/* William E. Lamie, Microsoft Corporation */
@@ -76,6 +82,10 @@
;/* 06-02-2021 William E. Lamie Initial Version 6.1.7 */
;/* 10-15-2021 William E. Lamie Modified comment(s), */
;/* resulting in version 6.1.9 */
;/* 01-31-2022 William E. Lamie Modified comment(s), and */
;/* added missing thread */
;/* preemption logic, */
;/* resulting in version 6.1.10 */
;/* */
;/**************************************************************************/
@@ -222,6 +232,23 @@ __tx_timer_dont_activate:
; _tx_thread_time_slice();
BSR __tx_thread_time_slice ; Call time-slice processing
; /* Check if we must trigger a context switch. */
MOV.L #__tx_thread_preempt_disable, R1 ; Load prempt disable flag.
MOV.L [R1], R1
CMP #0, R1
BNE __tx_timer_not_ts_expiration ; Skip if prempt disabled.
MOV.L #__tx_thread_execute_ptr, R1
MOV.L [R1], R1
MOV.L #__tx_thread_current_ptr, R2
MOV.L [R2], R2
CMP R1, R2
BEQ __tx_timer_not_ts_expiration
MOV.L #SWI0, R1
MOV.L #1, [R1]
; }
;
__tx_timer_not_ts_expiration: