summaryrefslogtreecommitdiff
path: root/ports/arm9/iar/src
diff options
context:
space:
mode:
Diffstat (limited to 'ports/arm9/iar/src')
-rw-r--r--ports/arm9/iar/src/tx_iar.c239
-rw-r--r--ports/arm9/iar/src/tx_thread_context_restore.s72
-rw-r--r--ports/arm9/iar/src/tx_thread_context_save.s80
-rw-r--r--ports/arm9/iar/src/tx_thread_fiq_context_restore.s76
-rw-r--r--ports/arm9/iar/src/tx_thread_fiq_context_save.s102
-rw-r--r--ports/arm9/iar/src/tx_thread_fiq_nesting_end.s82
-rw-r--r--ports/arm9/iar/src/tx_thread_fiq_nesting_start.s74
-rw-r--r--ports/arm9/iar/src/tx_thread_interrupt_control.s62
-rw-r--r--ports/arm9/iar/src/tx_thread_interrupt_disable.s60
-rw-r--r--ports/arm9/iar/src/tx_thread_interrupt_restore.s58
-rw-r--r--ports/arm9/iar/src/tx_thread_irq_nesting_end.s82
-rw-r--r--ports/arm9/iar/src/tx_thread_irq_nesting_start.s74
-rw-r--r--ports/arm9/iar/src/tx_thread_schedule.s70
-rw-r--r--ports/arm9/iar/src/tx_thread_stack_build.s60
-rw-r--r--ports/arm9/iar/src/tx_thread_system_return.s68
-rw-r--r--ports/arm9/iar/src/tx_thread_vectored_context_save.s68
-rw-r--r--ports/arm9/iar/src/tx_timer_interrupt.s76
17 files changed, 654 insertions, 749 deletions
diff --git a/ports/arm9/iar/src/tx_iar.c b/ports/arm9/iar/src/tx_iar.c
index 158738ea..238b485e 100644
--- a/ports/arm9/iar/src/tx_iar.c
+++ b/ports/arm9/iar/src/tx_iar.c
@@ -1,18 +1,19 @@
/***************************************************************************
- * Copyright (c) 2024 Microsoft Corporation
- *
+ * Copyright (c) 2024 Microsoft Corporation
+ * Copyright (c) 2026-present Eclipse ThreadX contributors
+ *
* 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 */
/** */
/** IAR Multithreaded Library Support */
/** */
@@ -37,31 +38,31 @@
#include "tx_mutex.h"
-/* This implementation requires that the following macros are defined in the
+/* This implementation requires that the following macros are defined in the
tx_port.h file and <yvals.h> is included with the following code segments:
-
+
#ifdef TX_ENABLE_IAR_LIBRARY_SUPPORT
#include <yvals.h>
#endif
#ifdef TX_ENABLE_IAR_LIBRARY_SUPPORT
-#define TX_THREAD_EXTENSION_2 VOID *tx_thread_iar_tls_pointer;
+#define TX_THREAD_EXTENSION_2 VOID *tx_thread_iar_tls_pointer;
#else
-#define TX_THREAD_EXTENSION_2
+#define TX_THREAD_EXTENSION_2
#endif
#ifdef TX_ENABLE_IAR_LIBRARY_SUPPORT
-#define TX_THREAD_CREATE_EXTENSION(thread_ptr) thread_ptr -> tx_thread_iar_tls_pointer = __iar_dlib_perthread_allocate();
+#define TX_THREAD_CREATE_EXTENSION(thread_ptr) thread_ptr -> tx_thread_iar_tls_pointer = __iar_dlib_perthread_allocate();
#define TX_THREAD_DELETE_EXTENSION(thread_ptr) __iar_dlib_perthread_deallocate(thread_ptr -> tx_thread_iar_tls_pointer); \
- thread_ptr -> tx_thread_iar_tls_pointer = TX_NULL;
+ thread_ptr -> tx_thread_iar_tls_pointer = TX_NULL;
#define TX_PORT_SPECIFIC_PRE_SCHEDULER_INITIALIZATION __iar_dlib_perthread_access(0);
#else
-#define TX_THREAD_CREATE_EXTENSION(thread_ptr)
-#define TX_THREAD_DELETE_EXTENSION(thread_ptr)
+#define TX_THREAD_CREATE_EXTENSION(thread_ptr)
+#define TX_THREAD_DELETE_EXTENSION(thread_ptr)
#endif
- This should be done automatically if TX_ENABLE_IAR_LIBRARY_SUPPORT is defined while building the ThreadX library and the
- application.
+ This should be done automatically if TX_ENABLE_IAR_LIBRARY_SUPPORT is defined while building the ThreadX library and the
+ application.
Finally, the project options General Options -> Library Configuration should have the "Enable thread support in library" box selected.
*/
@@ -90,7 +91,7 @@ void _DLIB_TLS_MEMORY *__iar_dlib_perthread_access(void _DLIB_TLS_MEMORY *symbp)
{
char _DLIB_TLS_MEMORY *p = 0;
-
+
/* Is there a current thread? */
if (_tx_thread_current_ptr)
p = (char _DLIB_TLS_MEMORY *) _tx_thread_current_ptr -> tx_thread_iar_tls_pointer;
@@ -117,19 +118,19 @@ TX_MUTEX *mutex_ptr;
/* Setup a pointer to the start of the next free mutex. */
mutex_ptr = &__tx_iar_system_lock_mutexes[__tx_iar_system_lock_next_free_mutex++];
-
+
/* Check for wrap-around on the next free mutex. */
if (__tx_iar_system_lock_next_free_mutex >= _MAX_LOCK)
{
-
+
/* Yes, set the free index back to 0. */
__tx_iar_system_lock_next_free_mutex = 0;
}
-
+
/* Is this mutex free? */
if (mutex_ptr -> tx_mutex_id != TX_MUTEX_ID)
{
-
+
/* Yes, this mutex is free, get out of the loop! */
break;
}
@@ -138,35 +139,35 @@ TX_MUTEX *mutex_ptr;
/* Determine if a free mutex was found. */
if (i >= _MAX_LOCK)
{
-
+
/* Error! No more free mutexes! */
-
+
/* Increment the no mutexes error counter. */
__tx_iar_system_lock_no_mutexes++;
-
+
/* Set return pointer to NULL. */
*m = TX_NULL;
-
+
/* Return. */
return;
}
-
+
/* Now create the ThreadX mutex for the IAR library. */
status = _tx_mutex_create(mutex_ptr, "IAR System Library Lock", TX_NO_INHERIT);
-
+
/* Determine if the creation was successful. */
if (status == TX_SUCCESS)
{
-
+
/* Yes, successful creation, return mutex pointer. */
*m = (VOID *) mutex_ptr;
}
else
{
-
+
/* Increment the internal error counter. */
__tx_iar_system_lock_internal_errors++;
-
+
/* Return a NULL pointer to indicate an error. */
*m = TX_NULL;
}
@@ -185,25 +186,25 @@ void __iar_system_Mtxlock(__iar_Rmtx *m)
UINT status;
- /* Determine the caller's context. Mutex locks are only available from initialization and
+ /* Determine the caller's context. Mutex locks are only available from initialization and
threads. */
if ((_tx_thread_system_state == 0) || (_tx_thread_system_state >= TX_INITIALIZE_IN_PROGRESS))
{
-
+
/* Get the mutex. */
status = _tx_mutex_get((TX_MUTEX *) *m, TX_WAIT_FOREVER);
/* Check the status of the mutex release. */
if (status)
{
-
+
/* Internal error, increment the counter. */
__tx_iar_system_lock_internal_errors++;
}
}
else
{
-
+
/* Increment the ISR caller error. */
__tx_iar_system_lock_isr_caller++;
}
@@ -215,25 +216,25 @@ void __iar_system_Mtxunlock(__iar_Rmtx *m)
UINT status;
- /* Determine the caller's context. Mutex unlocks are only available from initialization and
+ /* Determine the caller's context. Mutex unlocks are only available from initialization and
threads. */
if ((_tx_thread_system_state == 0) || (_tx_thread_system_state >= TX_INITIALIZE_IN_PROGRESS))
{
-
+
/* Release the mutex. */
status = _tx_mutex_put((TX_MUTEX *) *m);
-
+
/* Check the status of the mutex release. */
if (status)
{
-
+
/* Internal error, increment the counter. */
__tx_iar_system_lock_internal_errors++;
}
}
else
{
-
+
/* Increment the ISR caller error. */
__tx_iar_system_lock_isr_caller++;
}
@@ -267,19 +268,19 @@ TX_MUTEX *mutex_ptr;
/* Setup a pointer to the start of the next free mutex. */
mutex_ptr = &__tx_iar_file_lock_mutexes[__tx_iar_file_lock_next_free_mutex++];
-
+
/* Check for wrap-around on the next free mutex. */
if (__tx_iar_file_lock_next_free_mutex >= _MAX_LOCK)
{
-
+
/* Yes, set the free index back to 0. */
__tx_iar_file_lock_next_free_mutex = 0;
}
-
+
/* Is this mutex free? */
if (mutex_ptr -> tx_mutex_id != TX_MUTEX_ID)
{
-
+
/* Yes, this mutex is free, get out of the loop! */
break;
}
@@ -288,35 +289,35 @@ TX_MUTEX *mutex_ptr;
/* Determine if a free mutex was found. */
if (i >= _MAX_LOCK)
{
-
+
/* Error! No more free mutexes! */
-
+
/* Increment the no mutexes error counter. */
__tx_iar_file_lock_no_mutexes++;
-
+
/* Set return pointer to NULL. */
*m = TX_NULL;
-
+
/* Return. */
return;
}
-
+
/* Now create the ThreadX mutex for the IAR library. */
status = _tx_mutex_create(mutex_ptr, "IAR File Library Lock", TX_NO_INHERIT);
-
+
/* Determine if the creation was successful. */
if (status == TX_SUCCESS)
{
-
+
/* Yes, successful creation, return mutex pointer. */
*m = (VOID *) mutex_ptr;
}
else
{
-
+
/* Increment the internal error counter. */
__tx_iar_file_lock_internal_errors++;
-
+
/* Return a NULL pointer to indicate an error. */
*m = TX_NULL;
}
@@ -335,25 +336,25 @@ void __iar_file_Mtxlock(__iar_Rmtx *m)
UINT status;
- /* Determine the caller's context. Mutex locks are only available from initialization and
+ /* Determine the caller's context. Mutex locks are only available from initialization and
threads. */
if ((_tx_thread_system_state == 0) || (_tx_thread_system_state >= TX_INITIALIZE_IN_PROGRESS))
{
-
+
/* Get the mutex. */
status = _tx_mutex_get((TX_MUTEX *) *m, TX_WAIT_FOREVER);
/* Check the status of the mutex release. */
if (status)
{
-
+
/* Internal error, increment the counter. */
__tx_iar_file_lock_internal_errors++;
}
}
else
{
-
+
/* Increment the ISR caller error. */
__tx_iar_file_lock_isr_caller++;
}
@@ -365,25 +366,25 @@ void __iar_file_Mtxunlock(__iar_Rmtx *m)
UINT status;
- /* Determine the caller's context. Mutex unlocks are only available from initialization and
+ /* Determine the caller's context. Mutex unlocks are only available from initialization and
threads. */
if ((_tx_thread_system_state == 0) || (_tx_thread_system_state >= TX_INITIALIZE_IN_PROGRESS))
{
-
+
/* Release the mutex. */
status = _tx_mutex_put((TX_MUTEX *) *m);
-
+
/* Check the status of the mutex release. */
if (status)
{
-
+
/* Internal error, increment the counter. */
__tx_iar_file_lock_internal_errors++;
}
}
else
{
-
+
/* Increment the ISR caller error. */
__tx_iar_file_lock_isr_caller++;
}
@@ -404,17 +405,17 @@ UINT status;
#include "tx_thread.h"
#include "tx_mutex.h"
-/* This implementation requires that the following macros are defined in the
+/* This implementation requires that the following macros are defined in the
tx_port.h file and <yvals.h> is included with the following code segments:
-
+
#ifdef TX_ENABLE_IAR_LIBRARY_SUPPORT
#include <yvals.h>
#endif
#ifdef TX_ENABLE_IAR_LIBRARY_SUPPORT
-#define TX_THREAD_EXTENSION_2 VOID *tx_thread_iar_tls_pointer;
+#define TX_THREAD_EXTENSION_2 VOID *tx_thread_iar_tls_pointer;
#else
-#define TX_THREAD_EXTENSION_2
+#define TX_THREAD_EXTENSION_2
#endif
#ifdef TX_ENABLE_IAR_LIBRARY_SUPPORT
@@ -422,17 +423,17 @@ void *_tx_iar_create_per_thread_tls_area(void);
void _tx_iar_destroy_per_thread_tls_area(void *tls_ptr);
void __iar_Initlocks(void);
-#define TX_THREAD_CREATE_EXTENSION(thread_ptr) thread_ptr -> tx_thread_iar_tls_pointer = __iar_dlib_perthread_allocate();
+#define TX_THREAD_CREATE_EXTENSION(thread_ptr) thread_ptr -> tx_thread_iar_tls_pointer = __iar_dlib_perthread_allocate();
#define TX_THREAD_DELETE_EXTENSION(thread_ptr) do {__iar_dlib_perthread_deallocate(thread_ptr -> tx_thread_iar_tls_pointer); \
thread_ptr -> tx_thread_iar_tls_pointer = TX_NULL; } while(0);
#define TX_PORT_SPECIFIC_PRE_SCHEDULER_INITIALIZATION do {__iar_Initlocks();} while(0);
#else
-#define TX_THREAD_CREATE_EXTENSION(thread_ptr)
-#define TX_THREAD_DELETE_EXTENSION(thread_ptr)
+#define TX_THREAD_CREATE_EXTENSION(thread_ptr)
+#define TX_THREAD_DELETE_EXTENSION(thread_ptr)
#endif
- This should be done automatically if TX_ENABLE_IAR_LIBRARY_SUPPORT is defined while building the ThreadX library and the
- application.
+ This should be done automatically if TX_ENABLE_IAR_LIBRARY_SUPPORT is defined while building the ThreadX library and the
+ application.
Finally, the project options General Options -> Library Configuration should have the "Enable thread support in library" box selected.
*/
@@ -456,7 +457,7 @@ void * __aeabi_read_tp(void)
TX_THREAD *thread_ptr = _tx_thread_current_ptr;
if (thread_ptr)
{
- p = thread_ptr->tx_thread_iar_tls_pointer;
+ p = thread_ptr->tx_thread_iar_tls_pointer;
}
else
{
@@ -469,9 +470,9 @@ void * __aeabi_read_tp(void)
void* _tx_iar_create_per_thread_tls_area()
{
- UINT tls_size = __iar_tls_size();
-
- /* Get memory for TLS. */
+ UINT tls_size = __iar_tls_size();
+
+ /* Get memory for TLS. */
void *p = malloc(tls_size);
/* Initialize TLS-area and run constructors for objects in TLS */
@@ -483,7 +484,7 @@ void _tx_iar_destroy_per_thread_tls_area(void *tls_ptr)
{
/* Destroy objects living in TLS */
__call_thread_dtors();
- free(tls_ptr);
+ free(tls_ptr);
}
#ifndef _MAX_LOCK
@@ -517,19 +518,19 @@ TX_MUTEX *mutex_ptr;
/* Setup a pointer to the start of the next free mutex. */
mutex_ptr = &__tx_iar_system_lock_mutexes[__tx_iar_system_lock_next_free_mutex++];
-
+
/* Check for wrap-around on the next free mutex. */
if (__tx_iar_system_lock_next_free_mutex >= _MAX_LOCK)
{
-
+
/* Yes, set the free index back to 0. */
__tx_iar_system_lock_next_free_mutex = 0;
}
-
+
/* Is this mutex free? */
if (mutex_ptr -> tx_mutex_id != TX_MUTEX_ID)
{
-
+
/* Yes, this mutex is free, get out of the loop! */
break;
}
@@ -538,35 +539,35 @@ TX_MUTEX *mutex_ptr;
/* Determine if a free mutex was found. */
if (i >= _MAX_LOCK)
{
-
+
/* Error! No more free mutexes! */
-
+
/* Increment the no mutexes error counter. */
__tx_iar_system_lock_no_mutexes++;
-
+
/* Set return pointer to NULL. */
*m = TX_NULL;
-
+
/* Return. */
return;
}
-
+
/* Now create the ThreadX mutex for the IAR library. */
status = _tx_mutex_create(mutex_ptr, "IAR System Library Lock", TX_NO_INHERIT);
-
+
/* Determine if the creation was successful. */
if (status == TX_SUCCESS)
{
-
+
/* Yes, successful creation, return mutex pointer. */
*m = (VOID *) mutex_ptr;
}
else
{
-
+
/* Increment the internal error counter. */
__tx_iar_system_lock_internal_errors++;
-
+
/* Return a NULL pointer to indicate an error. */
*m = TX_NULL;
}
@@ -582,28 +583,28 @@ void __iar_system_Mtxdst(__iar_Rmtx *m)
void __iar_system_Mtxlock(__iar_Rmtx *m)
{
if (*m)
- {
+ {
UINT status;
- /* Determine the caller's context. Mutex locks are only available from initialization and
+ /* Determine the caller's context. Mutex locks are only available from initialization and
threads. */
if ((_tx_thread_system_state == 0) || (_tx_thread_system_state >= TX_INITIALIZE_IN_PROGRESS))
{
-
+
/* Get the mutex. */
status = _tx_mutex_get((TX_MUTEX *) *m, TX_WAIT_FOREVER);
/* Check the status of the mutex release. */
if (status)
{
-
+
/* Internal error, increment the counter. */
__tx_iar_system_lock_internal_errors++;
}
}
else
{
-
+
/* Increment the ISR caller error. */
__tx_iar_system_lock_isr_caller++;
}
@@ -616,25 +617,25 @@ void __iar_system_Mtxunlock(__iar_Rmtx *m)
{
UINT status;
- /* Determine the caller's context. Mutex unlocks are only available from initialization and
+ /* Determine the caller's context. Mutex unlocks are only available from initialization and
threads. */
if ((_tx_thread_system_state == 0) || (_tx_thread_system_state >= TX_INITIALIZE_IN_PROGRESS))
{
-
+
/* Release the mutex. */
status = _tx_mutex_put((TX_MUTEX *) *m);
-
+
/* Check the status of the mutex release. */
if (status)
{
-
+
/* Internal error, increment the counter. */
__tx_iar_system_lock_internal_errors++;
}
}
else
{
-
+
/* Increment the ISR caller error. */
__tx_iar_system_lock_isr_caller++;
}
@@ -675,19 +676,19 @@ TX_MUTEX *mutex_ptr;
/* Setup a pointer to the start of the next free mutex. */
mutex_ptr = &__tx_iar_file_lock_mutexes[__tx_iar_file_lock_next_free_mutex++];
-
+
/* Check for wrap-around on the next free mutex. */
if (__tx_iar_file_lock_next_free_mutex >= _MAX_LOCK)
{
-
+
/* Yes, set the free index back to 0. */
__tx_iar_file_lock_next_free_mutex = 0;
}
-
+
/* Is this mutex free? */
if (mutex_ptr -> tx_mutex_id != TX_MUTEX_ID)
{
-
+
/* Yes, this mutex is free, get out of the loop! */
break;
}
@@ -696,35 +697,35 @@ TX_MUTEX *mutex_ptr;
/* Determine if a free mutex was found. */
if (i >= _MAX_LOCK)
{
-
+
/* Error! No more free mutexes! */
-
+
/* Increment the no mutexes error counter. */
__tx_iar_file_lock_no_mutexes++;
-
+
/* Set return pointer to NULL. */
*m = TX_NULL;
-
+
/* Return. */
return;
}
-
+
/* Now create the ThreadX mutex for the IAR library. */
status = _tx_mutex_create(mutex_ptr, "IAR File Library Lock", TX_NO_INHERIT);
-
+
/* Determine if the creation was successful. */
if (status == TX_SUCCESS)
{
-
+
/* Yes, successful creation, return mutex pointer. */
*m = (VOID *) mutex_ptr;
}
else
{
-
+
/* Increment the internal error counter. */
__tx_iar_file_lock_internal_errors++;
-
+
/* Return a NULL pointer to indicate an error. */
*m = TX_NULL;
}
@@ -743,25 +744,25 @@ void __iar_file_Mtxlock(__iar_Rmtx *m)
UINT status;
- /* Determine the caller's context. Mutex locks are only available from initialization and
+ /* Determine the caller's context. Mutex locks are only available from initialization and
threads. */
if ((_tx_thread_system_state == 0) || (_tx_thread_system_state >= TX_INITIALIZE_IN_PROGRESS))
{
-
+
/* Get the mutex. */
status = _tx_mutex_get((TX_MUTEX *) *m, TX_WAIT_FOREVER);
/* Check the status of the mutex release. */
if (status)
{
-
+
/* Internal error, increment the counter. */
__tx_iar_file_lock_internal_errors++;
}
}
else
{
-
+
/* Increment the ISR caller error. */
__tx_iar_file_lock_isr_caller++;
}
@@ -773,25 +774,25 @@ void __iar_file_Mtxunlock(__iar_Rmtx *m)
UINT status;
- /* Determine the caller's context. Mutex unlocks are only available from initialization and
+ /* Determine the caller's context. Mutex unlocks are only available from initialization and
threads. */
if ((_tx_thread_system_state == 0) || (_tx_thread_system_state >= TX_INITIALIZE_IN_PROGRESS))
{
-
+
/* Release the mutex. */
status = _tx_mutex_put((TX_MUTEX *) *m);
-
+
/* Check the status of the mutex release. */
if (status)
{
-
+
/* Internal error, increment the counter. */
__tx_iar_file_lock_internal_errors++;
}
}
else
{
-
+
/* Increment the ISR caller error. */
__tx_iar_file_lock_isr_caller++;
}
diff --git a/ports/arm9/iar/src/tx_thread_context_restore.s b/ports/arm9/iar/src/tx_thread_context_restore.s
index ac57cd96..51450dd5 100644
--- a/ports/arm9/iar/src/tx_thread_context_restore.s
+++ b/ports/arm9/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 */
;/** */
@@ -36,7 +36,7 @@ DISABLE_INTS DEFINE 0xC0 ; Disable IRQ interrupts
#else
DISABLE_INTS DEFINE 0x80 ; Disable IRQ interrupts
#endif
-MODE_MASK DEFINE 0x1F ; Mode mask
+MODE_MASK DEFINE 0x1F ; Mode mask
THUMB_MASK DEFINE 0x20 ; Thumb bit mask
SVC_MODE_BITS DEFINE 0x13 ; SVC mode value
@@ -50,44 +50,38 @@ SVC_MODE_BITS DEFINE 0x13 ; SVC mode value
EXTERN _tx_execution_isr_exit
;
;
-;/**************************************************************************/
-;/* */
-;/* FUNCTION RELEASE */
-;/* */
-;/* _tx_thread_context_restore ARM9/IAR */
+;/**************************************************************************/
+;/* */
+;/* FUNCTION RELEASE */
+;/* */
+;/* _tx_thread_context_restore ARM9/IAR */
;/* 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 */
-;/* */
-;/* DATE NAME DESCRIPTION */
;/* */
-;/* 09-30-2020 William E. Lamie Initial Version 6.1 */
+;/* 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 */
;/* */
;/**************************************************************************/
;VOID _tx_thread_context_restore(VOID)
@@ -117,13 +111,13 @@ _tx_thread_context_restore
LDR r3, =_tx_thread_system_state ; Pickup address of system state var
LDR r2, [r3, #0] ; Pickup system state
SUB r2, r2, #1 ; Decrement the counter
- STR r2, [r3, #0] ; Store the counter
+ STR r2, [r3, #0] ; Store the counter
CMP r2, #0 ; Was this the first interrupt?
BEQ __tx_thread_not_nested_restore ; If so, not a nested restore
;
; /* 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. */
;
LDMIA sp!, {r0, r10, r12, lr} ; Recover SPSR, POI, and scratch regs
diff --git a/ports/arm9/iar/src/tx_thread_context_save.s b/ports/arm9/iar/src/tx_thread_context_save.s
index db77a17b..eeadaa24 100644
--- a/ports/arm9/iar/src/tx_thread_context_save.s
+++ b/ports/arm9/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 */
;/** */
@@ -44,43 +44,37 @@ DISABLE_INTS DEFINE 0x80 ; IRQ interrupts disabled
;
;
-;/**************************************************************************/
-;/* */
-;/* FUNCTION RELEASE */
-;/* */
-;/* _tx_thread_context_save ARM9/IAR */
+;/**************************************************************************/
+;/* */
+;/* FUNCTION RELEASE */
+;/* */
+;/* _tx_thread_context_save ARM9/IAR */
;/* 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 */
-;/* */
-;/* DATE NAME DESCRIPTION */
;/* */
-;/* 09-30-2020 William E. Lamie Initial Version 6.1 */
+;/* 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)
@@ -97,7 +91,7 @@ _tx_thread_context_save
; if (_tx_thread_system_state++)
; {
;
- STMDB sp!, {r0-r3} ; Save some working registers
+ STMDB sp!, {r0-r3} ; Save some working registers
#ifdef TX_ENABLE_FIQ_SUPPORT
MRS r0, CPSR ; Pickup the CPSR
ORR r0, r0, #DISABLE_INTS ; Build disable interrupt CPSR
@@ -117,7 +111,7 @@ _tx_thread_context_save
; calling ISR. */
;
MRS r0, SPSR ; Pickup saved SPSR
- SUB lr, lr, #4 ; Adjust point of interrupt
+ SUB lr, lr, #4 ; Adjust point of interrupt
STMDB sp!, {r0, r10, r12, lr} ; Store other registers
;
; /* Return to the ISR. */
@@ -133,7 +127,7 @@ _tx_thread_context_save
POP {lr} ; Recover ISR lr
#endif
- B __tx_irq_processing_return ; Continue IRQ processing
+ B __tx_irq_processing_return ; Continue IRQ processing
;
__tx_thread_not_nested_save
; }
@@ -147,13 +141,13 @@ __tx_thread_not_nested_save
LDR r1, =_tx_thread_current_ptr ; Pickup address of current thread ptr
LDR r0, [r1, #0] ; Pickup current thread pointer
CMP r0, #0 ; Is it NULL?
- BEQ __tx_thread_idle_system_save ; If so, interrupt occured in
+ BEQ __tx_thread_idle_system_save ; If so, interrupt occured in
; scheduling loop - nothing needs saving!
;
; /* Save minimal context of interrupted thread. */
;
MRS r2, SPSR ; Pickup saved SPSR
- SUB lr, lr, #4 ; Adjust point of interrupt
+ SUB lr, lr, #4 ; Adjust point of interrupt
STMDB sp!, {r2, r10, r12, lr} ; Store other registers
;
; /* Save the current stack pointer in the thread's control block. */
@@ -173,7 +167,7 @@ __tx_thread_not_nested_save
POP {lr} ; Recover ISR lr
#endif
- B __tx_irq_processing_return ; Continue IRQ processing
+ B __tx_irq_processing_return ; Continue IRQ processing
;
; }
; else
@@ -183,7 +177,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 IRQ
+; /* Not much to do here, just adjust the stack pointer, and return to IRQ
; processing. */
;
MOV r10, #0 ; Clear stack limit
@@ -198,7 +192,7 @@ __tx_thread_idle_system_save
#endif
ADD sp, sp, #16 ; Recover saved registers
- B __tx_irq_processing_return ; Continue IRQ processing
+ B __tx_irq_processing_return ; Continue IRQ processing
;
; }
;}
diff --git a/ports/arm9/iar/src/tx_thread_fiq_context_restore.s b/ports/arm9/iar/src/tx_thread_fiq_context_restore.s
index 137714b6..1fd57ad0 100644
--- a/ports/arm9/iar/src/tx_thread_fiq_context_restore.s
+++ b/ports/arm9/iar/src/tx_thread_fiq_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 */
;/** */
@@ -37,7 +37,7 @@ DISABLE_INTS DEFINE 0xC0 ; Disable IRQ & FIQ interrupts
#else
DISABLE_INTS DEFINE 0x80 ; Disable IRQ interrupts
#endif
-MODE_MASK DEFINE 0x1F ; Mode mask
+MODE_MASK DEFINE 0x1F ; Mode mask
THUMB_MASK DEFINE 0x20 ; Thumb bit mask
IRQ_MODE_BITS DEFINE 0x12 ; IRQ mode bits
SVC_MODE_BITS DEFINE 0x13 ; SVC mode value
@@ -52,44 +52,38 @@ SVC_MODE_BITS DEFINE 0x13 ; SVC mode value
EXTERN _tx_execution_isr_exit
;
;
-;/**************************************************************************/
-;/* */
-;/* FUNCTION RELEASE */
-;/* */
-;/* _tx_thread_fiq_context_restore ARM9/IAR */
+;/**************************************************************************/
+;/* */
+;/* FUNCTION RELEASE */
+;/* */
+;/* _tx_thread_fiq_context_restore ARM9/IAR */
;/* 6.1 */
;/* AUTHOR */
;/* */
;/* William E. Lamie, Microsoft Corporation */
;/* */
;/* DESCRIPTION */
-;/* */
-;/* This function restores the fiq interrupt context when 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 */
-;/* */
-;/* FIQ ISR Interrupt Service Routines */
-;/* */
-;/* RELEASE HISTORY */
-;/* */
-;/* DATE NAME DESCRIPTION */
;/* */
-;/* 09-30-2020 William E. Lamie Initial Version 6.1 */
+;/* This function restores the fiq interrupt context when 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 */
+;/* */
+;/* FIQ ISR Interrupt Service Routines */
;/* */
;/**************************************************************************/
;VOID _tx_thread_fiq_context_restore(VOID)
@@ -119,13 +113,13 @@ _tx_thread_fiq_context_restore
LDR r3, =_tx_thread_system_state ; Pickup address of system state var
LDR r2, [r3] ; Pickup system state
SUB r2, r2, #1 ; Decrement the counter
- STR r2, [r3] ; Store the counter
+ STR r2, [r3] ; Store the counter
CMP r2, #0 ; Was this the first interrupt?
BEQ __tx_thread_fiq_not_nested_restore ; If so, not a nested restore
;
; /* 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. */
;
LDMIA sp!, {r0, r10, r12, lr} ; Recover SPSR, POI, and scratch regs
@@ -169,7 +163,7 @@ __tx_thread_fiq_no_preempt_restore
; /* Restore interrupted thread or ISR. */
;
; /* Pickup the saved stack pointer. */
-; tmp_ptr = _tx_thread_current_ptr -> tx_thread_stack_ptr;
+; tmp_ptr = _tx_thread_current_ptr -> tx_thread_stack_ptr;
;
; /* Recover the saved context and return to the point of interrupt. */
;
@@ -216,7 +210,7 @@ __tx_thread_fiq_preempt_restore
BEQ __tx_thread_fiq_dont_save_ts ; No, don't save it
;
; _tx_thread_current_ptr -> tx_thread_time_slice = _tx_timer_time_slice;
-; _tx_timer_time_slice = 0;
+; _tx_timer_time_slice = 0;
;
STR r2, [r0, #24] ; Save thread's time-slice
MOV r2, #0 ; Clear value
diff --git a/ports/arm9/iar/src/tx_thread_fiq_context_save.s b/ports/arm9/iar/src/tx_thread_fiq_context_save.s
index 562d5132..38e7e568 100644
--- a/ports/arm9/iar/src/tx_thread_fiq_context_save.s
+++ b/ports/arm9/iar/src/tx_thread_fiq_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 */
;/** */
@@ -36,43 +36,37 @@
EXTERN _tx_execution_isr_enter
;
;
-;/**************************************************************************/
-;/* */
-;/* FUNCTION RELEASE */
-;/* */
-;/* _tx_thread_fiq_context_save ARM9/IAR */
+;/**************************************************************************/
+;/* */
+;/* FUNCTION RELEASE */
+;/* */
+;/* _tx_thread_fiq_context_save ARM9/IAR */
;/* 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 */
-;/* */
-;/* DATE NAME DESCRIPTION */
;/* */
-;/* 09-30-2020 William E. Lamie Initial Version 6.1 */
+;/* 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_fiq_context_save(VOID)
@@ -89,7 +83,7 @@ _tx_thread_fiq_context_save
; if (_tx_thread_system_state++)
; {
;
- STMDB sp!, {r0-r3} ; Save some working registers
+ STMDB sp!, {r0-r3} ; Save some working registers
LDR r3, =_tx_thread_system_state ; Pickup address of system state var
LDR r2, [r3] ; Pickup system state
CMP r2, #0 ; Is this the first interrupt?
@@ -104,7 +98,7 @@ _tx_thread_fiq_context_save
; calling ISR. */
;
MRS r0, SPSR ; Pickup saved SPSR
- SUB lr, lr, #4 ; Adjust point of interrupt
+ SUB lr, lr, #4 ; Adjust point of interrupt
STMDB sp!, {r0, r10, r12, lr} ; Store other registers
;
; /* Return to the ISR. */
@@ -120,38 +114,38 @@ _tx_thread_fiq_context_save
POP {lr} ; Recover ISR lr
#endif
- B __tx_fiq_processing_return ; Continue FIQ processing
+ B __tx_fiq_processing_return ; Continue FIQ processing
;
__tx_thread_fiq_not_nested_save
-; }
+; }
;
; /* Otherwise, not nested, check to see if a thread was running. */
; else if (_tx_thread_current_ptr)
-; {
+; {
;
ADD r2, r2, #1 ; Increment the interrupt counter
STR r2, [r3] ; Store it back in the variable
LDR r1, =_tx_thread_current_ptr ; Pickup address of current thread ptr
LDR r0, [r1] ; Pickup current thread pointer
CMP r0, #0 ; Is it NULL?
- BEQ __tx_thread_fiq_idle_system_save ; If so, interrupt occurred in
-; ; scheduling loop - nothing needs saving!
+ BEQ __tx_thread_fiq_idle_system_save ; If so, interrupt occurred in
+; ; scheduling loop - nothing needs saving!
;
; /* Save minimal context of interrupted thread. */
;
MRS r2, SPSR ; Pickup saved SPSR
- SUB lr, lr, #4 ; Adjust point of interrupt
+ SUB lr, lr, #4 ; Adjust point of interrupt
STMDB sp!, {r2, lr} ; Store other registers, Note that we don't
-; ; need to save sl and ip since FIQ has
-; ; copies of these registers. Nested
+; ; need to save sl and ip since FIQ has
+; ; copies of these registers. Nested
; ; interrupt processing does need to save
; ; these registers.
;
; /* Save the current stack pointer in the thread's control block. */
-; _tx_thread_current_ptr -> tx_thread_stack_ptr = sp;
+; _tx_thread_current_ptr -> tx_thread_stack_ptr = sp;
;
; /* Switch to the system stack. */
-; sp = _tx_thread_system_stack_ptr;
+; sp = _tx_thread_system_stack_ptr;
;
MOV r10, #0 ; Clear stack limit
@@ -164,7 +158,7 @@ __tx_thread_fiq_not_nested_save
POP {lr} ; Recover ISR lr
#endif
- B __tx_fiq_processing_return ; Continue FIQ processing
+ B __tx_fiq_processing_return ; Continue FIQ processing
;
; }
; else
@@ -184,18 +178,18 @@ __tx_thread_fiq_idle_system_save
#endif
;
; /* Not much to do here, save the current SPSR and LR for possible
-; use in IRQ interrupted in idle system conditions, and return to
+; use in IRQ interrupted in idle system conditions, and return to
; FIQ interrupt processing. */
;
MRS r0, SPSR ; Pickup saved SPSR
- SUB lr, lr, #4 ; Adjust point of interrupt
+ SUB lr, lr, #4 ; Adjust point of interrupt
STMDB sp!, {r0, lr} ; Store other registers that will get used
-; ; or stripped off the stack in context
-; ; restore
- B __tx_fiq_processing_return ; Continue FIQ processing
+; ; or stripped off the stack in context
+; ; restore
+ B __tx_fiq_processing_return ; Continue FIQ processing
;
; }
-;}
+;}
;
;
END
diff --git a/ports/arm9/iar/src/tx_thread_fiq_nesting_end.s b/ports/arm9/iar/src/tx_thread_fiq_nesting_end.s
index e3897977..e71cea18 100644
--- a/ports/arm9/iar/src/tx_thread_fiq_nesting_end.s
+++ b/ports/arm9/iar/src/tx_thread_fiq_nesting_end.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 */
;/** */
@@ -34,55 +34,49 @@ DISABLE_INTS DEFINE 0xC0 ; Disable IRQ & FIQ interrupts
#else
DISABLE_INTS DEFINE 0x80 ; Disable IRQ interrupts
#endif
-MODE_MASK DEFINE 0x1F ; Mode mask
+MODE_MASK DEFINE 0x1F ; Mode mask
FIQ_MODE_BITS DEFINE 0x11 ; FIQ mode bits
;
;
-;/**************************************************************************/
-;/* */
-;/* FUNCTION RELEASE */
-;/* */
-;/* _tx_thread_fiq_nesting_end ARM9/IAR */
+;/**************************************************************************/
+;/* */
+;/* FUNCTION RELEASE */
+;/* */
+;/* _tx_thread_fiq_nesting_end ARM9/IAR */
;/* 6.1 */
;/* AUTHOR */
;/* */
;/* William E. Lamie, Microsoft Corporation */
;/* */
;/* DESCRIPTION */
-;/* */
-;/* This function is called by the application from FIQ mode after */
-;/* _tx_thread_fiq_nesting_start has been called and switches the FIQ */
-;/* processing from system mode back to FIQ mode prior to the ISR */
-;/* calling _tx_thread_fiq_context_restore. Note that this function */
-;/* assumes the system stack pointer is in the same position after */
-;/* nesting start function was called. */
-;/* */
-;/* This function assumes that the system mode stack pointer was setup */
-;/* during low-level initialization (tx_initialize_low_level.s79). */
-;/* */
-;/* This function returns with FIQ interrupts disabled. */
-;/* */
-;/* INPUT */
-;/* */
-;/* None */
-;/* */
-;/* OUTPUT */
-;/* */
-;/* None */
-;/* */
-;/* CALLS */
-;/* */
-;/* None */
-;/* */
-;/* CALLED BY */
-;/* */
-;/* ISRs */
-;/* */
-;/* RELEASE HISTORY */
-;/* */
-;/* DATE NAME DESCRIPTION */
;/* */
-;/* 09-30-2020 William E. Lamie Initial Version 6.1 */
+;/* This function is called by the application from FIQ mode after */
+;/* _tx_thread_fiq_nesting_start has been called and switches the FIQ */
+;/* processing from system mode back to FIQ mode prior to the ISR */
+;/* calling _tx_thread_fiq_context_restore. Note that this function */
+;/* assumes the system stack pointer is in the same position after */
+;/* nesting start function was called. */
+;/* */
+;/* This function assumes that the system mode stack pointer was setup */
+;/* during low-level initialization (tx_initialize_low_level.s79). */
+;/* */
+;/* This function returns with FIQ interrupts disabled. */
+;/* */
+;/* INPUT */
+;/* */
+;/* None */
+;/* */
+;/* OUTPUT */
+;/* */
+;/* None */
+;/* */
+;/* CALLS */
+;/* */
+;/* None */
+;/* */
+;/* CALLED BY */
+;/* */
+;/* ISRs */
;/* */
;/**************************************************************************/
;VOID _tx_thread_fiq_nesting_end(VOID)
diff --git a/ports/arm9/iar/src/tx_thread_fiq_nesting_start.s b/ports/arm9/iar/src/tx_thread_fiq_nesting_start.s
index 41867e49..d9d0fb14 100644
--- a/ports/arm9/iar/src/tx_thread_fiq_nesting_start.s
+++ b/ports/arm9/iar/src/tx_thread_fiq_nesting_start.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 */
;/** */
@@ -35,48 +35,42 @@ MODE_MASK DEFINE 0x1F ; Mode mask
SYS_MODE_BITS DEFINE 0x1F ; System mode bits
;
;
-;/**************************************************************************/
-;/* */
-;/* FUNCTION RELEASE */
-;/* */
-;/* _tx_thread_fiq_nesting_start ARM9/IAR */
+;/**************************************************************************/
+;/* */
+;/* FUNCTION RELEASE */
+;/* */
+;/* _tx_thread_fiq_nesting_start ARM9/IAR */
;/* 6.1 */
;/* AUTHOR */
;/* */
;/* William E. Lamie, Microsoft Corporation */
;/* */
;/* DESCRIPTION */
-;/* */
-;/* This function is called by the application from FIQ mode after */
-;/* _tx_thread_fiq_context_save has been called and switches the FIQ */
-;/* processing to the system mode so nested FIQ interrupt processing */
-;/* is possible (system mode has its own "lr" register). Note that */
-;/* this function assumes that the system mode stack pointer was setup */
-;/* during low-level initialization (tx_initialize_low_level.s79). */
-;/* */
-;/* This function returns with FIQ interrupts enabled. */
-;/* */
-;/* INPUT */
-;/* */
-;/* None */
-;/* */
-;/* OUTPUT */
-;/* */
-;/* None */
-;/* */
-;/* CALLS */
-;/* */
-;/* None */
-;/* */
-;/* CALLED BY */
-;/* */
-;/* ISRs */
-;/* */
-;/* RELEASE HISTORY */
-;/* */
-;/* DATE NAME DESCRIPTION */
;/* */
-;/* 09-30-2020 William E. Lamie Initial Version 6.1 */
+;/* This function is called by the application from FIQ mode after */
+;/* _tx_thread_fiq_context_save has been called and switches the FIQ */
+;/* processing to the system mode so nested FIQ interrupt processing */
+;/* is possible (system mode has its own "lr" register). Note that */
+;/* this function assumes that the system mode stack pointer was setup */
+;/* during low-level initialization (tx_initialize_low_level.s79). */
+;/* */
+;/* This function returns with FIQ interrupts enabled. */
+;/* */
+;/* INPUT */
+;/* */
+;/* None */
+;/* */
+;/* OUTPUT */
+;/* */
+;/* None */
+;/* */
+;/* CALLS */
+;/* */
+;/* None */
+;/* */
+;/* CALLED BY */
+;/* */
+;/* ISRs */
;/* */
;/**************************************************************************/
;VOID _tx_thread_fiq_nesting_start(VOID)
diff --git a/ports/arm9/iar/src/tx_thread_interrupt_control.s b/ports/arm9/iar/src/tx_thread_interrupt_control.s
index a6d540a7..82ccae6e 100644
--- a/ports/arm9/iar/src/tx_thread_interrupt_control.s
+++ b/ports/arm9/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 */
;/** */
@@ -35,42 +35,36 @@ INT_MASK DEFINE 0x80 ; Interrupt bit mask
#endif
;
;
-;/**************************************************************************/
-;/* */
-;/* FUNCTION RELEASE */
-;/* */
-;/* _tx_thread_interrupt_control ARM9/IAR */
+;/**************************************************************************/
+;/* */
+;/* FUNCTION RELEASE */
+;/* */
+;/* _tx_thread_interrupt_control ARM9/IAR */
;/* 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 */
-;/* */
-;/* DATE NAME DESCRIPTION */
;/* */
-;/* 09-30-2020 William E. Lamie Initial Version 6.1 */
+;/* 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)
diff --git a/ports/arm9/iar/src/tx_thread_interrupt_disable.s b/ports/arm9/iar/src/tx_thread_interrupt_disable.s
index 64c7508a..5a5cd20c 100644
--- a/ports/arm9/iar/src/tx_thread_interrupt_disable.s
+++ b/ports/arm9/iar/src/tx_thread_interrupt_disable.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 */
;/** */
@@ -36,41 +36,35 @@ DISABLE_INTS DEFINE 0x80 ; IRQ interrupts disabled
;
;
;
-;/**************************************************************************/
-;/* */
-;/* FUNCTION RELEASE */
-;/* */
-;/* _tx_thread_interrupt_disable ARM9/IAR */
+;/**************************************************************************/
+;/* */
+;/* FUNCTION RELEASE */
+;/* */
+;/* _tx_thread_interrupt_disable ARM9/IAR */
;/* 6.1 */
;/* AUTHOR */
;/* */
;/* William E. Lamie, Microsoft Corporation */
;/* */
;/* DESCRIPTION */
-;/* */
-;/* This function is responsible for disabling interrupts */
-;/* */
-;/* INPUT */
-;/* */
-;/* None */
-;/* */
-;/* 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 */
+;/* This function is responsible for disabling interrupts */
+;/* */
+;/* INPUT */
+;/* */
+;/* None */
+;/* */
+;/* OUTPUT */
+;/* */
+;/* old_posture Old interrupt lockout posture */
+;/* */
+;/* CALLS */
+;/* */
+;/* None */
+;/* */
+;/* CALLED BY */
+;/* */
+;/* Application Code */
;/* */
;/**************************************************************************/
;UINT _tx_thread_interrupt_disable(VOID)
diff --git a/ports/arm9/iar/src/tx_thread_interrupt_restore.s b/ports/arm9/iar/src/tx_thread_interrupt_restore.s
index deace508..945993e0 100644
--- a/ports/arm9/iar/src/tx_thread_interrupt_restore.s
+++ b/ports/arm9/iar/src/tx_thread_interrupt_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 */
;/** */
@@ -28,42 +28,36 @@
;#include "tx_thread.h"
;
;
-;/**************************************************************************/
-;/* */
-;/* FUNCTION RELEASE */
-;/* */
-;/* _tx_thread_interrupt_restore ARM9/IAR */
+;/**************************************************************************/
+;/* */
+;/* FUNCTION RELEASE */
+;/* */
+;/* _tx_thread_interrupt_restore ARM9/IAR */
;/* 6.1 */
;/* AUTHOR */
;/* */
;/* William E. Lamie, Microsoft Corporation */
;/* */
;/* DESCRIPTION */
-;/* */
+;/* */
;/* This function is responsible for restoring interrupts to the state */
;/* returned by a previous _tx_thread_interrupt_disable call. */
-;/* */
-;/* INPUT */
-;/* */
-;/* old_posture Old interrupt lockout posture */
-;/* */
-;/* OUTPUT */
-;/* */
-;/* None */
-;/* */
-;/* CALLS */
-;/* */
-;/* None */
-;/* */
-;/* CALLED BY */
-;/* */
-;/* Application Code */
-;/* */
-;/* RELEASE HISTORY */
-;/* */
-;/* DATE NAME DESCRIPTION */
;/* */
-;/* 09-30-2020 William E. Lamie Initial Version 6.1 */
+;/* INPUT */
+;/* */
+;/* old_posture Old interrupt lockout posture */
+;/* */
+;/* OUTPUT */
+;/* */
+;/* None */
+;/* */
+;/* CALLS */
+;/* */
+;/* None */
+;/* */
+;/* CALLED BY */
+;/* */
+;/* Application Code */
;/* */
;/**************************************************************************/
;void _tx_thread_interrupt_restore(UINT old_posture)
diff --git a/ports/arm9/iar/src/tx_thread_irq_nesting_end.s b/ports/arm9/iar/src/tx_thread_irq_nesting_end.s
index ff38c1ca..54003548 100644
--- a/ports/arm9/iar/src/tx_thread_irq_nesting_end.s
+++ b/ports/arm9/iar/src/tx_thread_irq_nesting_end.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 */
;/** */
@@ -35,55 +35,49 @@ DISABLE_INTS DEFINE 0xC0 ; Disable IRQ & FIQ interrupts
#else
DISABLE_INTS DEFINE 0x80 ; Disable IRQ interrupts
#endif
-MODE_MASK DEFINE 0x1F ; Mode mask
+MODE_MASK DEFINE 0x1F ; Mode mask
IRQ_MODE_BITS DEFINE 0x12 ; IRQ mode bits
;
;
-;/**************************************************************************/
-;/* */
-;/* FUNCTION RELEASE */
-;/* */
-;/* _tx_thread_irq_nesting_end ARM9/IAR */
+;/**************************************************************************/
+;/* */
+;/* FUNCTION RELEASE */
+;/* */
+;/* _tx_thread_irq_nesting_end ARM9/IAR */
;/* 6.1 */
;/* AUTHOR */
;/* */
;/* William E. Lamie, Microsoft Corporation */
;/* */
;/* DESCRIPTION */
-;/* */
-;/* This function is called by the application from IRQ mode after */
-;/* _tx_thread_irq_nesting_start has been called and switches the IRQ */
-;/* processing from system mode back to IRQ mode prior to the ISR */
-;/* calling _tx_thread_context_restore. Note that this function */
-;/* assumes the system stack pointer is in the same position after */
-;/* nesting start function was called. */
-;/* */
-;/* This function assumes that the system mode stack pointer was setup */
-;/* during low-level initialization (tx_initialize_low_level.s79). */
-;/* */
-;/* This function returns with IRQ interrupts disabled. */
-;/* */
-;/* INPUT */
-;/* */
-;/* None */
-;/* */
-;/* OUTPUT */
-;/* */
-;/* None */
-;/* */
-;/* CALLS */
-;/* */
-;/* None */
-;/* */
-;/* CALLED BY */
-;/* */
-;/* ISRs */
-;/* */
-;/* RELEASE HISTORY */
-;/* */
-;/* DATE NAME DESCRIPTION */
;/* */
-;/* 09-30-2020 William E. Lamie Initial Version 6.1 */
+;/* This function is called by the application from IRQ mode after */
+;/* _tx_thread_irq_nesting_start has been called and switches the IRQ */
+;/* processing from system mode back to IRQ mode prior to the ISR */
+;/* calling _tx_thread_context_restore. Note that this function */
+;/* assumes the system stack pointer is in the same position after */
+;/* nesting start function was called. */
+;/* */
+;/* This function assumes that the system mode stack pointer was setup */
+;/* during low-level initialization (tx_initialize_low_level.s79). */
+;/* */
+;/* This function returns with IRQ interrupts disabled. */
+;/* */
+;/* INPUT */
+;/* */
+;/* None */
+;/* */
+;/* OUTPUT */
+;/* */
+;/* None */
+;/* */
+;/* CALLS */
+;/* */
+;/* None */
+;/* */
+;/* CALLED BY */
+;/* */
+;/* ISRs */
;/* */
;/**************************************************************************/
;VOID _tx_thread_irq_nesting_end(VOID)
diff --git a/ports/arm9/iar/src/tx_thread_irq_nesting_start.s b/ports/arm9/iar/src/tx_thread_irq_nesting_start.s
index 5e08187c..5b13d528 100644
--- a/ports/arm9/iar/src/tx_thread_irq_nesting_start.s
+++ b/ports/arm9/iar/src/tx_thread_irq_nesting_start.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 */
;/** */
@@ -35,48 +35,42 @@ MODE_MASK DEFINE 0x1F ; Mode mask
SYS_MODE_BITS DEFINE 0x1F ; System mode bits
;
;
-;/**************************************************************************/
-;/* */
-;/* FUNCTION RELEASE */
-;/* */
-;/* _tx_thread_irq_nesting_start ARM9/IAR */
+;/**************************************************************************/
+;/* */
+;/* FUNCTION RELEASE */
+;/* */
+;/* _tx_thread_irq_nesting_start ARM9/IAR */
;/* 6.1 */
;/* AUTHOR */
;/* */
;/* William E. Lamie, Microsoft Corporation */
;/* */
;/* DESCRIPTION */
-;/* */
-;/* This function is called by the application from IRQ mode after */
-;/* _tx_thread_context_save has been called and switches the IRQ */
-;/* processing to the system mode so nested IRQ interrupt processing */
-;/* is possible (system mode has its own "lr" register). Note that */
-;/* this function assumes that the system mode stack pointer was setup */
-;/* during low-level initialization (tx_initialize_low_level.s79). */
-;/* */
-;/* This function returns with IRQ interrupts enabled. */
-;/* */
-;/* INPUT */
-;/* */
-;/* None */
-;/* */
-;/* OUTPUT */
-;/* */
-;/* None */
-;/* */
-;/* CALLS */
-;/* */
-;/* None */
-;/* */
-;/* CALLED BY */
-;/* */
-;/* ISRs */
-;/* */
-;/* RELEASE HISTORY */
-;/* */
-;/* DATE NAME DESCRIPTION */
;/* */
-;/* 09-30-2020 William E. Lamie Initial Version 6.1 */
+;/* This function is called by the application from IRQ mode after */
+;/* _tx_thread_context_save has been called and switches the IRQ */
+;/* processing to the system mode so nested IRQ interrupt processing */
+;/* is possible (system mode has its own "lr" register). Note that */
+;/* this function assumes that the system mode stack pointer was setup */
+;/* during low-level initialization (tx_initialize_low_level.s79). */
+;/* */
+;/* This function returns with IRQ interrupts enabled. */
+;/* */
+;/* INPUT */
+;/* */
+;/* None */
+;/* */
+;/* OUTPUT */
+;/* */
+;/* None */
+;/* */
+;/* CALLS */
+;/* */
+;/* None */
+;/* */
+;/* CALLED BY */
+;/* */
+;/* ISRs */
;/* */
;/**************************************************************************/
;VOID _tx_thread_irq_nesting_start(VOID)
diff --git a/ports/arm9/iar/src/tx_thread_schedule.s b/ports/arm9/iar/src/tx_thread_schedule.s
index 86a70a4f..89c875c9 100644
--- a/ports/arm9/iar/src/tx_thread_schedule.s
+++ b/ports/arm9/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 */
;/** */
@@ -43,45 +43,39 @@ ENABLE_INTS DEFINE 0x80 ; IRQ Interrupts enabled mask
;
;
;
-;/**************************************************************************/
-;/* */
-;/* FUNCTION RELEASE */
-;/* */
-;/* _tx_thread_schedule ARM9/IAR */
+;/**************************************************************************/
+;/* */
+;/* FUNCTION RELEASE */
+;/* */
+;/* _tx_thread_schedule ARM9/IAR */
;/* 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 */
-;/* */
-;/* DATE NAME DESCRIPTION */
;/* */
-;/* 09-30-2020 William E. Lamie Initial Version 6.1 */
+;/* 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 */
;/* */
;/**************************************************************************/
;VOID _tx_thread_schedule(VOID)
@@ -111,7 +105,7 @@ __tx_thread_schedule_loop
;
; }
; while(_tx_thread_execute_ptr == TX_NULL);
-;
+;
; /* Yes! We have a thread to execute. Lockout interrupts and
; transfer control to it. */
;
@@ -120,7 +114,7 @@ __tx_thread_schedule_loop
; /* Setup the current thread pointer. */
; _tx_thread_current_ptr = _tx_thread_execute_ptr;
;
- LDR r1, =_tx_thread_current_ptr ; Pickup address of current thread
+ LDR r1, =_tx_thread_current_ptr ; Pickup address of current thread
STR r0, [r1, #0] ; Setup current thread pointer
;
; /* Increment the run count for this thread. */
@@ -134,7 +128,7 @@ __tx_thread_schedule_loop
; /* Setup time-slice, if present. */
; _tx_timer_time_slice = _tx_thread_current_ptr -> tx_thread_time_slice;
;
- LDR r2, =_tx_timer_time_slice ; Pickup address of time slice
+ LDR r2, =_tx_timer_time_slice ; Pickup address of time slice
; variable
LDR sp, [r0, #8] ; Switch stack pointers
STR r3, [r2, #0] ; Setup time-slice
diff --git a/ports/arm9/iar/src/tx_thread_stack_build.s b/ports/arm9/iar/src/tx_thread_stack_build.s
index c59c61f4..cd10adb1 100644
--- a/ports/arm9/iar/src/tx_thread_stack_build.s
+++ b/ports/arm9/iar/src/tx_thread_stack_build.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 */
;/** */
@@ -37,58 +37,52 @@ CPSR_MASK DEFINE 0x9F ; Mask initial CPSR, IRQ ints en
#endif
;
;
-;/**************************************************************************/
-;/* */
-;/* FUNCTION RELEASE */
-;/* */
-;/* _tx_thread_stack_build ARM9/IAR */
+;/**************************************************************************/
+;/* */
+;/* FUNCTION RELEASE */
+;/* */
+;/* _tx_thread_stack_build ARM9/IAR */
;/* 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 */
-;/* */
-;/* _tx_thread_create Create thread service */
-;/* */
-;/* RELEASE HISTORY */
-;/* */
-;/* DATE NAME DESCRIPTION */
;/* */
-;/* 09-30-2020 William E. Lamie Initial Version 6.1 */
+;/* CALLED BY */
+;/* */
+;/* _tx_thread_create Create thread service */
;/* */
;/**************************************************************************/
;VOID _tx_thread_stack_build(TX_THREAD *thread_ptr, VOID (*function_ptr)(VOID))
;{
RSEG .text:CODE:NOROOT(2)
PUBLIC _tx_thread_stack_build
-
+
CODE32
_tx_thread_stack_build
;
-;
+;
; /* Build a fake interrupt frame. The form of the fake interrupt stack
; on the ARM9 should look like the following after it is built:
-;
+;
; Stack Top: 1 Interrupt stack frame type
; CPSR Initial value for CPSR
; a1 (r0) Initial value for a1
diff --git a/ports/arm9/iar/src/tx_thread_system_return.s b/ports/arm9/iar/src/tx_thread_system_return.s
index e8660d9b..d428d4a6 100644
--- a/ports/arm9/iar/src/tx_thread_system_return.s
+++ b/ports/arm9/iar/src/tx_thread_system_return.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 */
;/** */
@@ -42,44 +42,38 @@ DISABLE_INTS DEFINE 0x80 ; IRQ interrupts disabled
;
;
;
-;/**************************************************************************/
-;/* */
-;/* FUNCTION RELEASE */
-;/* */
-;/* _tx_thread_system_return ARM9/IAR */
+;/**************************************************************************/
+;/* */
+;/* FUNCTION RELEASE */
+;/* */
+;/* _tx_thread_system_return ARM9/IAR */
;/* 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 */
-;/* */
-;/* DATE NAME DESCRIPTION */
;/* */
-;/* 09-30-2020 William E. Lamie Initial Version 6.1 */
+;/* 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 */
;/* */
;/**************************************************************************/
;VOID _tx_thread_system_return(VOID)
@@ -95,7 +89,7 @@ _tx_thread_system_return
MOV r0, #0 ; Build a solicited stack type
MRS r1, CPSR ; Pickup the CPSR
STMDB sp!, {r0-r1, r4-r11, lr} ; Save minimal context
-;
+;
; /* Lockout interrupts. */
;
ORR r2, r1, #DISABLE_INTS ; Build disable interrupt CPSR
diff --git a/ports/arm9/iar/src/tx_thread_vectored_context_save.s b/ports/arm9/iar/src/tx_thread_vectored_context_save.s
index 1aa26ae1..ce1b9d5b 100644
--- a/ports/arm9/iar/src/tx_thread_vectored_context_save.s
+++ b/ports/arm9/iar/src/tx_thread_vectored_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 */
;/** */
@@ -41,43 +41,37 @@ DISABLE_INTS DEFINE 0x80 ; IRQ interrupts disabled
EXTERN _tx_execution_isr_enter
;
;
-;/**************************************************************************/
-;/* */
-;/* FUNCTION RELEASE */
-;/* */
-;/* _tx_thread_vectored_context_save ARM9/IAR */
+;/**************************************************************************/
+;/* */
+;/* FUNCTION RELEASE */
+;/* */
+;/* _tx_thread_vectored_context_save ARM9/IAR */
;/* 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 */
-;/* */
-;/* DATE NAME DESCRIPTION */
;/* */
-;/* 09-30-2020 William E. Lamie Initial Version 6.1 */
+;/* 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_vectored_context_save(VOID)
@@ -139,7 +133,7 @@ __tx_thread_not_nested_save
LDR r1, =_tx_thread_current_ptr ; Pickup address of current thread ptr
LDR r0, [r1, #0] ; Pickup current thread pointer
CMP r0, #0 ; Is it NULL?
- BEQ __tx_thread_idle_system_save ; If so, interrupt occured in
+ BEQ __tx_thread_idle_system_save ; If so, interrupt occured in
; scheduling loop - nothing needs saving!
;
; /* Note: Minimal context of interrupted thread is already saved. */
@@ -171,7 +165,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 IRQ
+; /* Not much to do here, just adjust the stack pointer, and return to IRQ
; processing. */
;
MOV r10, #0 ; Clear stack limit
diff --git a/ports/arm9/iar/src/tx_timer_interrupt.s b/ports/arm9/iar/src/tx_timer_interrupt.s
index 28bac145..367e629f 100644
--- a/ports/arm9/iar/src/tx_timer_interrupt.s
+++ b/ports/arm9/iar/src/tx_timer_interrupt.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 */
;/** */
;/** Timer */
;/** */
@@ -43,46 +43,40 @@
;
;
;
-;/**************************************************************************/
-;/* */
-;/* FUNCTION RELEASE */
-;/* */
-;/* _tx_timer_interrupt ARM9/IAR */
+;/**************************************************************************/
+;/* */
+;/* FUNCTION RELEASE */
+;/* */
+;/* _tx_timer_interrupt ARM9/IAR */
;/* 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_timer_expiration_process Timer expiration processing */
-;/* _tx_thread_time_slice Time-slice interrupted thread */
-;/* */
-;/* CALLED BY */
-;/* */
-;/* interrupt vector */
-;/* */
-;/* RELEASE HISTORY */
-;/* */
-;/* DATE NAME DESCRIPTION */
;/* */
-;/* 09-30-2020 William E. Lamie Initial Version 6.1 */
+;/* 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_timer_expiration_process Timer expiration processing */
+;/* _tx_thread_time_slice Time-slice interrupted thread */
+;/* */
+;/* CALLED BY */
+;/* */
+;/* interrupt vector */
;/* */
;/**************************************************************************/
;VOID _tx_timer_interrupt(VOID)
@@ -108,7 +102,7 @@ _tx_timer_interrupt
; if (_tx_timer_time_slice)
; {
;
- LDR r3, =_tx_timer_time_slice ; Pickup address of time-slice
+ LDR r3, =_tx_timer_time_slice ; Pickup address of time-slice
LDR r2, [r3, #0] ; Pickup time-slice
CMP r2, #0 ; Is it non-active?
BEQ __tx_timer_no_time_slice ; Yes, skip time-slice processing
@@ -226,13 +220,13 @@ __tx_timer_dont_activate
; if (_tx_timer_expired_time_slice)
; {
;
- LDR r3, =_tx_timer_expired_time_slice ; Pickup addr of time-slice expired
+ LDR r3, =_tx_timer_expired_time_slice ; Pickup addr of time-slice expired
LDR r2, [r3, #0] ; Pickup the actual flag
CMP r2, #0 ; See if the flag is set
BEQ __tx_timer_not_ts_expiration ; No, skip time-slice processing
;
; /* Time slice interrupted thread. */
-; _tx_thread_time_slice();
+; _tx_thread_time_slice();
BL _tx_thread_time_slice ; Call time-slice processing
;