diff options
Diffstat (limited to 'ports/rxv1/iar/src')
| -rw-r--r-- | ports/rxv1/iar/src/tx_initialize_low_level.s | 20 | ||||
| -rw-r--r-- | ports/rxv1/iar/src/tx_thread_context_restore.s | 34 | ||||
| -rw-r--r-- | ports/rxv1/iar/src/tx_thread_context_save.s | 26 | ||||
| -rw-r--r-- | ports/rxv1/iar/src/tx_thread_interrupt_control.s | 34 | ||||
| -rw-r--r-- | ports/rxv1/iar/src/tx_thread_schedule.s | 29 | ||||
| -rw-r--r-- | ports/rxv1/iar/src/tx_thread_stack_build.s | 28 | ||||
| -rw-r--r-- | ports/rxv1/iar/src/tx_thread_system_return.s | 20 | ||||
| -rw-r--r-- | ports/rxv1/iar/src/tx_timer_interrupt.s | 34 |
8 files changed, 60 insertions, 165 deletions
diff --git a/ports/rxv1/iar/src/tx_initialize_low_level.s b/ports/rxv1/iar/src/tx_initialize_low_level.s index 081f529c..edff1d8f 100644 --- a/ports/rxv1/iar/src/tx_initialize_low_level.s +++ b/ports/rxv1/iar/src/tx_initialize_low_level.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 ; **************************************************************************/ ; @@ -59,18 +59,6 @@ ;/* */ ;/* _tx_initialize_kernel_enter ThreadX entry function */ ;/* */ -;/* RELEASE HISTORY */ -;/* */ -;/* DATE NAME DESCRIPTION */ -;/* */ -;/* 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 */ -;/* 04-25-2022 William E. Lamie Modified comment(s), */ -;/* resulting in version 6.1.11 */ -;/* */ ;/**************************************************************************/ public __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/rxv1/iar/src/tx_thread_context_restore.s b/ports/rxv1/iar/src/tx_thread_context_restore.s index 4abefcc9..6b3c17c8 100644 --- a/ports/rxv1/iar/src/tx_thread_context_restore.s +++ b/ports/rxv1/iar/src/tx_thread_context_restore.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 ; **************************************************************************/ ; @@ -61,20 +61,6 @@ ;/* */ ;/* ISRs Interrupt Service Routines */ ;/* */ -;/* RELEASE HISTORY */ -;/* */ -;/* DATE NAME DESCRIPTION */ -;/* */ -;/* 08-02-2021 William E. Lamie Initial Version 6.1.8 */ -;/* 10-15-2021 William E. Lamie Modified comment(s), and */ -;/* 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 */ -;/* 04-25-2022 William E. Lamie Modified comment(s), */ -;/* resulting in version 6.1.11 */ -;/* */ ;/**************************************************************************/ public __tx_thread_context_restore @@ -92,7 +78,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. */ @@ -113,17 +99,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 @@ -163,11 +149,11 @@ __tx_thread_dont_save_ts: SETPSW U ; User stack PUSHM R6-R13 - + MVFACHI R5 MVFACMI R6 PUSHM R5-R6 - + ; ; /* Clear the current task pointer. */ ; _tx_thread_current_ptr = TX_NULL; diff --git a/ports/rxv1/iar/src/tx_thread_context_save.s b/ports/rxv1/iar/src/tx_thread_context_save.s index b79ba6f4..4e613330 100644 --- a/ports/rxv1/iar/src/tx_thread_context_save.s +++ b/ports/rxv1/iar/src/tx_thread_context_save.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,18 +55,6 @@ ;/* */ ;/* ISRs */ ;/* */ -;/* RELEASE HISTORY */ -;/* */ -;/* DATE NAME DESCRIPTION */ -;/* */ -;/* 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 */ -;/* 04-25-2022 William E. Lamie Modified comment(s), */ -;/* resulting in version 6.1.11 */ -;/* */ ;/**************************************************************************/ ;VOID _tx_thread_context_save(VOID) ;{ @@ -94,7 +82,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] @@ -119,7 +107,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. */ @@ -139,7 +127,7 @@ __tx_thread_not_nested_save: MOV.L R3, [-R1] ; Save R3 on thread stack MOV.L R15, [-R1] ; Save R15 on thread stack MOV.L R14, [-R1] ; Save R14 on thread stack - + POP R2 ; Pick up return address from interrupt stack ADD #16, R0, R0 ; Correct interrupt stack pointer back to the bottom MVTC R1, USP ; Set user/thread stack pointer @@ -158,5 +146,5 @@ __tx_thread_idle_system_save: JMP R1 ; Return to caller ; ; } -;} +;} END diff --git a/ports/rxv1/iar/src/tx_thread_interrupt_control.s b/ports/rxv1/iar/src/tx_thread_interrupt_control.s index 3c510df7..bd945bfc 100644 --- a/ports/rxv1/iar/src/tx_thread_interrupt_control.s +++ b/ports/rxv1/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 */ ;/** */ @@ -51,18 +51,6 @@ ;/* */ ;/* Application Code */ ;/* */ -;/* RELEASE HISTORY */ -;/* */ -;/* DATE NAME DESCRIPTION */ -;/* */ -;/* 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 */ -;/* 04-25-2022 William E. Lamie Modified comment(s), */ -;/* resulting in version 6.1.11 */ -;/* */ ;/**************************************************************************/ ;UINT _tx_thread_interrupt_control(UINT new_posture) ;{ @@ -71,20 +59,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 - + 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/rxv1/iar/src/tx_thread_schedule.s b/ports/rxv1/iar/src/tx_thread_schedule.s index 2602d46b..86fa3785 100644 --- a/ports/rxv1/iar/src/tx_thread_schedule.s +++ b/ports/rxv1/iar/src/tx_thread_schedule.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 ; **************************************************************************/ ; @@ -64,21 +64,6 @@ ;/* _tx_thread_system_return Return to system from thread */ ;/* _tx_thread_context_restore Restore thread's context */ ;/* */ -;/* RELEASE HISTORY */ -;/* */ -;/* DATE NAME DESCRIPTION */ -;/* */ -;/* 08-02-2021 William E. Lamie Initial Version 6.1.8 */ -;/* 10-15-2021 William E. Lamie Modified comment(s), and */ -;/* 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 */ -;/* 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) ;{ @@ -97,7 +82,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 @@ -126,7 +111,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. */ @@ -164,9 +149,9 @@ __tx_thread_thread_ready: POPM R6-R13 ; Recover interrupt stack frame 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/rxv1/iar/src/tx_thread_stack_build.s b/ports/rxv1/iar/src/tx_thread_stack_build.s index 30809756..91694f64 100644 --- a/ports/rxv1/iar/src/tx_thread_stack_build.s +++ b/ports/rxv1/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,30 +55,16 @@ ;/* */ ;/* _tx_thread_create Create thread service */ ;/* */ -;/* RELEASE HISTORY */ -;/* */ -;/* DATE NAME DESCRIPTION */ -;/* */ -;/* 08-02-2021 William E. Lamie Initial Version 6.1.8 */ -;/* 10-15-2021 William E. Lamie Modified comment(s), and */ -;/* 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 */ -;/* 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 ; R6 ; R7 @@ -131,11 +117,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/rxv1/iar/src/tx_thread_system_return.s b/ports/rxv1/iar/src/tx_thread_system_return.s index b524fb7b..1d8f8020 100644 --- a/ports/rxv1/iar/src/tx_thread_system_return.s +++ b/ports/rxv1/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 */ -;/* */ -;/* 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 */ -;/* 04-25-2022 William E. Lamie Modified comment(s), */ -;/* resulting in version 6.1.11 */ -;/* */ ;/**************************************************************************/ public __tx_thread_system_return diff --git a/ports/rxv1/iar/src/tx_timer_interrupt.s b/ports/rxv1/iar/src/tx_timer_interrupt.s index ea330250..04917936 100644 --- a/ports/rxv1/iar/src/tx_timer_interrupt.s +++ b/ports/rxv1/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 ; **************************************************************************/ ; @@ -73,20 +73,6 @@ SWI0 EQU 0x872E0 ;/* */ ;/* interrupt vector */ ;/* */ -;/* RELEASE HISTORY */ -;/* */ -;/* DATE NAME DESCRIPTION */ -;/* */ -;/* 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 */ -;/* 04-25-2022 William E. Lamie Modified comment(s), */ -;/* resulting in version 6.1.11 */ -;/* */ ;/**************************************************************************/ public __tx_timer_interrupt @@ -149,14 +135,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 ; ; } @@ -167,7 +153,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) @@ -186,9 +172,9 @@ __tx_timer_no_timer: ; } ; __tx_timer_skip_wrap: - MOV.L #__tx_timer_current_ptr,R1 + 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. */ @@ -222,14 +208,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 |
