summaryrefslogtreecommitdiff
path: root/ports/rxv1/iar/src
diff options
context:
space:
mode:
authorTiejunZhou <[email protected]>2022-04-26 14:21:38 +0800
committerGitHub <[email protected]>2022-04-26 14:21:38 +0800
commite11c166a4045d80ea74fe917e5608474754f5067 (patch)
tree0618f87d27c3856df9e856db75048424a8829399 /ports/rxv1/iar/src
parentcef9cb22a5e2b9bca56074c5e627225ec0dd3d73 (diff)
parent408f9fa1b78059906368d60d8375ba1fdbb9dc9f (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/rxv1/iar/src')
-rw-r--r--ports/rxv1/iar/src/tx_initialize_low_level.s4
-rw-r--r--ports/rxv1/iar/src/tx_thread_context_restore.s4
-rw-r--r--ports/rxv1/iar/src/tx_thread_context_save.s4
-rw-r--r--ports/rxv1/iar/src/tx_thread_interrupt_control.s4
-rw-r--r--ports/rxv1/iar/src/tx_thread_schedule.s48
-rw-r--r--ports/rxv1/iar/src/tx_thread_stack_build.s4
-rw-r--r--ports/rxv1/iar/src/tx_thread_system_return.s4
-rw-r--r--ports/rxv1/iar/src/tx_timer_interrupt.s4
8 files changed, 60 insertions, 16 deletions
diff --git a/ports/rxv1/iar/src/tx_initialize_low_level.s b/ports/rxv1/iar/src/tx_initialize_low_level.s
index fb009cb1..7d991fc1 100644
--- a/ports/rxv1/iar/src/tx_initialize_low_level.s
+++ b/ports/rxv1/iar/src/tx_initialize_low_level.s
@@ -31,7 +31,7 @@
;/* FUNCTION RELEASE */
;/* */
;/* _tx_initialize_low_level RXv1/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/rxv1/iar/src/tx_thread_context_restore.s b/ports/rxv1/iar/src/tx_thread_context_restore.s
index 40d8f399..7c5b071e 100644
--- a/ports/rxv1/iar/src/tx_thread_context_restore.s
+++ b/ports/rxv1/iar/src/tx_thread_context_restore.s
@@ -34,7 +34,7 @@
;/* FUNCTION RELEASE */
;/* */
;/* _tx_thread_context_restore RXv1/IAR */
-;/* 6.1.10 */
+;/* 6.1.11 */
;/* AUTHOR */
;/* */
;/* William E. Lamie, Microsoft Corporation */
@@ -73,6 +73,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/rxv1/iar/src/tx_thread_context_save.s b/ports/rxv1/iar/src/tx_thread_context_save.s
index 6a43112e..a893876f 100644
--- a/ports/rxv1/iar/src/tx_thread_context_save.s
+++ b/ports/rxv1/iar/src/tx_thread_context_save.s
@@ -29,7 +29,7 @@
;/* FUNCTION RELEASE */
;/* */
;/* _tx_thread_context_save RXv1/IAR */
-;/* 6.1.10 */
+;/* 6.1.11 */
;/* AUTHOR */
;/* */
;/* William E. Lamie, Microsoft Corporation */
@@ -65,6 +65,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/rxv1/iar/src/tx_thread_interrupt_control.s b/ports/rxv1/iar/src/tx_thread_interrupt_control.s
index 5c5d532b..98cb2e8c 100644
--- a/ports/rxv1/iar/src/tx_thread_interrupt_control.s
+++ b/ports/rxv1/iar/src/tx_thread_interrupt_control.s
@@ -26,7 +26,7 @@
;/* FUNCTION RELEASE */
;/* */
;/* _tx_thread_interrupt_control RXv1/IAR */
-;/* 6.1.10 */
+;/* 6.1.11 */
;/* AUTHOR */
;/* */
;/* William E. Lamie, Microsoft Corporation */
@@ -61,6 +61,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/rxv1/iar/src/tx_thread_schedule.s b/ports/rxv1/iar/src/tx_thread_schedule.s
index 1d55ddaf..6412a9f9 100644
--- a/ports/rxv1/iar/src/tx_thread_schedule.s
+++ b/ports/rxv1/iar/src/tx_thread_schedule.s
@@ -23,6 +23,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
@@ -31,7 +36,7 @@
;/* FUNCTION RELEASE */
;/* */
;/* _tx_thread_schedule RXv1/IAR */
-;/* 6.1.10 */
+;/* 6.1.11 */
;/* AUTHOR */
;/* */
;/* William E. Lamie, Microsoft Corporation */
@@ -71,6 +76,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)
@@ -79,26 +87,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/rxv1/iar/src/tx_thread_stack_build.s b/ports/rxv1/iar/src/tx_thread_stack_build.s
index ddf5a03e..4dec6103 100644
--- a/ports/rxv1/iar/src/tx_thread_stack_build.s
+++ b/ports/rxv1/iar/src/tx_thread_stack_build.s
@@ -28,7 +28,7 @@
;/* FUNCTION RELEASE */
;/* */
;/* _tx_thread_stack_build RXv1/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 */
;/* */
;/**************************************************************************/
diff --git a/ports/rxv1/iar/src/tx_thread_system_return.s b/ports/rxv1/iar/src/tx_thread_system_return.s
index b14a4249..d07a1c3e 100644
--- a/ports/rxv1/iar/src/tx_thread_system_return.s
+++ b/ports/rxv1/iar/src/tx_thread_system_return.s
@@ -27,7 +27,7 @@
;/* FUNCTION RELEASE */
;/* */
;/* _tx_thread_system_return RXv1/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/rxv1/iar/src/tx_timer_interrupt.s b/ports/rxv1/iar/src/tx_timer_interrupt.s
index d3952d07..a6e208d2 100644
--- a/ports/rxv1/iar/src/tx_timer_interrupt.s
+++ b/ports/rxv1/iar/src/tx_timer_interrupt.s
@@ -42,7 +42,7 @@ SWI0 EQU 0x872E0
;/* FUNCTION RELEASE */
;/* */
;/* _tx_timer_interrupt RXv1/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 */
;/* */
;/**************************************************************************/