diff options
| author | TiejunZhou <[email protected]> | 2022-04-26 14:21:38 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2022-04-26 14:21:38 +0800 |
| commit | e11c166a4045d80ea74fe917e5608474754f5067 (patch) | |
| tree | 0618f87d27c3856df9e856db75048424a8829399 /ports/rxv2 | |
| parent | cef9cb22a5e2b9bca56074c5e627225ec0dd3d73 (diff) | |
| parent | 408f9fa1b78059906368d60d8375ba1fdbb9dc9f (diff) | |
Merge pull request #187 from azure-rtos/tizho/rx_updatev6.1.11_rel
Import RX port update for 6.1.11 release.
Diffstat (limited to 'ports/rxv2')
30 files changed, 204 insertions, 57 deletions
diff --git a/ports/rxv2/ccrx/inc/tx_port.h b/ports/rxv2/ccrx/inc/tx_port.h index c397f689..1038f156 100644 --- a/ports/rxv2/ccrx/inc/tx_port.h +++ b/ports/rxv2/ccrx/inc/tx_port.h @@ -26,7 +26,7 @@ /* PORT SPECIFIC C INFORMATION RELEASE */ /* */ /* tx_port.h RXv2/CCRX */ -/* 6.1.10 */ +/* 6.1.11 */ /* */ /* AUTHOR */ /* */ @@ -57,6 +57,8 @@ /* added missing interrupt */ /* control defines, */ /* resulting in version 6.1.10 */ +/* 04-25-2022 William E. Lamie Modified comment(s), */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ @@ -273,7 +275,7 @@ static void _tx_thread_system_return_inline(void) #ifdef TX_THREAD_INIT CHAR _tx_version_id[] = - "Copyright (c) Microsoft Corporation. All rights reserved. * ThreadX RXv2/CCRX Version 6.1.10 *"; + "Copyright (c) Microsoft Corporation. All rights reserved. * ThreadX RXv2/CCRX Version 6.1.11 *"; #else extern CHAR _tx_version_id[]; #endif diff --git a/ports/rxv2/ccrx/readme_threadx.txt b/ports/rxv2/ccrx/readme_threadx.txt index ee264624..7ab448c9 100644 --- a/ports/rxv2/ccrx/readme_threadx.txt +++ b/ports/rxv2/ccrx/readme_threadx.txt @@ -153,6 +153,9 @@ For generic code revision information, please refer to the readme_threadx_generi file, which is included in your distribution. The following details the revision information associated with this specific port of ThreadX: +04-25-2022 Release 6.1.11 changes: + tx_thread_schedule.src Added low power support + 01-31-2022 Release 6.1.10 changes: tx_port.h Removed system state macro, and added missing interrupt control defines diff --git a/ports/rxv2/ccrx/src/tx_initialize_low_level.src b/ports/rxv2/ccrx/src/tx_initialize_low_level.src index 29cf9b42..4c5aa42a 100644 --- a/ports/rxv2/ccrx/src/tx_initialize_low_level.src +++ b/ports/rxv2/ccrx/src/tx_initialize_low_level.src @@ -34,7 +34,7 @@ ;/* FUNCTION RELEASE */ ;/* */ ;/* _tx_initialize_low_level RXv2/CCRX */ -;/* 6.1.10 */ +;/* 6.1.11 */ ;/* AUTHOR */ ;/* */ ;/* William E. Lamie, Microsoft Corporation */ @@ -72,6 +72,8 @@ ;/* resulting in version 6.1.9 */ ;/* 01-31-2022 William E. Lamie Modified comment(s), */ ;/* resulting in version 6.1.10 */ +;/* 04-25-2022 William E. Lamie Modified comment(s), */ +;/* resulting in version 6.1.11 */ ;/* */ ;/**************************************************************************/ diff --git a/ports/rxv2/ccrx/src/tx_thread_context_restore.src b/ports/rxv2/ccrx/src/tx_thread_context_restore.src index dbad3f22..ad045bb2 100644 --- a/ports/rxv2/ccrx/src/tx_thread_context_restore.src +++ b/ports/rxv2/ccrx/src/tx_thread_context_restore.src @@ -45,7 +45,7 @@ ;/* FUNCTION RELEASE */ ;/* */ ;/* _tx_thread_context_restore RXv2/CCRX */ -;/* 6.1.10 */ +;/* 6.1.11 */ ;/* AUTHOR */ ;/* */ ;/* William E. Lamie, Microsoft Corporation */ @@ -84,6 +84,8 @@ ;/* resulting in version 6.1.9 */ ;/* 01-31-2022 William E. Lamie Modified comment(s), */ ;/* resulting in version 6.1.10 */ +;/* 04-25-2022 William E. Lamie Modified comment(s), */ +;/* resulting in version 6.1.11 */ ;/* */ ;/**************************************************************************/ ;VOID _tx_thread_context_restore(VOID) diff --git a/ports/rxv2/ccrx/src/tx_thread_context_save.src b/ports/rxv2/ccrx/src/tx_thread_context_save.src index 8712c80b..ac398670 100644 --- a/ports/rxv2/ccrx/src/tx_thread_context_save.src +++ b/ports/rxv2/ccrx/src/tx_thread_context_save.src @@ -40,7 +40,7 @@ ;/* FUNCTION RELEASE */ ;/* */ ;/* _tx_thread_context_save RXv2/CCRX */ -;/* 6.1.10 */ +;/* 6.1.11 */ ;/* AUTHOR */ ;/* */ ;/* William E. Lamie, Microsoft Corporation */ @@ -76,6 +76,8 @@ ;/* resulting in version 6.1.9 */ ;/* 01-31-2022 William E. Lamie Modified comment(s), */ ;/* resulting in version 6.1.10 */ +;/* 04-25-2022 William E. Lamie Modified comment(s), */ +;/* resulting in version 6.1.11 */ ;/* */ ;/**************************************************************************/ ;VOID _tx_thread_context_save(VOID) diff --git a/ports/rxv2/ccrx/src/tx_thread_interrupt_control.src b/ports/rxv2/ccrx/src/tx_thread_interrupt_control.src index 42e76109..cdcc07da 100644 --- a/ports/rxv2/ccrx/src/tx_thread_interrupt_control.src +++ b/ports/rxv2/ccrx/src/tx_thread_interrupt_control.src @@ -35,7 +35,7 @@ ;/* FUNCTION RELEASE */ ;/* */ ;/* _tx_thread_interrupt_control RXc2/CCRX */ -;/* 6.1.10 */ +;/* 6.1.11 */ ;/* AUTHOR */ ;/* */ ;/* William E. Lamie, Microsoft Corporation */ @@ -70,6 +70,8 @@ ;/* resulting in version 6.1.9 */ ;/* 01-31-2022 William E. Lamie Modified comment(s), */ ;/* resulting in version 6.1.10 */ +;/* 04-25-2022 William E. Lamie Modified comment(s), */ +;/* resulting in version 6.1.11 */ ;/* */ ;/**************************************************************************/ ;UINT _tx_thread_interrupt_control(UINT new_posture) diff --git a/ports/rxv2/ccrx/src/tx_thread_schedule.src b/ports/rxv2/ccrx/src/tx_thread_schedule.src index fb733165..6161cb34 100644 --- a/ports/rxv2/ccrx/src/tx_thread_schedule.src +++ b/ports/rxv2/ccrx/src/tx_thread_schedule.src @@ -34,6 +34,11 @@ .GLB __tx_thread_execute_ptr .GLB __tx_thread_current_ptr .GLB __tx_timer_time_slice +.IF TX_LOW_POWER==1 + .GLB _tx_low_power_enter + .GLB _tx_low_power_exit + .GLB __tx_thread_preempt_disable +.ENDIF ; .SECTION P,CODE @@ -42,7 +47,7 @@ ;/* FUNCTION RELEASE */ ;/* */ ;/* _tx_thread_schedule RXv2/CCRX */ -;/* 6.1.10 */ +;/* 6.1.11 */ ;/* AUTHOR */ ;/* */ ;/* William E. Lamie, Microsoft Corporation */ @@ -82,6 +87,9 @@ ;/* resulting in version 6.1.9 */ ;/* 01-31-2022 William E. Lamie Modified comment(s), */ ;/* resulting in version 6.1.10 */ +;/* 04-25-2022 William E. Lamie Modified comment(s), and */ +;/* added low power support, */ +;/* resulting in version 6.1.11 */ ;/* */ ;/**************************************************************************/ ;VOID _tx_thread_schedule(VOID) @@ -89,26 +97,48 @@ .GLB __tx_thread_schedule __tx_thread_schedule: ; -; /* Enable interrupts. */ -; - SETPSW I ; ; /* Wait for a thread to execute. */ ; do ; { MOV.L #__tx_thread_execute_ptr, R1 ; Address of thread to executer ptr __tx_thread_schedule_loop: + SETPSW I ; Enable interrupts + CLRPSW I ; Disable interrupts MOV.L [R1],R2 ; Pickup next thread to execute CMP #0,R2 ; Is it NULL? - BEQ __tx_thread_schedule_loop ; Yes, idle system, keep checking + BNE __tx_thread_thread_ready ; Not NULL, schedule the thread + ; Idle system - no thread is ready +.IF TX_LOW_POWER==1 + MOV.L #__tx_thread_preempt_disable, R1 ; Load prempt disable flag. + MOV.L [R1], R2 + ADD #1, R2 ; Disable preemption while enter/exit + MOV.L R2, [R1] + BSR _tx_low_power_enter ; Possibly enter low power mode +.ENDIF + +.IF TX_ENABLE_WAIT==1 + WAIT ; Wait for interrupt +.ENDIF + +.IF TX_LOW_POWER==1 + CLRPSW I ; Disable interrupts (because WAIT enables interrupts) + BSR _tx_low_power_exit ; Possibly exit low power mode + MOV.L #__tx_thread_preempt_disable, R1 ; Load prempt disable flag. + MOV.L [R1], R2 + SUB #1, R2 ; Enable preemption + MOV.L R2, [R1] + MOV.L #__tx_thread_execute_ptr, R1 ; Address of thread to executer ptr +.ENDIF + + BRA __tx_thread_schedule_loop ; Idle system, keep checking + +__tx_thread_thread_ready: ; ; } ; while(_tx_thread_execute_ptr == TX_NULL); ; -; /* Yes! We have a thread to execute. Lockout interrupts and -; transfer control to it. */ -; - CLRPSW I ; Disable interrupts +; /* Yes! We have a thread to execute. Note that interrupts are locked out at this point. */ ; ; /* Setup the current thread pointer. */ ; _tx_thread_current_ptr = _tx_thread_execute_ptr; diff --git a/ports/rxv2/ccrx/src/tx_thread_stack_build.src b/ports/rxv2/ccrx/src/tx_thread_stack_build.src index fdcba9cd..b5335c29 100644 --- a/ports/rxv2/ccrx/src/tx_thread_stack_build.src +++ b/ports/rxv2/ccrx/src/tx_thread_stack_build.src @@ -36,7 +36,7 @@ ;/* FUNCTION RELEASE */ ;/* */ ;/* _tx_thread_stack_build RXc2/CCRX */ -;/* 6.1.10 */ +;/* 6.1.11 */ ;/* AUTHOR */ ;/* */ ;/* William E. Lamie, Microsoft Corporation */ @@ -75,6 +75,8 @@ ;/* resulting in version 6.1.9 */ ;/* 01-31-2022 William E. Lamie Modified comment(s), */ ;/* resulting in version 6.1.10 */ +;/* 04-25-2022 William E. Lamie Modified comment(s), */ +;/* resulting in version 6.1.11 */ ;/* */ ;/**************************************************************************/ ;VOID _tx_thread_stack_build(TX_THREAD *thread_ptr, VOID (*function_ptr)(VOID)) diff --git a/ports/rxv2/ccrx/src/tx_thread_system_return.src b/ports/rxv2/ccrx/src/tx_thread_system_return.src index 00b9d10f..b9bf3b57 100644 --- a/ports/rxv2/ccrx/src/tx_thread_system_return.src +++ b/ports/rxv2/ccrx/src/tx_thread_system_return.src @@ -40,7 +40,7 @@ ;/* FUNCTION RELEASE */ ;/* */ ;/* _tx_thread_system_return RXv2/CCRX */ -;/* 6.1.10 */ +;/* 6.1.11 */ ;/* AUTHOR */ ;/* */ ;/* William E. Lamie, Microsoft Corporation */ @@ -78,6 +78,8 @@ ;/* resulting in version 6.1.9 */ ;/* 01-31-2022 William E. Lamie Modified comment(s), */ ;/* resulting in version 6.1.10 */ +;/* 04-25-2022 William E. Lamie Modified comment(s), */ +;/* resulting in version 6.1.11 */ ;/* */ ;/**************************************************************************/ ;VOID _tx_thread_system_return(VOID) diff --git a/ports/rxv2/ccrx/src/tx_timer_interrupt.src b/ports/rxv2/ccrx/src/tx_timer_interrupt.src index dd166d1e..c946cbc6 100644 --- a/ports/rxv2/ccrx/src/tx_timer_interrupt.src +++ b/ports/rxv2/ccrx/src/tx_timer_interrupt.src @@ -56,7 +56,7 @@ ;/* FUNCTION RELEASE */ ;/* */ ;/* _tx_timer_interrupt RXv2/CCRX */ -;/* 6.1.10 */ +;/* 6.1.11 */ ;/* AUTHOR */ ;/* */ ;/* William E. Lamie, Microsoft Corporation */ @@ -99,6 +99,8 @@ ;/* added missing thread */ ;/* preemption logic, */ ;/* resulting in version 6.1.10 */ +;/* 04-25-2022 William E. Lamie Modified comment(s), */ +;/* resulting in version 6.1.11 */ ;/* */ ;/**************************************************************************/ ;VOID _tx_timer_interrupt(VOID) diff --git a/ports/rxv2/gnu/inc/tx_port.h b/ports/rxv2/gnu/inc/tx_port.h index 7c0364e5..676cd64f 100644 --- a/ports/rxv2/gnu/inc/tx_port.h +++ b/ports/rxv2/gnu/inc/tx_port.h @@ -26,7 +26,7 @@ /* PORT SPECIFIC C INFORMATION RELEASE */ /* */ /* tx_port.h RXv2/GNURX */ -/* 6.1.10 */ +/* 6.1.11 */ /* */ /* AUTHOR */ /* */ @@ -56,6 +56,8 @@ /* added missing interrupt */ /* control defines, */ /* resulting in version 6.1.10 */ +/* 04-25-2022 William E. Lamie Modified comment(s), */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ @@ -269,7 +271,7 @@ static void _tx_thread_system_return_inline(void) #ifdef TX_THREAD_INIT CHAR _tx_version_id[] = - "Copyright (c) Microsoft Corporation. All rights reserved. * ThreadX RXv2/GNURX Version 6.1.10 *"; + "Copyright (c) Microsoft Corporation. All rights reserved. * ThreadX RXv2/GNURX Version 6.1.11 *"; #else extern CHAR _tx_version_id[]; #endif diff --git a/ports/rxv2/gnu/readme_threadx.txt b/ports/rxv2/gnu/readme_threadx.txt index 2abbdb7e..ffbb4035 100644 --- a/ports/rxv2/gnu/readme_threadx.txt +++ b/ports/rxv2/gnu/readme_threadx.txt @@ -149,9 +149,12 @@ For generic code revision information, please refer to the readme_threadx_generi file, which is included in your distribution. The following details the revision information associated with this specific port of ThreadX: +04-25-2022 Release 6.1.11 changes: + tx_thread_schedule.s Added low power support + 01-31-2022 Release 6.1.10 changes: tx_port.h Added missing interrupt control defines - tx_timer_interrupt.src Added missing thread preemption logic + tx_timer_interrupt.s Added missing thread preemption logic 10-15-2021 Release 6.1.9 changes: tx_thread_context_restore.s Removed unnecessary stack type placement diff --git a/ports/rxv2/gnu/src/tx_initialize_low_level.S b/ports/rxv2/gnu/src/tx_initialize_low_level.S index 189bc121..929309ac 100644 --- a/ports/rxv2/gnu/src/tx_initialize_low_level.S +++ b/ports/rxv2/gnu/src/tx_initialize_low_level.S @@ -29,7 +29,7 @@ ;/* FUNCTION RELEASE */ ;/* */ ;/* _tx_initialize_low_level RXv2/GNURX */ -;/* 6.1.10 */ +;/* 6.1.11 */ ;/* AUTHOR */ ;/* */ ;/* William E. Lamie, Microsoft Corporation */ @@ -67,6 +67,8 @@ ;/* resulting in version 6.1.9 */ ;/* 01-31-2022 William E. Lamie Modified comment(s), */ ;/* resulting in version 6.1.10 */ +;/* 04-25-2022 William E. Lamie Modified comment(s), */ +;/* resulting in version 6.1.11 */ ;/* */ ;/**************************************************************************/ .global __tx_initialize_low_level diff --git a/ports/rxv2/gnu/src/tx_thread_context_restore.S b/ports/rxv2/gnu/src/tx_thread_context_restore.S index 7b61af43..b3e8eb62 100644 --- a/ports/rxv2/gnu/src/tx_thread_context_restore.S +++ b/ports/rxv2/gnu/src/tx_thread_context_restore.S @@ -46,7 +46,7 @@ ;/* FUNCTION RELEASE */ ;/* */ ;/* _tx_thread_context_restore RXv2/GNURX */ -;/* 6.1.10 */ +;/* 6.1.11 */ ;/* AUTHOR */ ;/* */ ;/* William E. Lamie, Microsoft Corporation */ @@ -85,6 +85,8 @@ ;/* resulting in version 6.1.9 */ ;/* 01-31-2022 William E. Lamie Modified comment(s), */ ;/* resulting in version 6.1.10 */ +;/* 04-25-2022 William E. Lamie Modified comment(s), */ +;/* resulting in version 6.1.11 */ ;/* */ ;/**************************************************************************/ ;VOID _tx_thread_context_restore(VOID) diff --git a/ports/rxv2/gnu/src/tx_thread_context_save.S b/ports/rxv2/gnu/src/tx_thread_context_save.S index ca381e90..abbb16d5 100644 --- a/ports/rxv2/gnu/src/tx_thread_context_save.S +++ b/ports/rxv2/gnu/src/tx_thread_context_save.S @@ -40,7 +40,7 @@ ;/* FUNCTION RELEASE */ ;/* */ ;/* _tx_thread_context_save RXv2/GNURX */ -;/* 6.1.10 */ +;/* 6.1.11 */ ;/* AUTHOR */ ;/* */ ;/* William E. Lamie, Microsoft Corporation */ @@ -76,6 +76,8 @@ ;/* resulting in version 6.1.9 */ ;/* 01-31-2022 William E. Lamie Modified comment(s), */ ;/* resulting in version 6.1.10 */ +;/* 04-25-2022 William E. Lamie Modified comment(s), */ +;/* resulting in version 6.1.11 */ ;/* */ ;/**************************************************************************/ ;VOID _tx_thread_context_save(VOID) diff --git a/ports/rxv2/gnu/src/tx_thread_interrupt_control.S b/ports/rxv2/gnu/src/tx_thread_interrupt_control.S index 535334de..c34ad3c8 100644 --- a/ports/rxv2/gnu/src/tx_thread_interrupt_control.S +++ b/ports/rxv2/gnu/src/tx_thread_interrupt_control.S @@ -35,7 +35,7 @@ ;/* FUNCTION RELEASE */ ;/* */ ;/* _tx_thread_interrupt_control RXv2/GNURX */ -;/* 6.1.10 */ +;/* 6.1.11 */ ;/* AUTHOR */ ;/* */ ;/* William E. Lamie, Microsoft Corporation */ @@ -70,6 +70,8 @@ ;/* resulting in version 6.1.9 */ ;/* 01-31-2022 William E. Lamie Modified comment(s), */ ;/* resulting in version 6.1.10 */ +;/* 04-25-2022 William E. Lamie Modified comment(s), */ +;/* resulting in version 6.1.11 */ ;/* */ ;/**************************************************************************/ ;UINT _tx_thread_interrupt_control(UINT new_posture) diff --git a/ports/rxv2/gnu/src/tx_thread_schedule.S b/ports/rxv2/gnu/src/tx_thread_schedule.S index 9587ac03..e3baf0fa 100644 --- a/ports/rxv2/gnu/src/tx_thread_schedule.S +++ b/ports/rxv2/gnu/src/tx_thread_schedule.S @@ -34,6 +34,11 @@ .global __tx_thread_execute_ptr .global __tx_thread_current_ptr .global __tx_timer_time_slice +#if (TX_LOW_POWER == 1) + .global _tx_low_power_enter + .global _tx_low_power_exit + .global __tx_thread_preempt_disable +#endif ; .text @@ -42,7 +47,7 @@ ;/* FUNCTION RELEASE */ ;/* */ ;/* _tx_thread_schedule RXv2/GNURX */ -;/* 6.1.10 */ +;/* 6.1.11 */ ;/* AUTHOR */ ;/* */ ;/* William E. Lamie, Microsoft Corporation */ @@ -82,6 +87,9 @@ ;/* resulting in version 6.1.9 */ ;/* 01-31-2022 William E. Lamie Modified comment(s), */ ;/* resulting in version 6.1.10 */ +;/* 04-25-2022 William E. Lamie Modified comment(s), and */ +;/* added low power support, */ +;/* resulting in version 6.1.11 */ ;/* */ ;/**************************************************************************/ ;VOID _tx_thread_schedule(VOID) @@ -89,26 +97,48 @@ .global __tx_thread_schedule __tx_thread_schedule: ; -; /* Enable interrupts. */ -; - SETPSW I ; ; /* Wait for a thread to execute. */ ; do ; { MOV.L #__tx_thread_execute_ptr, R1 ; Address of thread to executer ptr __tx_thread_schedule_loop: + SETPSW I ; Enable interrupts + CLRPSW I ; Disable interrupts MOV.L [R1],R2 ; Pickup next thread to execute CMP #0,R2 ; Is it NULL? - BEQ __tx_thread_schedule_loop ; Yes, idle system, keep checking + BNE __tx_thread_thread_ready ; Not NULL, schedule the thread + ; Idle system - no thread is ready +#if (TX_LOW_POWER == 1) + MOV.L #__tx_thread_preempt_disable, R1 ; Load prempt disable flag. + MOV.L [R1], R2 + ADD #1, R2 ; Disable preemption while enter/exit + MOV.L R2, [R1] + BSR _tx_low_power_enter ; Possibly enter low power mode +#endif + +#if (TX_ENABLE_WAIT == 1) + WAIT ; Wait for interrupt +#endif + +#if (TX_LOW_POWER == 1) + CLRPSW I ; Disable interrupts (because WAIT enables interrupts) + BSR _tx_low_power_exit ; Possibly exit low power mode + MOV.L #__tx_thread_preempt_disable, R1 ; Load prempt disable flag. + MOV.L [R1], R2 + SUB #1, R2 ; Enable preemption + MOV.L R2, [R1] + MOV.L #__tx_thread_execute_ptr, R1 ; Address of thread to executer ptr +#endif + + BRA __tx_thread_schedule_loop ; Idle system, keep checking + +__tx_thread_thread_ready: ; ; } ; while(_tx_thread_execute_ptr == TX_NULL); -; -; /* Yes! We have a thread to execute. Lockout interrupts and -; transfer control to it. */ -; - CLRPSW I ; Disable interrupts +; +; /* Yes! We have a thread to execute. Note that interrupts are locked out at this point. */ ; ; /* Setup the current thread pointer. */ ; _tx_thread_current_ptr = _tx_thread_execute_ptr; diff --git a/ports/rxv2/gnu/src/tx_thread_stack_build.S b/ports/rxv2/gnu/src/tx_thread_stack_build.S index 97f9b8df..dbf86a27 100644 --- a/ports/rxv2/gnu/src/tx_thread_stack_build.S +++ b/ports/rxv2/gnu/src/tx_thread_stack_build.S @@ -36,7 +36,7 @@ ;/* FUNCTION RELEASE */ ;/* */ ;/* _tx_thread_stack_build RXv2/GNURX */ -;/* 6.1.10 */ +;/* 6.1.11 */ ;/* AUTHOR */ ;/* */ ;/* William E. Lamie, Microsoft Corporation */ @@ -75,6 +75,8 @@ ;/* resulting in version 6.1.9 */ ;/* 01-31-2022 William E. Lamie Modified comment(s), */ ;/* resulting in version 6.1.10 */ +;/* 04-25-2022 William E. Lamie Modified comment(s), */ +;/* resulting in version 6.1.11 */ ;/* */ ;/**************************************************************************/ ;VOID _tx_thread_stack_build(TX_THREAD *thread_ptr, VOID (*function_ptr)(VOID)) diff --git a/ports/rxv2/gnu/src/tx_thread_system_return.S b/ports/rxv2/gnu/src/tx_thread_system_return.S index aeacbc65..27bda670 100644 --- a/ports/rxv2/gnu/src/tx_thread_system_return.S +++ b/ports/rxv2/gnu/src/tx_thread_system_return.S @@ -30,7 +30,7 @@ ;/* FUNCTION RELEASE */ ;/* */ ;/* _tx_thread_system_return RXv2/GNURX */ -;/* 6.1.10 */ +;/* 6.1.11 */ ;/* AUTHOR */ ;/* */ ;/* William E. Lamie, Microsoft Corporation */ @@ -68,6 +68,8 @@ ;/* resulting in version 6.1.9 */ ;/* 01-31-2022 William E. Lamie Modified comment(s), */ ;/* resulting in version 6.1.10 */ +;/* 04-25-2022 William E. Lamie Modified comment(s), */ +;/* resulting in version 6.1.11 */ ;/* */ ;/**************************************************************************/ ;VOID _tx_thread_system_return(VOID) diff --git a/ports/rxv2/gnu/src/tx_timer_interrupt.S b/ports/rxv2/gnu/src/tx_timer_interrupt.S index 8b8f5b9d..8d2398be 100644 --- a/ports/rxv2/gnu/src/tx_timer_interrupt.S +++ b/ports/rxv2/gnu/src/tx_timer_interrupt.S @@ -55,7 +55,7 @@ ;/* FUNCTION RELEASE */ ;/* */ ;/* _tx_timer_interrupt RXv2/GNURX */ -;/* 6.1.10 */ +;/* 6.1.11 */ ;/* AUTHOR */ ;/* */ ;/* William E. Lamie, Microsoft Corporation */ @@ -98,6 +98,8 @@ ;/* added missing thread */ ;/* preemption logic, */ ;/* resulting in version 6.1.10 */ +;/* 04-25-2022 William E. Lamie Modified comment(s), */ +;/* resulting in version 6.1.11 */ ;/* */ ;/**************************************************************************/ ;VOID _tx_timer_interrupt(VOID) diff --git a/ports/rxv2/iar/inc/tx_port.h b/ports/rxv2/iar/inc/tx_port.h index 10e6fe2c..8d4d34af 100644 --- a/ports/rxv2/iar/inc/tx_port.h +++ b/ports/rxv2/iar/inc/tx_port.h @@ -26,7 +26,7 @@ /* PORT SPECIFIC C INFORMATION RELEASE */ /* */ /* tx_port.h RXv2/IAR */ -/* 6.1.10 */ +/* 6.1.11 */ /* */ /* AUTHOR */ /* */ @@ -57,6 +57,8 @@ /* added missing interrupt */ /* control defines, */ /* resulting in version 6.1.10 */ +/* 04-25-2022 William E. Lamie Modified comment(s), */ +/* resulting in version 6.1.11 */ /* */ /**************************************************************************/ @@ -269,7 +271,7 @@ static void _tx_thread_system_return_inline(void) #ifdef TX_THREAD_INIT CHAR _tx_version_id[] = - "Copyright (c) Microsoft Corporation. All rights reserved. * ThreadX RXv2/IAR Version 6.1.10 *"; + "Copyright (c) Microsoft Corporation. All rights reserved. * ThreadX RXv2/IAR Version 6.1.11 *"; #else extern CHAR _tx_version_id[]; #endif diff --git a/ports/rxv2/iar/readme_threadx.txt b/ports/rxv2/iar/readme_threadx.txt index 3ec196ed..a0074439 100644 --- a/ports/rxv2/iar/readme_threadx.txt +++ b/ports/rxv2/iar/readme_threadx.txt @@ -146,10 +146,13 @@ For generic code revision information, please refer to the readme_threadx_generi file, which is included in your distribution. The following details the revision information associated with this specific port of ThreadX: +04-25-2022 Release 6.1.11 changes: + tx_thread_schedule.s Added low power support + 01-31-2022 Release 6.1.10 changes: tx_port.h Removed system state macro, and added missing interrupt control defines - tx_timer_interrupt.src Added missing thread preemption logic + tx_timer_interrupt.s Added missing thread preemption logic 10-15-2021 Release 6.1.9 changes: tx_thread_context_restore.s Removed unnecessary stack type placement diff --git a/ports/rxv2/iar/src/tx_initialize_low_level.s b/ports/rxv2/iar/src/tx_initialize_low_level.s index 638b001b..af75e992 100644 --- a/ports/rxv2/iar/src/tx_initialize_low_level.s +++ b/ports/rxv2/iar/src/tx_initialize_low_level.s @@ -31,7 +31,7 @@ ;/* FUNCTION RELEASE */ ;/* */ ;/* _tx_initialize_low_level RXv2/IAR */ -;/* 6.1.10 */ +;/* 6.1.11 */ ;/* AUTHOR */ ;/* */ ;/* William E. Lamie, Microsoft Corporation */ @@ -69,6 +69,8 @@ ;/* resulting in version 6.1.9 */ ;/* 01-31-2022 William E. Lamie Modified comment(s), */ ;/* resulting in version 6.1.10 */ +;/* 04-25-2022 William E. Lamie Modified comment(s), */ +;/* resulting in version 6.1.11 */ ;/* */ ;/**************************************************************************/ public __tx_initialize_low_level diff --git a/ports/rxv2/iar/src/tx_thread_context_restore.s b/ports/rxv2/iar/src/tx_thread_context_restore.s index 1e4e804b..125fbae0 100644 --- a/ports/rxv2/iar/src/tx_thread_context_restore.s +++ b/ports/rxv2/iar/src/tx_thread_context_restore.s @@ -45,7 +45,7 @@ ;/* FUNCTION RELEASE */ ;/* */ ;/* _tx_thread_context_restore RXv2/IAR */ -;/* 6.1.10 */ +;/* 6.1.11 */ ;/* AUTHOR */ ;/* */ ;/* William E. Lamie, Microsoft Corporation */ @@ -84,6 +84,8 @@ ;/* resulting in version 6.1.9 */ ;/* 01-31-2022 William E. Lamie Modified comment(s), */ ;/* resulting in version 6.1.10 */ +;/* 04-25-2022 William E. Lamie Modified comment(s), */ +;/* resulting in version 6.1.11 */ ;/* */ ;/**************************************************************************/ public __tx_thread_context_restore diff --git a/ports/rxv2/iar/src/tx_thread_context_save.s b/ports/rxv2/iar/src/tx_thread_context_save.s index 888432c0..f14ac8d8 100644 --- a/ports/rxv2/iar/src/tx_thread_context_save.s +++ b/ports/rxv2/iar/src/tx_thread_context_save.s @@ -39,7 +39,7 @@ ;/* FUNCTION RELEASE */ ;/* */ ;/* _tx_thread_context_save RXv2/IAR */ -;/* 6.1.10 */ +;/* 6.1.11 */ ;/* AUTHOR */ ;/* */ ;/* William E. Lamie, Microsoft Corporation */ @@ -75,6 +75,8 @@ ;/* resulting in version 6.1.9 */ ;/* 01-31-2022 William E. Lamie Modified comment(s), */ ;/* resulting in version 6.1.10 */ +;/* 04-25-2022 William E. Lamie Modified comment(s), */ +;/* resulting in version 6.1.11 */ ;/* */ ;/**************************************************************************/ ;VOID _tx_thread_context_save(VOID) diff --git a/ports/rxv2/iar/src/tx_thread_interrupt_control.s b/ports/rxv2/iar/src/tx_thread_interrupt_control.s index c1208669..62ce2e54 100644 --- a/ports/rxv2/iar/src/tx_thread_interrupt_control.s +++ b/ports/rxv2/iar/src/tx_thread_interrupt_control.s @@ -34,7 +34,7 @@ ;/* FUNCTION RELEASE */ ;/* */ ;/* _tx_thread_interrupt_control RXv2/IAR */ -;/* 6.1.10 */ +;/* 6.1.11 */ ;/* AUTHOR */ ;/* */ ;/* William E. Lamie, Microsoft Corporation */ @@ -69,6 +69,8 @@ ;/* resulting in version 6.1.9 */ ;/* 01-31-2022 William E. Lamie Modified comment(s), */ ;/* resulting in version 6.1.10 */ +;/* 04-25-2022 William E. Lamie Modified comment(s), */ +;/* resulting in version 6.1.11 */ ;/* */ ;/**************************************************************************/ ;UINT _tx_thread_interrupt_control(UINT new_posture) diff --git a/ports/rxv2/iar/src/tx_thread_schedule.s b/ports/rxv2/iar/src/tx_thread_schedule.s index 55ba05d6..79f6e883 100644 --- a/ports/rxv2/iar/src/tx_thread_schedule.s +++ b/ports/rxv2/iar/src/tx_thread_schedule.s @@ -34,6 +34,11 @@ extern __tx_thread_execute_ptr extern __tx_thread_current_ptr extern __tx_timer_time_slice +#if (TX_LOW_POWER == 1) + extern _tx_low_power_enter + extern _tx_low_power_exit + extern __tx_thread_preempt_disable +#endif section .text:CODE:ROOT @@ -42,7 +47,7 @@ ;/* FUNCTION RELEASE */ ;/* */ ;/* _tx_thread_schedule RXv2/IAR */ -;/* 6.1.10 */ +;/* 6.1.11 */ ;/* AUTHOR */ ;/* */ ;/* William E. Lamie, Microsoft Corporation */ @@ -82,6 +87,9 @@ ;/* resulting in version 6.1.9 */ ;/* 01-31-2022 William E. Lamie Modified comment(s), */ ;/* resulting in version 6.1.10 */ +;/* 04-25-2022 William E. Lamie Modified comment(s), and */ +;/* added low power support, */ +;/* resulting in version 6.1.11 */ ;/* */ ;/**************************************************************************/ ;VOID _tx_thread_schedule(VOID) @@ -90,26 +98,48 @@ __tx_thread_schedule: ; -; /* Enable interrupts. */ -; - SETPSW I ; ; /* Wait for a thread to execute. */ ; do ; { MOV.L #__tx_thread_execute_ptr, R1 ; Address of thread to executer ptr __tx_thread_schedule_loop: + SETPSW I ; Enable interrupts + CLRPSW I ; Disable interrupts MOV.L [R1],R2 ; Pickup next thread to execute CMP #0,R2 ; Is it NULL? - BEQ __tx_thread_schedule_loop ; Yes, idle system, keep checking + BNE __tx_thread_thread_ready ; Not NULL, schedule the thread + ; Idle system - no thread is ready +#if (TX_LOW_POWER == 1) + MOV.L #__tx_thread_preempt_disable, R1 ; Load prempt disable flag. + MOV.L [R1], R2 + ADD #1, R2 ; Disable preemption while enter/exit + MOV.L R2, [R1] + BSR _tx_low_power_enter ; Possibly enter low power mode +#endif + +#if (TX_ENABLE_WAIT == 1) + WAIT ; Wait for interrupt +#endif + +#if (TX_LOW_POWER == 1) + CLRPSW I ; Disable interrupts (because WAIT enables interrupts) + BSR _tx_low_power_exit ; Possibly exit low power mode + MOV.L #__tx_thread_preempt_disable, R1 ; Load prempt disable flag. + MOV.L [R1], R2 + SUB #1, R2 ; Enable preemption + MOV.L R2, [R1] + MOV.L #__tx_thread_execute_ptr, R1 ; Address of thread to executer ptr +#endif + + BRA __tx_thread_schedule_loop ; Idle system, keep checking + +__tx_thread_thread_ready: ; ; } ; while(_tx_thread_execute_ptr == TX_NULL); ; -; /* Yes! We have a thread to execute. Lockout interrupts and -; transfer control to it. */ -; - CLRPSW I ; Disable interrupts +; /* Yes! We have a thread to execute. Note that interrupts are locked out at this point. */ ; ; /* Setup the current thread pointer. */ ; _tx_thread_current_ptr = _tx_thread_execute_ptr; diff --git a/ports/rxv2/iar/src/tx_thread_stack_build.s b/ports/rxv2/iar/src/tx_thread_stack_build.s index 637911ca..6ba692cc 100644 --- a/ports/rxv2/iar/src/tx_thread_stack_build.s +++ b/ports/rxv2/iar/src/tx_thread_stack_build.s @@ -28,7 +28,7 @@ ;/* FUNCTION RELEASE */ ;/* */ ;/* _tx_thread_stack_build RXv2/IAR */ -;/* 6.1.10 */ +;/* 6.1.11 */ ;/* AUTHOR */ ;/* */ ;/* William E. Lamie, Microsoft Corporation */ @@ -67,6 +67,8 @@ ;/* resulting in version 6.1.9 */ ;/* 01-31-2022 William E. Lamie Modified comment(s), */ ;/* resulting in version 6.1.10 */ +;/* 04-25-2022 William E. Lamie Modified comment(s), */ +;/* resulting in version 6.1.11 */ ;/* */ ;/**************************************************************************/ public __tx_thread_stack_build diff --git a/ports/rxv2/iar/src/tx_thread_system_return.s b/ports/rxv2/iar/src/tx_thread_system_return.s index d1dc37df..6312258b 100644 --- a/ports/rxv2/iar/src/tx_thread_system_return.s +++ b/ports/rxv2/iar/src/tx_thread_system_return.s @@ -27,7 +27,7 @@ ;/* FUNCTION RELEASE */ ;/* */ ;/* _tx_thread_system_return RXv2/IAR */ -;/* 6.1.10 */ +;/* 6.1.11 */ ;/* AUTHOR */ ;/* */ ;/* William E. Lamie, Microsoft Corporation */ @@ -64,6 +64,8 @@ ;/* resulting in version 6.1.9 */ ;/* 01-31-2022 William E. Lamie Modified comment(s), */ ;/* resulting in version 6.1.10 */ +;/* 04-25-2022 William E. Lamie Modified comment(s), */ +;/* resulting in version 6.1.11 */ ;/* */ ;/**************************************************************************/ diff --git a/ports/rxv2/iar/src/tx_timer_interrupt.s b/ports/rxv2/iar/src/tx_timer_interrupt.s index 855bacc3..ec27eba4 100644 --- a/ports/rxv2/iar/src/tx_timer_interrupt.s +++ b/ports/rxv2/iar/src/tx_timer_interrupt.s @@ -42,7 +42,7 @@ SWI0 EQU 0x872E0 ;/* FUNCTION RELEASE */ ;/* */ ;/* _tx_timer_interrupt RXv2/IAR */ -;/* 6.1.10 */ +;/* 6.1.11 */ ;/* AUTHOR */ ;/* */ ;/* William E. Lamie, Microsoft Corporation */ @@ -85,6 +85,8 @@ SWI0 EQU 0x872E0 ;/* added missing thread */ ;/* preemption logic, */ ;/* resulting in version 6.1.10 */ +;/* 04-25-2022 William E. Lamie Modified comment(s), */ +;/* resulting in version 6.1.11 */ ;/* */ ;/**************************************************************************/ |
