summaryrefslogtreecommitdiff
path: root/ports/rxv2/ccrx/src
diff options
context:
space:
mode:
Diffstat (limited to 'ports/rxv2/ccrx/src')
-rw-r--r--ports/rxv2/ccrx/src/tx_initialize_low_level.src4
-rw-r--r--ports/rxv2/ccrx/src/tx_thread_context_restore.src4
-rw-r--r--ports/rxv2/ccrx/src/tx_thread_context_save.src4
-rw-r--r--ports/rxv2/ccrx/src/tx_thread_interrupt_control.src4
-rw-r--r--ports/rxv2/ccrx/src/tx_thread_schedule.src48
-rw-r--r--ports/rxv2/ccrx/src/tx_thread_stack_build.src4
-rw-r--r--ports/rxv2/ccrx/src/tx_thread_system_return.src4
-rw-r--r--ports/rxv2/ccrx/src/tx_timer_interrupt.src4
8 files changed, 60 insertions, 16 deletions
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)