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

@@ -29,7 +29,7 @@
;/* FUNCTION RELEASE */
;/* */
;/* _tx_initialize_low_level RXv1/GNURX */
;/* 6.1.9 */
;/* 6.1.10 */
;/* AUTHOR */
;/* */
;/* William E. Lamie, Microsoft Corporation */
@@ -65,6 +65,8 @@
;/* 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 */
;/* 01-31-2022 William E. Lamie Modified comment(s), */
;/* resulting in version 6.1.10 */
;/* */
;/**************************************************************************/
.global __tx_initialize_low_level

View File

@@ -46,7 +46,7 @@
;/* FUNCTION RELEASE */
;/* */
;/* _tx_thread_context_restore RXv1/GNURX */
;/* 6.1.9 */
;/* 6.1.10 */
;/* AUTHOR */
;/* */
;/* William E. Lamie, Microsoft Corporation */
@@ -83,6 +83,8 @@
;/* removed unnecessary stack */
;/* type placement, */
;/* 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_restore(VOID)

View File

@@ -30,7 +30,7 @@
;/* FUNCTION RELEASE */
;/* */
;/* _tx_thread_context_save RXv1/GNURX */
;/* 6.1.9 */
;/* 6.1.10 */
;/* AUTHOR */
;/* */
;/* William E. Lamie, Microsoft Corporation */
@@ -64,6 +64,8 @@
;/* 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 */
;/* 01-31-2022 William E. Lamie Modified comment(s), */
;/* resulting in version 6.1.10 */
;/* */
;/**************************************************************************/
;VOID _tx_thread_context_save(VOID)

View File

@@ -26,7 +26,7 @@
;/* FUNCTION RELEASE */
;/* */
;/* _tx_thread_interrupt_control RXv1/GNURX */
;/* 6.1.9 */
;/* 6.1.10 */
;/* AUTHOR */
;/* */
;/* William E. Lamie, Microsoft Corporation */
@@ -59,6 +59,8 @@
;/* 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 */
;/* 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

@@ -31,7 +31,7 @@
;/* FUNCTION RELEASE */
;/* */
;/* _tx_thread_schedule RXv1/GNURX */
;/* 6.1.9 */
;/* 6.1.10 */
;/* AUTHOR */
;/* */
;/* William E. Lamie, Microsoft Corporation */
@@ -69,6 +69,8 @@
;/* removed unnecessary stack */
;/* type checking, */
;/* 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

@@ -26,7 +26,7 @@
;/* FUNCTION RELEASE */
;/* */
;/* _tx_thread_stack_build RXv1/GNURX */
;/* 6.1.9 */
;/* 6.1.10 */
;/* AUTHOR */
;/* */
;/* William E. Lamie, Microsoft Corporation */
@@ -63,6 +63,8 @@
;/* removed unnecessary stack */
;/* type placement, */
;/* resulting in version 6.1.9 */
;/* 01-31-2022 William E. Lamie Modified comment(s), */
;/* resulting in version 6.1.10 */
;/* */
;/**************************************************************************/
;VOID _tx_thread_stack_build(TX_THREAD *thread_ptr, VOID (*function_ptr)(VOID))

View File

@@ -30,7 +30,7 @@
;/* FUNCTION RELEASE */
;/* */
;/* _tx_thread_system_return RXv1/GNURX */
;/* 6.1.9 */
;/* 6.1.10 */
;/* AUTHOR */
;/* */
;/* William E. Lamie, Microsoft Corporation */
@@ -66,6 +66,8 @@
;/* 10-15-2021 William E. Lamie Modified comment(s), and */
;/* removed unused code, */
;/* resulting in version 6.1.9 */
;/* 01-31-2022 William E. Lamie Modified comment(s), */
;/* resulting in version 6.1.10 */
;/* */
;/**************************************************************************/
;VOID _tx_thread_system_return(VOID)

View File

@@ -20,6 +20,7 @@
;/**************************************************************************/
;/**************************************************************************/
.equ SWI0, 872E0H
.global __tx_timer_time_slice
.global __tx_timer_system_clock
.global __tx_timer_current_ptr
@@ -31,6 +32,9 @@
.global __tx_thread_context_save
.global __tx_thread_time_slice
.global __tx_thread_context_restore
.global __tx_thread_preempt_disable
.global __tx_thread_execute_ptr
.global __tx_thread_current_ptr
.SECTION P,CODE
;/**************************************************************************/
@@ -38,7 +42,7 @@
;/* FUNCTION RELEASE */
;/* */
;/* _tx_timer_interrupt RXv1/GNURX */
;/* 6.1.9 */
;/* 6.1.10 */
;/* AUTHOR */
;/* */
;/* William E. Lamie, Microsoft Corporation */
@@ -77,6 +81,10 @@
;/* 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 */
;/* 01-31-2022 William E. Lamie Modified comment(s), and */
;/* added missing thread */
;/* preemption logic, */
;/* resulting in version 6.1.10 */
;/* */
;/**************************************************************************/
;VOID _tx_timer_interrupt(VOID)
@@ -224,6 +232,24 @@ __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: