summaryrefslogtreecommitdiff
path: root/ports/c667x/ccs/src
diff options
context:
space:
mode:
Diffstat (limited to 'ports/c667x/ccs/src')
-rw-r--r--ports/c667x/ccs/src/tx_thread_context_restore.asm82
-rw-r--r--ports/c667x/ccs/src/tx_thread_context_save.asm72
-rw-r--r--ports/c667x/ccs/src/tx_thread_interrupt_control.asm64
-rw-r--r--ports/c667x/ccs/src/tx_thread_schedule.asm74
-rw-r--r--ports/c667x/ccs/src/tx_thread_stack_build.asm62
-rw-r--r--ports/c667x/ccs/src/tx_thread_system_return.asm80
-rw-r--r--ports/c667x/ccs/src/tx_timer_interrupt.asm110
7 files changed, 272 insertions, 272 deletions
diff --git a/ports/c667x/ccs/src/tx_thread_context_restore.asm b/ports/c667x/ccs/src/tx_thread_context_restore.asm
index 593881ba..496e413e 100644
--- a/ports/c667x/ccs/src/tx_thread_context_restore.asm
+++ b/ports/c667x/ccs/src/tx_thread_context_restore.asm
@@ -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 */
;/** */
@@ -43,41 +43,41 @@ SP .set B15
;
;
.sect ".text"
-;/**************************************************************************/
-;/* */
-;/* FUNCTION RELEASE */
-;/* */
-;/* _tx_thread_context_restore C667x/TI */
+;/**************************************************************************/
+;/* */
+;/* FUNCTION RELEASE */
+;/* */
+;/* _tx_thread_context_restore C667x/TI */
;/* 6.1 */
;/* 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 */
-;/* */
+;/* */
+;/* 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 */
;/* */
;/* 09-30-2020 William E. Lamie Initial Version 6.1 */
@@ -99,20 +99,20 @@ _tx_thread_context_restore:
; {
;
MVKL _tx_thread_system_state,A0 ; Build address of system state
- MVKH _tx_thread_system_state,A0 ;
+ MVKH _tx_thread_system_state,A0 ;
LDW *A0,A1 ; Pickup system state variable
MVKL _tx_thread_current_ptr,A2 ; Build address of current thread ptr
NOP 3 ; Delay slots
SUB A1,1,A1 ; Decrement system state
[!A1] B _tx_thread_not_nested_restore ; If 0, not a nested restore
- MVKH _tx_thread_current_ptr,A2 ;
+ MVKH _tx_thread_current_ptr,A2 ;
LDW *A2,A3 ; Pickup current thread pointer
STW A1,*A0 ; Store system state
NOP 2 ; Delay slots
;
; /* Interrupts are nested. */
;
-; /* Just recover the saved registers and return to the point of
+; /* Just recover the saved registers and return to the point of
; interrupt. */
;
LDW *+SP(8),B0 ; Recover saved CSR
@@ -196,19 +196,19 @@ _tx_thread_not_nested_restore:
MV A3,A1 ; Move thread pointer into A1
[!A1] B _tx_thread_schedule ; If null, idle system restore
MVKL _tx_thread_preempt_disable,A0 ; Build preempt disable flag address
- MVKH _tx_thread_preempt_disable,A0 ;
+ MVKH _tx_thread_preempt_disable,A0 ;
MVKL _tx_thread_execute_ptr,A4 ; Build execute thread pointer
- MVKH _tx_thread_execute_ptr,A4 ;
+ MVKH _tx_thread_execute_ptr,A4 ;
LDW *A0,B1 ; Pickup preempt disable flag
- LDW *A4,A6 ; Pickup next thread to execute
+ LDW *A4,A6 ; Pickup next thread to execute
NOP 4 ; Delay slot
CMPEQ A6,A1,A7 ; Determine if threads are the same?
ADD A7,B1,B1 ; Add results together
[B1] B _tx_thread_no_preempt_restore ; If set, skip preeemption
LDW *+A1(8),A6 ; Recover thread's stack pointer
MVKL _tx_timer_time_slice,A5 ; Build time slice address
- MVKH _tx_timer_time_slice,A5 ;
+ MVKH _tx_timer_time_slice,A5 ;
LDW *A5,B1 ; Pickup current time-slice
NOP ; Delay slot
;
diff --git a/ports/c667x/ccs/src/tx_thread_context_save.asm b/ports/c667x/ccs/src/tx_thread_context_save.asm
index 795f720e..c6a6c307 100644
--- a/ports/c667x/ccs/src/tx_thread_context_save.asm
+++ b/ports/c667x/ccs/src/tx_thread_context_save.asm
@@ -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,40 +39,40 @@ SP .set B15
;
;
.sect ".text"
-;/**************************************************************************/
-;/* */
-;/* FUNCTION RELEASE */
-;/* */
-;/* _tx_thread_context_save C667x/TI */
+;/**************************************************************************/
+;/* */
+;/* FUNCTION RELEASE */
+;/* */
+;/* _tx_thread_context_save C667x/TI */
;/* 6.1 */
;/* 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 */
-;/* */
+;/* */
+;/* 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 */
;/* */
;/* 09-30-2020 William E. Lamie Initial Version 6.1 */
@@ -93,7 +93,7 @@ _tx_thread_context_save:
; {
;
MVKL _tx_thread_system_state,A0 ; Build address of system state
- MVKH _tx_thread_system_state,A0 ;
+ MVKH _tx_thread_system_state,A0 ;
LDW *A0,A1 ; Pickup current system state
STW A5,*+SP(40) ; Save A5
STW A6,*+SP(44) ; Save A6
@@ -101,7 +101,7 @@ _tx_thread_context_save:
STW A8,*+SP(52) ; Save A8
[!A1] B _tx_thread_not_nested_save ; If 0, not a nested save condition
MVKL _tx_thread_current_ptr,A3 ; Build address of current thread ptr
- MVKH _tx_thread_current_ptr,A3 ;
+ MVKH _tx_thread_current_ptr,A3 ;
LDW *A3,A2 ; Pickup current thread pointer
ADD 1,A1,A1 ; Increment the system state (nested) counter
STW A1,*A0 ; Store system state
@@ -261,7 +261,7 @@ _tx_thread_idle_system_save:
;
; /* Interrupt occurred in the scheduling loop. */
;
-; /* Not much to do here, just adjust the stack pointer, and return to ISR
+; /* Not much to do here, just adjust the stack pointer, and return to ISR
; processing. */
;
B B3 ; Return to ISR
diff --git a/ports/c667x/ccs/src/tx_thread_interrupt_control.asm b/ports/c667x/ccs/src/tx_thread_interrupt_control.asm
index ff39fe91..f43aee94 100644
--- a/ports/c667x/ccs/src/tx_thread_interrupt_control.asm
+++ b/ports/c667x/ccs/src/tx_thread_interrupt_control.asm
@@ -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 */
;/** */
@@ -34,39 +34,39 @@ SP .set B15
;
;
.sect ".text"
-;/**************************************************************************/
-;/* */
-;/* FUNCTION RELEASE */
-;/* */
-;/* _tx_thread_interrupt_control C667x/TI */
+;/**************************************************************************/
+;/* */
+;/* FUNCTION RELEASE */
+;/* */
+;/* _tx_thread_interrupt_control C667x/TI */
;/* 6.1 */
;/* 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 */
-;/* */
+;/* */
+;/* 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 */
;/* */
;/* 09-30-2020 William E. Lamie Initial Version 6.1 */
diff --git a/ports/c667x/ccs/src/tx_thread_schedule.asm b/ports/c667x/ccs/src/tx_thread_schedule.asm
index 2b40fec1..10d0b3ad 100644
--- a/ports/c667x/ccs/src/tx_thread_schedule.asm
+++ b/ports/c667x/ccs/src/tx_thread_schedule.asm
@@ -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 */
;/** */
@@ -40,42 +40,42 @@ SP .set B15
;
;
.sect ".text"
-;/**************************************************************************/
-;/* */
-;/* FUNCTION RELEASE */
-;/* */
-;/* _tx_thread_schedule C667x/TI */
+;/**************************************************************************/
+;/* */
+;/* FUNCTION RELEASE */
+;/* */
+;/* _tx_thread_schedule C667x/TI */
;/* 6.1 */
;/* 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 */
-;/* */
+;/* */
+;/* 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 */
-;/* */
-;/* CALLS */
-;/* */
+;/* */
+;/* OUTPUT */
+;/* */
;/* 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 */
-;/* */
+;/* */
+;/* 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 */
;/* */
;/* 09-30-2020 William E. Lamie Initial Version 6.1 */
@@ -92,7 +92,7 @@ _tx_thread_schedule
OR 1,B0,B0 ; Build interrupt enable value
MVC B0,CSR ; Enable interrupts
MVKL _tx_thread_execute_ptr,A0 ; Build address of execute pointer
- MVKH _tx_thread_execute_ptr,A0 ;
+ MVKH _tx_thread_execute_ptr,A0 ;
;
; /* Wait for a thread to execute. */
; do
@@ -106,13 +106,13 @@ _tx_thread_schedule_loop:
; to become ready
MV A1,A4 ; Move thread pointer to A4
MVKL _tx_thread_current_ptr,A1 ; Build address of current thread ptr
- MVKH _tx_thread_current_ptr,A1 ;
+ MVKH _tx_thread_current_ptr,A1 ;
MVKL _tx_timer_time_slice,A2 ; Build address of time-slice
- MVKH _tx_timer_time_slice,A2 ;
+ MVKH _tx_timer_time_slice,A2 ;
;
; }
; while(_tx_thread_execute_ptr == TX_NULL);
-;
+;
; /* Yes! We have a thread to execute. Lockout interrupts and
; transfer control to it. */
;
diff --git a/ports/c667x/ccs/src/tx_thread_stack_build.asm b/ports/c667x/ccs/src/tx_thread_stack_build.asm
index dabfea41..d6521d09 100644
--- a/ports/c667x/ccs/src/tx_thread_stack_build.asm
+++ b/ports/c667x/ccs/src/tx_thread_stack_build.asm
@@ -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 */
;/** */
@@ -34,41 +34,41 @@ SP .set B15
ADDRESS_MSK .set 0xFFFFFFF0
;
.sect ".text"
-;/**************************************************************************/
-;/* */
-;/* FUNCTION RELEASE */
-;/* */
-;/* _tx_thread_stack_build C667x/TI */
+;/**************************************************************************/
+;/* */
+;/* FUNCTION RELEASE */
+;/* */
+;/* _tx_thread_stack_build C667x/TI */
;/* 6.1 */
;/* AUTHOR */
;/* */
;/* William E. Lamie, Microsoft Corporation */
;/* */
;/* DESCRIPTION */
-;/* */
+;/* */
;/* This function builds a stack frame on the supplied thread's stack. */
;/* The stack frame results in a fake interrupt return to the supplied */
-;/* function pointer. */
-;/* */
-;/* INPUT */
-;/* */
+;/* function pointer. */
+;/* */
+;/* INPUT */
+;/* */
;/* thread_ptr Pointer to thread control blk */
;/* function_ptr Pointer to return function */
-;/* */
-;/* OUTPUT */
-;/* */
+;/* */
+;/* OUTPUT */
+;/* */
;/* None */
-;/* */
-;/* CALLS */
-;/* */
+;/* */
+;/* CALLS */
+;/* */
;/* None */
-;/* */
-;/* CALLED BY */
-;/* */
+;/* */
+;/* CALLED BY */
+;/* */
;/* _tx_thread_create Create thread service */
-;/* */
-;/* RELEASE HISTORY */
-;/* */
+;/* */
+;/* RELEASE HISTORY */
+;/* */
;/* DATE NAME DESCRIPTION */
;/* */
;/* 09-30-2020 William E. Lamie Initial Version 6.1 */
@@ -79,10 +79,10 @@ ADDRESS_MSK .set 0xFFFFFFF0
.global _tx_thread_stack_build
_tx_thread_stack_build:
;
-;
+;
; /* Build a fake interrupt frame. The form of the fake interrupt stack
; on the C667x should look like the following after it is built:
-;
+;
; Stack Top: N/A Available for use
; 1 Interrupt stack frame type 4
; CSR Initial value for CSR 8
@@ -160,7 +160,7 @@ _tx_thread_stack_build:
;
LDW *+A4(16),A0 ; Pickup end of stack area
MVKL ADDRESS_MSK,A1 ; Build address mask
- MVKH ADDRESS_MSK,A1 ;
+ MVKH ADDRESS_MSK,A1 ;
MVC CSR,B0 ; Pickup current CSR
AND -2,B0,B0 ; Clear GIE bit
OR 2,B0,B0 ; Set PGIE bit for interrupt return
@@ -171,7 +171,7 @@ _tx_thread_stack_build:
; /* Actually build the stack frame. */
;
MVKL 1,A2 ; Build stack type
- ZERO A3 ; Clear value
+ ZERO A3 ; Clear value
STW A2,*+A0(4) ; Interrupt stack type
STW B0,*+A0(8) ; Initial CSR
STW B4,*+A0(12) ; Thread shell entry point
diff --git a/ports/c667x/ccs/src/tx_thread_system_return.asm b/ports/c667x/ccs/src/tx_thread_system_return.asm
index bf4c5caf..5123958b 100644
--- a/ports/c667x/ccs/src/tx_thread_system_return.asm
+++ b/ports/c667x/ccs/src/tx_thread_system_return.asm
@@ -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 */
;/** */
@@ -40,41 +40,41 @@ SP .set B15
;
;
.sect ".text"
-;/**************************************************************************/
-;/* */
-;/* FUNCTION RELEASE */
-;/* */
-;/* _tx_thread_system_return C667x/TI */
+;/**************************************************************************/
+;/* */
+;/* FUNCTION RELEASE */
+;/* */
+;/* _tx_thread_system_return C667x/TI */
;/* 6.1 */
;/* AUTHOR */
;/* */
;/* William E. Lamie, Microsoft Corporation */
;/* */
;/* DESCRIPTION */
-;/* */
-;/* This function is target processor specific. It is used to transfer */
-;/* control from a thread back to the ThreadX system. Only a */
-;/* minimal context is saved since the compiler assumes temp registers */
-;/* are going to get slicked by a function call anyway. */
-;/* */
-;/* INPUT */
-;/* */
-;/* None */
-;/* */
-;/* OUTPUT */
-;/* */
-;/* None */
-;/* */
-;/* CALLS */
-;/* */
-;/* _tx_thread_schedule Thread scheduling loop */
-;/* */
-;/* CALLED BY */
-;/* */
-;/* ThreadX components */
-;/* */
-;/* RELEASE HISTORY */
-;/* */
+;/* */
+;/* This function is target processor specific. It is used to transfer */
+;/* control from a thread back to the ThreadX system. Only a */
+;/* minimal context is saved since the compiler assumes temp registers */
+;/* are going to get slicked by a function call anyway. */
+;/* */
+;/* INPUT */
+;/* */
+;/* None */
+;/* */
+;/* OUTPUT */
+;/* */
+;/* None */
+;/* */
+;/* CALLS */
+;/* */
+;/* _tx_thread_schedule Thread scheduling loop */
+;/* */
+;/* CALLED BY */
+;/* */
+;/* ThreadX components */
+;/* */
+;/* RELEASE HISTORY */
+;/* */
;/* DATE NAME DESCRIPTION */
;/* */
;/* 09-30-2020 William E. Lamie Initial Version 6.1 */
@@ -109,7 +109,7 @@ _tx_thread_system_return:
MVC RILC,B1 ; Pickup RILC
STW B0,*+SP(60) ; Save ILC
STW B1,*+SP(64) ; Save RILC
-;
+;
; /* Lockout interrupts. */
;
AND -2,B0,B0 ; Build interrupt disable value
@@ -120,13 +120,13 @@ _tx_thread_system_return:
; SP = _tx_thread_system_stack_ptr;
;
MVKL _tx_timer_time_slice,A2 ; Pickup address of time slice
- MVKH _tx_timer_time_slice,A2 ;
+ MVKH _tx_timer_time_slice,A2 ;
LDW *A2,B0 ; Pickup time slice
MVKL _tx_thread_current_ptr,A1 ; Pickup address of current thread
- MVKH _tx_thread_current_ptr,A1 ;
+ MVKH _tx_thread_current_ptr,A1 ;
LDW *A1,A4 ; Pickup current thread pointer
MVKL _tx_thread_system_stack_ptr,A3 ; Pickup address of system stack
- MVKH _tx_thread_system_stack_ptr,A3 ;
+ MVKH _tx_thread_system_stack_ptr,A3 ;
;
; /* Determine if the time-slice is active. */
; if (_tx_timer_time_slice)
@@ -134,14 +134,14 @@ _tx_thread_system_return:
;
[!B0] B _tx_thread_dont_save_ts ; If no-time slice, skip save
NOP ; Delay slot
- STW SP,*+A4(8) ; Save thread's stack pointer
+ STW SP,*+A4(8) ; Save thread's stack pointer
LDW *A3,SP ; Switch to system stack pointer
NOP ; Delay slot
;
; /* Save time-slice for the thread and clear the current time-slice. */
; _tx_thread_current_ptr -> tx_thread_time_slice = _tx_timer_time_slice;
; _tx_timer_time_slice = 0;
- NOP ;
+ NOP ;
STW B2,*A2 ; Clear time-slice
NOP 2 ; Delay slots
STW B0,*+A4(24) ; Save time-slice
diff --git a/ports/c667x/ccs/src/tx_timer_interrupt.asm b/ports/c667x/ccs/src/tx_timer_interrupt.asm
index 60dd91b6..48df12d7 100644
--- a/ports/c667x/ccs/src/tx_timer_interrupt.asm
+++ b/ports/c667x/ccs/src/tx_timer_interrupt.asm
@@ -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 */
;/** */
;/** Timer */
;/** */
@@ -48,45 +48,45 @@ SP .set B15
;
;
.sect ".text"
-;/**************************************************************************/
-;/* */
-;/* FUNCTION RELEASE */
-;/* */
-;/* _tx_timer_interrupt C667x/TI */
+;/**************************************************************************/
+;/* */
+;/* FUNCTION RELEASE */
+;/* */
+;/* _tx_timer_interrupt C667x/TI */
;/* 6.1 */
;/* AUTHOR */
;/* */
;/* William E. Lamie, Microsoft Corporation */
;/* */
;/* DESCRIPTION */
-;/* */
-;/* This function processes the hardware timer interrupt. This */
-;/* processing includes incrementing the system clock and checking for */
-;/* time slice and/or timer expiration. If either is found, the */
-;/* interrupt context save/restore functions are called along with the */
-;/* expiration functions. */
-;/* */
-;/* INPUT */
-;/* */
-;/* None */
-;/* */
-;/* OUTPUT */
-;/* */
-;/* None */
-;/* */
-;/* CALLS */
-;/* */
-;/* _tx_thread_context_save Context save */
-;/* _tx_thread_context_restore Context restore */
-;/* _tx_thread_time_slice Time slice interrupted thread */
-;/* _tx_timer_expiration_process Timer expiration processing */
-;/* */
-;/* CALLED BY */
-;/* */
-;/* interrupt vector */
-;/* */
-;/* RELEASE HISTORY */
-;/* */
+;/* */
+;/* This function processes the hardware timer interrupt. This */
+;/* processing includes incrementing the system clock and checking for */
+;/* time slice and/or timer expiration. If either is found, the */
+;/* interrupt context save/restore functions are called along with the */
+;/* expiration functions. */
+;/* */
+;/* INPUT */
+;/* */
+;/* None */
+;/* */
+;/* OUTPUT */
+;/* */
+;/* None */
+;/* */
+;/* CALLS */
+;/* */
+;/* _tx_thread_context_save Context save */
+;/* _tx_thread_context_restore Context restore */
+;/* _tx_thread_time_slice Time slice interrupted thread */
+;/* _tx_timer_expiration_process Timer expiration processing */
+;/* */
+;/* CALLED BY */
+;/* */
+;/* interrupt vector */
+;/* */
+;/* RELEASE HISTORY */
+;/* */
;/* DATE NAME DESCRIPTION */
;/* */
;/* 09-30-2020 William E. Lamie Initial Version 6.1 */
@@ -106,10 +106,10 @@ _tx_timer_interrupt:
; _tx_timer_system_clock++;
;
MVKL _tx_timer_system_clock,A0 ; Build address of system clock
- MVKH _tx_timer_system_clock,A0 ;
+ MVKH _tx_timer_system_clock,A0 ;
LDW *A0,A2 ; Pickup system clock
MVKL _tx_timer_time_slice,A3 ; Build address of time slice
- MVKH _tx_timer_time_slice,A3 ;
+ MVKH _tx_timer_time_slice,A3 ;
LDW *A3,A1 ; Pickup time slice
NOP 2 ; Delay
ADD 1,A2,A2 ; Increment the system clock
@@ -120,7 +120,7 @@ _tx_timer_interrupt:
; {
;
[!A1] B _tx_timer_no_time_slice ; If 0, skip time slice processing
- SUB A1,1,A1 ; Decrement time-slice value
+ SUB A1,1,A1 ; Decrement time-slice value
NOP 4 ; Delay slots
;
; /* Decrement the time_slice. */
@@ -130,9 +130,9 @@ _tx_timer_interrupt:
; if (_tx_timer_time_slice == 0)
;
[A1] B _tx_timer_no_time_slice ; If non-zero, not expired yet
- STW A1,*A3 ; Store new time-slice
+ STW A1,*A3 ; Store new time-slice
MVKL _tx_timer_expired_time_slice,A0 ; Build address of expired flag
- MVKH _tx_timer_expired_time_slice,A0 ;
+ MVKH _tx_timer_expired_time_slice,A0 ;
MVKL 1,A4 ; Expired flag
NOP ; Delay
;
@@ -149,10 +149,10 @@ _tx_timer_no_time_slice:
; {
;
MVKL _tx_timer_current_ptr,A2 ; Build address of current timer pointer
- MVKH _tx_timer_current_ptr,A2 ;
+ MVKH _tx_timer_current_ptr,A2 ;
LDW *A2,A0 ; Pickup timer list address
MVKL _tx_timer_expired,A3 ; Build address of expired flag
- MVKH _tx_timer_expired,A3 ;
+ MVKH _tx_timer_expired,A3 ;
NOP 2 ; Delay slots
LDW *A0,A1 ; Pickup current timer entry
ADD 4,A0,A0 ; Increment the current pointer
@@ -179,10 +179,10 @@ _tx_timer_no_timer:
; if (_tx_timer_current_ptr == _tx_timer_list_end)
;
MVKL _tx_timer_list_end,A3 ; Build timer list end address
- MVKH _tx_timer_list_end,A3 ;
+ MVKH _tx_timer_list_end,A3 ;
LDW *A3,A4 ; Pickup list end address
MVKL _tx_timer_list_start,A3 ; Build timer list start address
- MVKH _tx_timer_list_start,A3 ;
+ MVKH _tx_timer_list_start,A3 ;
NOP 2 ; Delay slots
CMPEQ A4,A0,A1 ; Compare current pointer with end
[A1] LDW *A3,A0 ; If at the end, pickup timer list start
@@ -205,10 +205,10 @@ _tx_timer_done:
; {
;
MVKL _tx_timer_expired_time_slice,A3 ; Build time-slice expired flag
- MVKH _tx_timer_expired_time_slice,A3 ;
+ MVKH _tx_timer_expired_time_slice,A3 ;
LDW *A3,A4 ; Pickup time-slice expired flag
MVKL _tx_timer_expired,A0 ; Build timer expired flag
- MVKH _tx_timer_expired,A0 ;
+ MVKH _tx_timer_expired,A0 ;
LDW *A0,A2 ; Pickup timer expired flag
NOP 4 ; Delay slots
OR A2,A4,A1 ; Combine expired flags
@@ -223,8 +223,8 @@ _tx_something_expired:
;
B _tx_thread_context_save ; Call context save routine
MVKL _tx_timer_ISR_return,B3 ; Build return address
- MVKH _tx_timer_ISR_return,B3 ;
- NOP 3 ; Delay slots
+ MVKH _tx_timer_ISR_return,B3 ;
+ NOP 3 ; Delay slots
_tx_timer_ISR_return:
;
; /* Did a timer expire? */
@@ -232,7 +232,7 @@ _tx_timer_ISR_return:
; {
;
MVKL _tx_timer_expired,A0 ; Build timer expired address
- MVKH _tx_timer_expired,A0 ;
+ MVKH _tx_timer_expired,A0 ;
LDW *A0,A1 ; Pickup expired flag
NOP 4 ; Delay slots
[!A1] B _tx_timer_dont_activate ; If not set, skip timer activation
@@ -243,7 +243,7 @@ _tx_timer_ISR_return:
;
B _tx_timer_expiration_process ; Process timer expiration
MVKL _tx_timer_ISR_return_1,B3 ; Build return address
- MVKH _tx_timer_ISR_return_1,B3 ;
+ MVKH _tx_timer_ISR_return_1,B3 ;
NOP 3 ; Delay slots
_tx_timer_ISR_return_1:
;
@@ -255,7 +255,7 @@ _tx_timer_dont_activate:
; {
;
MVKL _tx_timer_expired_time_slice,A0 ; Build address of expired flag
- MVKH _tx_timer_expired_time_slice,A0 ;
+ MVKH _tx_timer_expired_time_slice,A0 ;
LDW *A0,A1 ; Pickup expired flag
NOP 4 ; Delay slots
[!A1] B _tx_timer_not_ts_expiration ; If not set, skip time-slice processing
@@ -266,7 +266,7 @@ _tx_timer_dont_activate:
;
B _tx_thread_time_slice ; Call time-slice processing
MVKL _tx_timer_ISR_return_2,B3 ; Build return address
- MVKH _tx_timer_ISR_return_2,B3 ;
+ MVKH _tx_timer_ISR_return_2,B3 ;
NOP 3 ; Delay slots
_tx_timer_ISR_return_2:
;