summaryrefslogtreecommitdiff
path: root/ports/rxv3/iar/src
diff options
context:
space:
mode:
authorFrédéric Desbiens <[email protected]>2026-03-06 19:27:49 +0100
committerGitHub <[email protected]>2026-03-06 19:27:49 +0100
commit3726d7906b4808bfec7855fc088e073199df9120 (patch)
tree8789bfd03d1d49e1967e80d04aa4ff606fda43eb /ports/rxv3/iar/src
parent4b6e8100d932a3a67b34c6eb17f84f3bffb9e2ae (diff)
parentc3259a216026372e3833dd8996a68f77e8595fbd (diff)
Merge pull request #510 from eclipse-threadx/devv6.5.0.202601_rel
Merge changes ahead of the v6.5.0.202601 release
Diffstat (limited to 'ports/rxv3/iar/src')
-rw-r--r--ports/rxv3/iar/src/tx_initialize_low_level.s88
-rw-r--r--ports/rxv3/iar/src/tx_thread_context_restore.s101
-rw-r--r--ports/rxv3/iar/src/tx_thread_context_save.s96
-rw-r--r--ports/rxv3/iar/src/tx_thread_interrupt_control.s94
-rw-r--r--ports/rxv3/iar/src/tx_thread_schedule.s95
-rw-r--r--ports/rxv3/iar/src/tx_thread_stack_build.s36
-rw-r--r--ports/rxv3/iar/src/tx_thread_system_return.s20
-rw-r--r--ports/rxv3/iar/src/tx_timer_interrupt.s38
8 files changed, 235 insertions, 333 deletions
diff --git a/ports/rxv3/iar/src/tx_initialize_low_level.s b/ports/rxv3/iar/src/tx_initialize_low_level.s
index 5b0c04e5..c40b4300 100644
--- a/ports/rxv3/iar/src/tx_initialize_low_level.s
+++ b/ports/rxv3/iar/src/tx_initialize_low_level.s
@@ -1,18 +1,18 @@
;/***************************************************************************
-; * Copyright (c) 2024 Microsoft Corporation
-; *
+; * Copyright (c) 2024 Microsoft Corporation
+; *
; * This program and the accompanying materials are made available under the
; * terms of the MIT License which is available at
; * https://opensource.org/licenses/MIT.
-; *
+; *
; * SPDX-License-Identifier: MIT
; **************************************************************************/
;
;
;/**************************************************************************/
;/**************************************************************************/
-;/** */
-;/** ThreadX Component */
+;/** */
+;/** ThreadX Component */
;/** */
;/** Initialize */
;/** */
@@ -25,53 +25,41 @@
section .text:CODE:ROOT
;
-;/**************************************************************************/
-;/* */
-;/* FUNCTION RELEASE */
-;/* */
+;/**************************************************************************/
+;/* */
+;/* FUNCTION RELEASE */
+;/* */
;/* _tx_initialize_low_level RXv3/IAR */
;/* 6.1.11 */
-;/* AUTHOR */
-;/* */
+;/* AUTHOR */
+;/* */
;/* William E. Lamie, Microsoft Corporation */
-;/* */
-;/* DESCRIPTION */
-;/* */
-;/* This function is responsible for any low-level processor */
-;/* initialization, including setting up interrupt vectors, setting */
-;/* up a periodic timer interrupt source, saving the system stack */
-;/* pointer for use in ISR processing later, and finding the first */
-;/* available RAM memory address for tx_application_define. */
-;/* */
-;/* INPUT */
-;/* */
-;/* None */
-;/* */
-;/* OUTPUT */
-;/* */
-;/* None */
-;/* */
-;/* CALLS */
-;/* */
-;/* None */
-;/* */
-;/* CALLED BY */
-;/* */
-;/* _tx_initialize_kernel_enter ThreadX entry function */
-;/* */
-;/* RELEASE HISTORY */
-;/* */
-;/* DATE NAME DESCRIPTION */
-;/* */
-;/* 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 */
-;/* 04-25-2022 William E. Lamie Modified comment(s), */
-;/* resulting in version 6.1.11 */
-;/* */
-;/**************************************************************************/
+;/* */
+;/* DESCRIPTION */
+;/* */
+;/* This function is responsible for any low-level processor */
+;/* initialization, including setting up interrupt vectors, setting */
+;/* up a periodic timer interrupt source, saving the system stack */
+;/* pointer for use in ISR processing later, and finding the first */
+;/* available RAM memory address for tx_application_define. */
+;/* */
+;/* INPUT */
+;/* */
+;/* None */
+;/* */
+;/* OUTPUT */
+;/* */
+;/* None */
+;/* */
+;/* CALLS */
+;/* */
+;/* None */
+;/* */
+;/* CALLED BY */
+;/* */
+;/* _tx_initialize_kernel_enter ThreadX entry function */
+;/* */
+;/**************************************************************************/
public __tx_initialize_low_level
__tx_initialize_low_level:
@@ -80,7 +68,7 @@ __tx_initialize_low_level:
; _tx_initialize_unused_memory = (VOID_PTR) &free_mem_start;
;
MOV.L #__tx_free_memory_start, R1 ; Pickup unused memory address
- MOV.L #__tx_initialize_unused_memory,R2
+ MOV.L #__tx_initialize_unused_memory,R2
MOV.L R1,[R2] ; Save first free memory address
; /* Set priority of SWINT to 1. */
diff --git a/ports/rxv3/iar/src/tx_thread_context_restore.s b/ports/rxv3/iar/src/tx_thread_context_restore.s
index 9306d159..f6d0e605 100644
--- a/ports/rxv3/iar/src/tx_thread_context_restore.s
+++ b/ports/rxv3/iar/src/tx_thread_context_restore.s
@@ -1,18 +1,18 @@
;/***************************************************************************
-; * Copyright (c) 2024 Microsoft Corporation
-; *
+; * Copyright (c) 2024 Microsoft Corporation
+; *
; * This program and the accompanying materials are made available under the
; * terms of the MIT License which is available at
; * https://opensource.org/licenses/MIT.
-; *
+; *
; * SPDX-License-Identifier: MIT
; **************************************************************************/
;
;
;/**************************************************************************/
;/**************************************************************************/
-;/** */
-;/** ThreadX Component */
+;/** */
+;/** ThreadX Component */
;/** */
;/** Thread */
;/** */
@@ -39,53 +39,40 @@
section .text:CODE:ROOT
-;/**************************************************************************/
-;/* */
-;/* FUNCTION RELEASE */
-;/* */
+;/**************************************************************************/
+;/* */
+;/* FUNCTION RELEASE */
+;/* */
;/* _tx_thread_context_restore RXv3/IAR */
;/* 6.1.11 */
-;/* AUTHOR */
-;/* */
+;/* AUTHOR */
+;/* */
;/* William E. Lamie, Microsoft Corporation */
-;/* */
-;/* DESCRIPTION */
-;/* */
-;/* This function restores the interrupt context if it is processing a */
-;/* nested interrupt. If not, it returns to the interrupt thread if no */
-;/* preemption is necessary. Otherwise, if preemption is necessary or */
-;/* if no thread was running, the function returns to the scheduler. */
-;/* */
-;/* INPUT */
-;/* */
-;/* None */
-;/* */
-;/* OUTPUT */
-;/* */
-;/* None */
-;/* */
-;/* CALLS */
-;/* */
-;/* _tx_thread_schedule Thread scheduling routine */
-;/* */
-;/* CALLED BY */
-;/* */
-;/* ISRs Interrupt Service Routines */
-;/* */
-;/* RELEASE HISTORY */
-;/* */
-;/* DATE NAME DESCRIPTION */
-;/* */
-;/* 06-02-2021 William E. Lamie Initial Version 6.1.7 */
-;/* 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 */
-;/* 04-25-2022 William E. Lamie Modified comment(s), */
-;/* resulting in version 6.1.11 */
-;/* */
-;/**************************************************************************/
+;/* */
+;/* DESCRIPTION */
+;/* */
+;/* This function restores the interrupt context if it is processing a */
+;/* nested interrupt. If not, it returns to the interrupt thread if no */
+;/* preemption is necessary. Otherwise, if preemption is necessary or */
+;/* if no thread was running, the function returns to the scheduler. */
+;/* */
+;/* INPUT */
+;/* */
+;/* None */
+;/* */
+;/* OUTPUT */
+;/* */
+;/* None */
+;/* */
+;/* CALLS */
+;/* */
+;/* _tx_thread_schedule Thread scheduling routine */
+;/* */
+;/* CALLED BY */
+;/* */
+;/* ISRs Interrupt Service Routines */
+;/* */
+;/**************************************************************************/
public __tx_thread_context_restore
__tx_thread_context_restore:
@@ -102,7 +89,7 @@ __tx_thread_context_restore:
MOV.L [R1], R2
SUB #1, R2
MOV.L R2,[R1]
- BEQ __tx_thread_not_nested_restore
+ BEQ __tx_thread_not_nested_restore
;
; /* Interrupts are nested. */
@@ -111,7 +98,7 @@ __tx_thread_context_restore:
; and return to the point of interrupt. */
;
__tx_thread_nested_restore:
- POPC FPSW ; Restore FPU status
+ POPC FPSW ; Restore FPU status
POPM R14-R15 ; Restore R14-R15
POPM R3-R5 ; Restore R3-R5
POPM R1-R2 ; Restore R1-R2
@@ -124,17 +111,17 @@ __tx_thread_not_nested_restore:
; else if (((_tx_thread_current_ptr) && (_tx_thread_current_ptr == _tx_thread_execute_ptr))
; || (_tx_thread_preempt_disable))
; {
-
+
MOV.L #__tx_thread_current_ptr, R1 ; Pickup current thread ptr address
MOV.L [R1], R2
CMP #0, R2
- BEQ __tx_thread_idle_system_restore
-
+ BEQ __tx_thread_idle_system_restore
+
MOV.L #__tx_thread_preempt_disable, R3 ; Pick up preempt disable flag
MOV.L [R3], R3
CMP #0, R3
BNE __tx_thread_no_preempt_restore ; If pre-empt disable flag set, we simply return to the original point of interrupt regardless
-
+
MOV.L #__tx_thread_execute_ptr, R3 ; (_tx_thread_current_ptr != _tx_thread_execute_ptr)
CMP [R3], R2
BNE __tx_thread_preempt_restore ; Jump to pre-empt restoring
@@ -175,7 +162,7 @@ __tx_thread_dont_save_ts:
SETPSW U ; User stack
PUSHM R6-R13
-
+
MVFACGU #0, A1, R4 ; Save accumulators.
MVFACHI #0, A1, R5
MVFACLO #0, A1, R6
@@ -184,7 +171,7 @@ __tx_thread_dont_save_ts:
MVFACHI #0, A0, R5
MVFACLO #0, A0, R6
PUSHM R4-R6
-
+
#if (__DPFPU == 1)
MOV.L 144[R2], R4 ; Get tx_thread_fpu_enable.
CMP #0, R4
diff --git a/ports/rxv3/iar/src/tx_thread_context_save.s b/ports/rxv3/iar/src/tx_thread_context_save.s
index f6128347..91ac51a1 100644
--- a/ports/rxv3/iar/src/tx_thread_context_save.s
+++ b/ports/rxv3/iar/src/tx_thread_context_save.s
@@ -1,18 +1,18 @@
;/***************************************************************************
-; * Copyright (c) 2024 Microsoft Corporation
-; *
+; * Copyright (c) 2024 Microsoft Corporation
+; *
; * This program and the accompanying materials are made available under the
; * terms of the MIT License which is available at
; * https://opensource.org/licenses/MIT.
-; *
+; *
; * SPDX-License-Identifier: MIT
; **************************************************************************/
;
;
;/**************************************************************************/
;/**************************************************************************/
-;/** */
-;/** ThreadX Component */
+;/** */
+;/** ThreadX Component */
;/** */
;/** Thread */
;/** */
@@ -33,51 +33,39 @@
extern __tx_thread_current_ptr
section .text:CODE:ROOT
-;/**************************************************************************/
-;/* */
-;/* FUNCTION RELEASE */
-;/* */
+;/**************************************************************************/
+;/* */
+;/* FUNCTION RELEASE */
+;/* */
;/* _tx_thread_context_save RXv3/IAR */
;/* 6.1.11 */
-;/* AUTHOR */
-;/* */
+;/* AUTHOR */
+;/* */
;/* William E. Lamie, Microsoft Corporation */
-;/* */
-;/* DESCRIPTION */
-;/* */
-;/* This function saves the context of an executing thread in the */
-;/* beginning of interrupt processing. The function also ensures that */
-;/* the system stack is used upon return to the calling ISR. */
-;/* */
-;/* INPUT */
-;/* */
-;/* None */
-;/* */
-;/* OUTPUT */
-;/* */
-;/* None */
-;/* */
-;/* CALLS */
-;/* */
-;/* None */
-;/* */
-;/* CALLED BY */
-;/* */
-;/* ISRs */
-;/* */
-;/* RELEASE HISTORY */
-;/* */
-;/* DATE NAME DESCRIPTION */
-;/* */
-;/* 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 */
-;/* 04-25-2022 William E. Lamie Modified comment(s), */
-;/* resulting in version 6.1.11 */
-;/* */
-;/**************************************************************************/
+;/* */
+;/* DESCRIPTION */
+;/* */
+;/* This function saves the context of an executing thread in the */
+;/* beginning of interrupt processing. The function also ensures that */
+;/* the system stack is used upon return to the calling ISR. */
+;/* */
+;/* INPUT */
+;/* */
+;/* None */
+;/* */
+;/* OUTPUT */
+;/* */
+;/* None */
+;/* */
+;/* CALLS */
+;/* */
+;/* None */
+;/* */
+;/* CALLED BY */
+;/* */
+;/* ISRs */
+;/* */
+;/**************************************************************************/
;VOID _tx_thread_context_save(VOID)
;{
public __tx_thread_context_save
@@ -104,7 +92,7 @@ __tx_thread_context_save:
BEQ __tx_thread_not_nested_save
;
; /* Nested interrupt condition. */
-;
+;
ADD #1, r2 ; _tx_thread_system_state++
MOV.L r2, [r1]
@@ -130,7 +118,7 @@ __tx_thread_not_nested_save:
MOV.L #__tx_thread_current_ptr, R2 ; Pickup current thread pointer
MOV.L [R2], R2
- CMP #0,R2 ; Is it NULL?
+ CMP #0,R2 ; Is it NULL?
BEQ __tx_thread_idle_system_save ; Yes, idle system is running - idle restore
;
; /* Move stack frame over to the current threads stack. */
@@ -142,9 +130,9 @@ __tx_thread_not_nested_save:
MOV.L 12[R0], R2
MOV.L R2, [-R1] ; Save PC on thread stack
MOV.L 8[R0], R2
- MOV.L R2, [-R1] ; Save R2 on thread stack
+ MOV.L R2, [-R1] ; Save R2 on thread stack
MOV.L 4[R0], R2
- MOV.L R2, [-R1] ; Save R1 on thread stack
+ MOV.L R2, [-R1] ; Save R1 on thread stack
MOV.L R5, [-R1] ; Save R5 on thread stack
MOV.L R4, [-R1] ; Save R4 on thread stack
MOV.L R3, [-R1] ; Save R3 on thread stack
@@ -152,9 +140,9 @@ __tx_thread_not_nested_save:
MOV.L R14, [-R1] ; Save R14 on thread stack
MVFC FPSW, R3
MOV.L R3, [-R1] ; Save FPSW on thread stack
-
+
POP R2 ; Pick up return address from interrupt stack
- ADD #16, R0, R0 ; Correct interrupt stack pointer back to the bottom
+ ADD #16, R0, R0 ; Correct interrupt stack pointer back to the bottom
MVTC R1, USP ; Set user/thread stack pointer
JMP R2 ; Return to ISR
@@ -171,6 +159,6 @@ __tx_thread_idle_system_save:
JMP R1 ; Return to caller
;
; }
-;}
+;}
END
diff --git a/ports/rxv3/iar/src/tx_thread_interrupt_control.s b/ports/rxv3/iar/src/tx_thread_interrupt_control.s
index 9db56216..b642cd22 100644
--- a/ports/rxv3/iar/src/tx_thread_interrupt_control.s
+++ b/ports/rxv3/iar/src/tx_thread_interrupt_control.s
@@ -1,18 +1,18 @@
;/***************************************************************************
-; * Copyright (c) 2024 Microsoft Corporation
-; *
+; * Copyright (c) 2024 Microsoft Corporation
+; *
; * This program and the accompanying materials are made available under the
; * terms of the MIT License which is available at
; * https://opensource.org/licenses/MIT.
-; *
+; *
; * SPDX-License-Identifier: MIT
; **************************************************************************/
;
;
;/**************************************************************************/
;/**************************************************************************/
-;/** */
-;/** ThreadX Component */
+;/** */
+;/** ThreadX Component */
;/** */
;/** Thread */
;/** */
@@ -28,50 +28,38 @@
;#include "tx_thread.h"
;
section .text:CODE:ROOT
-;/**************************************************************************/
-;/* */
-;/* FUNCTION RELEASE */
-;/* */
+;/**************************************************************************/
+;/* */
+;/* FUNCTION RELEASE */
+;/* */
;/* _tx_thread_interrupt_control RXv3/IAR */
;/* 6.1.11 */
-;/* AUTHOR */
-;/* */
+;/* AUTHOR */
+;/* */
;/* William E. Lamie, Microsoft Corporation */
-;/* */
-;/* DESCRIPTION */
-;/* */
-;/* This function is responsible for changing the interrupt lockout */
-;/* posture of the system. */
-;/* */
-;/* INPUT */
-;/* */
-;/* new_posture New interrupt lockout posture */
-;/* */
-;/* OUTPUT */
-;/* */
-;/* old_posture Old interrupt lockout posture */
-;/* */
-;/* CALLS */
-;/* */
-;/* None */
-;/* */
-;/* CALLED BY */
-;/* */
-;/* Application Code */
-;/* */
-;/* RELEASE HISTORY */
-;/* */
-;/* DATE NAME DESCRIPTION */
-;/* */
-;/* 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 */
-;/* 04-25-2022 William E. Lamie Modified comment(s), */
-;/* resulting in version 6.1.11 */
-;/* */
-;/**************************************************************************/
+;/* */
+;/* DESCRIPTION */
+;/* */
+;/* This function is responsible for changing the interrupt lockout */
+;/* posture of the system. */
+;/* */
+;/* INPUT */
+;/* */
+;/* new_posture New interrupt lockout posture */
+;/* */
+;/* OUTPUT */
+;/* */
+;/* old_posture Old interrupt lockout posture */
+;/* */
+;/* CALLS */
+;/* */
+;/* None */
+;/* */
+;/* CALLED BY */
+;/* */
+;/* Application Code */
+;/* */
+;/**************************************************************************/
;UINT _tx_thread_interrupt_control(UINT new_posture)
;{
public __tx_thread_interrupt_control
@@ -79,20 +67,20 @@ __tx_thread_interrupt_control:
;
; /* Pickup current interrupt lockout posture. */
;
-
+
MVFC PSW, R2 ; Save PSW to R2
MOV.L R2, R3 ; Make a copy of PSW in r3
-
+
;
; /* Apply the new interrupt posture. */
;
-
+
BTST #16, R1 ; Test I bit of PSW of "new posture"
- BMNE #16, R2 ; Conditionally set I bit of intermediate posture
-
+ BMNE #16, R2 ; Conditionally set I bit of intermediate posture
+
MVTC R2, PSW ; Save intermediate posture to PSW
-
- MOV.L R3,R1 ; Get original SR
+
+ MOV.L R3,R1 ; Get original SR
RTS ; Return to caller
;}
END
diff --git a/ports/rxv3/iar/src/tx_thread_schedule.s b/ports/rxv3/iar/src/tx_thread_schedule.s
index 37f82438..5df75776 100644
--- a/ports/rxv3/iar/src/tx_thread_schedule.s
+++ b/ports/rxv3/iar/src/tx_thread_schedule.s
@@ -1,18 +1,18 @@
;/***************************************************************************
-; * Copyright (c) 2024 Microsoft Corporation
-; *
+; * Copyright (c) 2024 Microsoft Corporation
+; *
; * This program and the accompanying materials are made available under the
; * terms of the MIT License which is available at
; * https://opensource.org/licenses/MIT.
-; *
+; *
; * SPDX-License-Identifier: MIT
; **************************************************************************/
;
;
;/**************************************************************************/
;/**************************************************************************/
-;/** */
-;/** ThreadX Component */
+;/** */
+;/** ThreadX Component */
;/** */
;/** Thread */
;/** */
@@ -41,52 +41,41 @@
section .text:CODE:ROOT
-;/**************************************************************************/
-;/* */
-;/* FUNCTION RELEASE */
-;/* */
+;/**************************************************************************/
+;/* */
+;/* FUNCTION RELEASE */
+;/* */
;/* _tx_thread_schedule RXv3/IAR */
;/* 6.1.11 */
-;/* AUTHOR */
-;/* */
+;/* AUTHOR */
+;/* */
;/* William E. Lamie, Microsoft Corporation */
-;/* */
-;/* DESCRIPTION */
-;/* */
-;/* This function waits for a thread control block pointer to appear in */
-;/* the _tx_thread_execute_ptr variable. Once a thread pointer appears */
-;/* in the variable, the corresponding thread is resumed. */
-;/* */
-;/* INPUT */
-;/* */
-;/* None */
-;/* */
-;/* OUTPUT */
-;/* */
+;/* */
+;/* DESCRIPTION */
+;/* */
+;/* This function waits for a thread control block pointer to appear in */
+;/* the _tx_thread_execute_ptr variable. Once a thread pointer appears */
+;/* in the variable, the corresponding thread is resumed. */
+;/* */
+;/* INPUT */
+;/* */
+;/* None */
+;/* */
+;/* OUTPUT */
+;/* */
;/* None */
-;/* */
-;/* CALLS */
-;/* */
+;/* */
+;/* CALLS */
+;/* */
;/* None */
-;/* */
-;/* CALLED BY */
-;/* */
-;/* _tx_initialize_kernel_enter ThreadX entry function */
-;/* _tx_thread_system_return Return to system from thread */
-;/* _tx_thread_context_restore Restore thread's context */
-;/* */
-;/* RELEASE HISTORY */
-;/* */
-;/* DATE NAME DESCRIPTION */
-;/* */
-;/* 06-02-2021 William E. Lamie Initial Version 6.1.7 */
-;/* 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 */
-;/* */
-;/**************************************************************************/
+;/* */
+;/* CALLED BY */
+;/* */
+;/* _tx_initialize_kernel_enter ThreadX entry function */
+;/* _tx_thread_system_return Return to system from thread */
+;/* _tx_thread_context_restore Restore thread's context */
+;/* */
+;/**************************************************************************/
;VOID _tx_thread_schedule(VOID)
;{
public __tx_thread_schedule
@@ -104,7 +93,7 @@ __tx_thread_schedule_loop:
MOV.L [R1],R2 ; Pickup next thread to execute
CMP #0,R2 ; Is it NULL?
BNE __tx_thread_thread_ready ; Not NULL, schedule the thread
- ; Idle system - no thread is ready
+ ; 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
@@ -133,7 +122,7 @@ __tx_thread_thread_ready:
;
; }
; while(_tx_thread_execute_ptr == TX_NULL);
-;
+;
; /* Yes! We have a thread to execute. Note that interrupts are locked out at this point. */
;
; /* Setup the current thread pointer. */
@@ -145,7 +134,7 @@ __tx_thread_thread_ready:
; /* Increment the run count for this thread. */
; _tx_thread_current_ptr -> tx_thread_run_count++;
;
- MOV.L 4[R2],R3 ; Pickup run count
+ MOV.L 4[R2],R3 ; Pickup run count
ADD #1,R3 ; Increment run counter
MOV.L R3,4[R2] ; Store it back in control block
;
@@ -154,7 +143,7 @@ __tx_thread_thread_ready:
;
MOV.L 24[R2],R3 ; Pickup thread time-slice
MOV.L #__tx_timer_time_slice,R4 ; Pickup pointer to time-slice
- MOV.L R3, [R4] ; Setup time-slice
+ MOV.L R3, [R4] ; Setup time-slice
;
; /* Switch to the thread's stack. */
; SP = _tx_thread_execute_ptr -> tx_thread_stack_ptr;
@@ -180,12 +169,12 @@ __tx_thread_schedule_fpu_skip:
MVTACLO R3, A1
MVTACHI R2, A1
MVTACGU R1, A1
-
+
POPM R6-R13 ; Recover interrupt stack frame
- POPC FPSW
+ POPC FPSW
POPM R14-R15
POPM R3-R5
- POPM R1-R2
+ POPM R1-R2
RTE ; Return to point of interrupt, this restores PC and PSW
;
diff --git a/ports/rxv3/iar/src/tx_thread_stack_build.s b/ports/rxv3/iar/src/tx_thread_stack_build.s
index a5872e63..6a1064b0 100644
--- a/ports/rxv3/iar/src/tx_thread_stack_build.s
+++ b/ports/rxv3/iar/src/tx_thread_stack_build.s
@@ -1,10 +1,10 @@
;/***************************************************************************
-; * Copyright (c) 2024 Microsoft Corporation
-; *
+; * Copyright (c) 2024 Microsoft Corporation
+; *
; * This program and the accompanying materials are made available under the
; * terms of the MIT License which is available at
; * https://opensource.org/licenses/MIT.
-; *
+; *
; * SPDX-License-Identifier: MIT
; **************************************************************************/
;
@@ -55,28 +55,16 @@
;/* */
;/* _tx_thread_create Create thread service */
;/* */
-;/* RELEASE HISTORY */
-;/* */
-;/* DATE NAME DESCRIPTION */
-;/* */
-;/* 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 */
-;/* 04-25-2022 William E. Lamie Modified comment(s), */
-;/* resulting in version 6.1.11 */
-;/* */
;/**************************************************************************/
public __tx_thread_stack_build
__tx_thread_stack_build:
;
-;
+;
; /* Build an interrupt frame. The form of the fake interrupt stack
; on the Renesas RX should look like the following after it is built:
-;
+;
; Stack Top: ACC0
; ACC1
; R6
@@ -112,22 +100,22 @@ __tx_thread_stack_build:
MOV.L R2, [-R3] ; Initial PC
MOV.L #0, R4
MOV.L R4,[-R3] ; Initial R2 ...
- MOV.L R4,[-R3] ; Initial R1 ...
+ MOV.L R4,[-R3] ; Initial R1 ...
MOV.L R4,[-R3] ; Initial R5 ...
MOV.L R4,[-R3] ; Initial R4 ...
- MOV.L R4,[-R3] ; Initial R3 ...
+ MOV.L R4,[-R3] ; Initial R3 ...
MOV.L R4,[-R3] ; Initial R15 ...
MOV.L R4,[-R3] ; Initial R14 ...
MVFC FPSW, r4
MOV.L R4, [-R3] ; Initial FPSW
MOV.L #0, R4
- MOV.L R4,[-R3] ; Initial R13 ...
+ MOV.L R4,[-R3] ; Initial R13 ...
MOV.L R4,[-R3] ; Initial R12 ...
MOV.L R4,[-R3] ; Initial R11 ...
- MOV.L R4,[-R3] ; Initial R10 ...
+ MOV.L R4,[-R3] ; Initial R10 ...
MOV.L R4,[-R3] ; Initial R9 ...
MOV.L R4,[-R3] ; Initial R8 ...
- MOV.L R4,[-R3] ; Initial R7 ...
+ MOV.L R4,[-R3] ; Initial R7 ...
MOV.L R4,[-R3] ; Initial R6 ...
MOV.L R4,[-R3] ; Accumulator 1
@@ -139,11 +127,11 @@ __tx_thread_stack_build:
MOV.L R4,[-R3]
; /* Setup stack pointer. */
-; thread_ptr -> tx_thread_stack_ptr = R1;
+; thread_ptr -> tx_thread_stack_ptr = R1;
MOV.L R3, 8[R1]
; Store initial SP in thread control block
RTS
-
+
;}
END
diff --git a/ports/rxv3/iar/src/tx_thread_system_return.s b/ports/rxv3/iar/src/tx_thread_system_return.s
index 160d90c3..05d20217 100644
--- a/ports/rxv3/iar/src/tx_thread_system_return.s
+++ b/ports/rxv3/iar/src/tx_thread_system_return.s
@@ -1,10 +1,10 @@
;/***************************************************************************
-; * Copyright (c) 2024 Microsoft Corporation
-; *
+; * Copyright (c) 2024 Microsoft Corporation
+; *
; * This program and the accompanying materials are made available under the
; * terms of the MIT License which is available at
; * https://opensource.org/licenses/MIT.
-; *
+; *
; * SPDX-License-Identifier: MIT
; **************************************************************************/
;
@@ -20,7 +20,7 @@
;/**************************************************************************/
section .text:CODE:ROOT
-
+
;/**************************************************************************/
;/* */
;/* FUNCTION RELEASE */
@@ -54,18 +54,6 @@
;/* */
;/* ThreadX components */
;/* */
-;/* RELEASE HISTORY */
-;/* */
-;/* DATE NAME DESCRIPTION */
-;/* */
-;/* 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 */
-;/* 04-25-2022 William E. Lamie Modified comment(s), */
-;/* resulting in version 6.1.11 */
-;/* */
;/**************************************************************************/
public __tx_thread_system_return
diff --git a/ports/rxv3/iar/src/tx_timer_interrupt.s b/ports/rxv3/iar/src/tx_timer_interrupt.s
index 78f0cf98..f96c2317 100644
--- a/ports/rxv3/iar/src/tx_timer_interrupt.s
+++ b/ports/rxv3/iar/src/tx_timer_interrupt.s
@@ -1,10 +1,10 @@
;/***************************************************************************
-; * Copyright (c) 2024 Microsoft Corporation
-; *
+; * Copyright (c) 2024 Microsoft Corporation
+; *
; * This program and the accompanying materials are made available under the
; * terms of the MIT License which is available at
; * https://opensource.org/licenses/MIT.
-; *
+; *
; * SPDX-License-Identifier: MIT
; **************************************************************************/
;
@@ -74,20 +74,6 @@ SWI0 EQU 0x872E0
;/* */
;/* interrupt vector */
;/* */
-;/* RELEASE HISTORY */
-;/* */
-;/* DATE NAME DESCRIPTION */
-;/* */
-;/* 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 */
-;/* 04-25-2022 William E. Lamie Modified comment(s), */
-;/* resulting in version 6.1.11 */
-;/* */
;/**************************************************************************/
public __tx_timer_interrupt
@@ -150,14 +136,14 @@ __tx_timer_no_time_slice:
MOV.L [R2+], R1 ; pickup timer list entry, _tx_timer_current_ptr++
CMP #0, R1 ; Is timer pointer NULL?
BEQ __tx_timer_no_timer ; Yes, no timer has expired
-
+
;
; /* Set expiration flag. */
; _tx_timer_expired = TX_TRUE;
;
MOV.L #__tx_timer_expired,R2 ; Build address of expired flag
MOV.L #1, R1 ; Build expired value
- MOV.L R1, [R2]
+ MOV.L R1, [R2]
BRA __tx_timer_done ; Finished with timer processing
;
; }
@@ -168,7 +154,7 @@ __tx_timer_no_timer:
; /* No timer expired, increment the timer pointer. */
; _tx_timer_current_ptr++;
;
-; /* R2 already contains __tx_timer_current_ptr++ */
+; /* R2 already contains __tx_timer_current_ptr++ */
;
; /* Check for wrap-around. */
; if (_tx_timer_current_ptr == _tx_timer_list_end)
@@ -187,9 +173,9 @@ __tx_timer_no_timer:
; }
;
__tx_timer_skip_wrap:
- MOV.L #__tx_timer_current_ptr,R1
- MOV.L R2, [R1] ; Store in updated pointer in _tx_timer_current_ptr
-
+ MOV.L #__tx_timer_current_ptr,R1
+ MOV.L R2, [R1] ; Store in updated pointer in _tx_timer_current_ptr
+
__tx_timer_done:
;
; /* See if anything has expired. */
@@ -223,14 +209,14 @@ __tx_timer_dont_activate:
; /* Did time slice expire? */
; if (_tx_timer_expired_time_slice)
; {
-;
+;
MOV.L #__tx_timer_expired_time_slice, R1 ; Pickup time-slice expired flag addr
MOV.L [R1], R1 ; Pickup actual flag
CMP #0,R1 ; Has time-slice expired?
BEQ __tx_timer_not_ts_expiration ; No, skip time-slice expiration
;
; /* Time slice interrupted thread. */
-; _tx_thread_time_slice();
+; _tx_thread_time_slice();
BSR __tx_thread_time_slice ; Call time-slice processing
@@ -249,7 +235,7 @@ __tx_timer_dont_activate:
MOV.L #SWI0, R1
MOV.L #1, [R1]
-
+
; }
;
__tx_timer_not_ts_expiration: