From dd97593c57175fe774df5db935497cc06c11ad2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paulo=20Conde=C3=A7a?= Date: Thu, 1 Jun 2023 13:11:56 +0100 Subject: [PATCH 01/10] Update tx_port.h removed extra spaces --- ports_smp/cortex_a75_smp/gnu/inc/tx_port.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports_smp/cortex_a75_smp/gnu/inc/tx_port.h b/ports_smp/cortex_a75_smp/gnu/inc/tx_port.h index 019db6eb9..c3e26cbc4 100644 --- a/ports_smp/cortex_a75_smp/gnu/inc/tx_port.h +++ b/ports_smp/cortex_a75_smp/gnu/inc/tx_port.h @@ -196,7 +196,7 @@ typedef unsigned long long ALIGN_TYPE; /* Define various constants for the ThreadX ARM port. */ #define TX_INT_DISABLE 0xC0 /* Disable IRQ & FIQ interrupts */ -#define TX_INT_ENABLE 0x00 /* Enable IRQ & FIQ interrupts */ +#define TX_INT_ENABLE 0x00 /* Enable IRQ & FIQ interrupts */ /* Define the clock source for trace event entry time stamp. The following two item are port specific. From 4373af728647cf50101487634d0233f3fd07f56e Mon Sep 17 00:00:00 2001 From: Du Huanpeng Date: Wed, 14 Jun 2023 11:52:15 +0800 Subject: [PATCH 02/10] fix link flag to -mcpu=cortex-a9 Signed-off-by: Du Huanpeng --- .../cortex_a9_smp/gnu/example_build/build_threadx_sample.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports_smp/cortex_a9_smp/gnu/example_build/build_threadx_sample.bat b/ports_smp/cortex_a9_smp/gnu/example_build/build_threadx_sample.bat index 22d0a618b..0e2611181 100644 --- a/ports_smp/cortex_a9_smp/gnu/example_build/build_threadx_sample.bat +++ b/ports_smp/cortex_a9_smp/gnu/example_build/build_threadx_sample.bat @@ -1,4 +1,4 @@ -arm-none-eabi-gcc -c -g -I../../../../common_smp/inc -I../inc -mcpu=cortex-a5 sample_threadx.c +arm-none-eabi-gcc -c -g -I../../../../common_smp/inc -I../inc -mcpu=cortex-a9 sample_threadx.c arm-none-eabi-gcc -c -g -mcpu=cortex-a9 startup.S arm-none-eabi-gcc -c -g -mcpu=cortex-a9 MP_GIC.S arm-none-eabi-gcc -c -g -mcpu=cortex-a9 MP_SCU.S From 5892fe15b5e03fabf021e33747c07cabb31e1c54 Mon Sep 17 00:00:00 2001 From: Du Huanpeng Date: Wed, 14 Jun 2023 16:38:12 +0800 Subject: [PATCH 03/10] Remove duplicate declaration "invalidateCaches_IS" Signed-off-by: Du Huanpeng --- ports_smp/cortex_a5_smp/ac5/example_build/sample_threadx/v7.h | 1 - ports_smp/cortex_a5_smp/gnu/example_build/v7.h | 1 - ports_smp/cortex_a7_smp/ac5/example_build/sample_threadx/v7.h | 1 - ports_smp/cortex_a7_smp/gnu/example_build/v7.h | 1 - ports_smp/cortex_a9_smp/gnu/example_build/v7.h | 1 - 5 files changed, 5 deletions(-) diff --git a/ports_smp/cortex_a5_smp/ac5/example_build/sample_threadx/v7.h b/ports_smp/cortex_a5_smp/ac5/example_build/sample_threadx/v7.h index 5a08b43fd..6016ef64f 100644 --- a/ports_smp/cortex_a5_smp/ac5/example_build/sample_threadx/v7.h +++ b/ports_smp/cortex_a5_smp/ac5/example_build/sample_threadx/v7.h @@ -35,7 +35,6 @@ void disableInterrupts(void); // ------------------------------------------------------------ // Caches -void invalidateCaches_IS(void); void cleanInvalidateDCache(void); void invalidateCaches_IS(void); void enableCaches(void); diff --git a/ports_smp/cortex_a5_smp/gnu/example_build/v7.h b/ports_smp/cortex_a5_smp/gnu/example_build/v7.h index 5a08b43fd..6016ef64f 100644 --- a/ports_smp/cortex_a5_smp/gnu/example_build/v7.h +++ b/ports_smp/cortex_a5_smp/gnu/example_build/v7.h @@ -35,7 +35,6 @@ void disableInterrupts(void); // ------------------------------------------------------------ // Caches -void invalidateCaches_IS(void); void cleanInvalidateDCache(void); void invalidateCaches_IS(void); void enableCaches(void); diff --git a/ports_smp/cortex_a7_smp/ac5/example_build/sample_threadx/v7.h b/ports_smp/cortex_a7_smp/ac5/example_build/sample_threadx/v7.h index 5a08b43fd..6016ef64f 100644 --- a/ports_smp/cortex_a7_smp/ac5/example_build/sample_threadx/v7.h +++ b/ports_smp/cortex_a7_smp/ac5/example_build/sample_threadx/v7.h @@ -35,7 +35,6 @@ void disableInterrupts(void); // ------------------------------------------------------------ // Caches -void invalidateCaches_IS(void); void cleanInvalidateDCache(void); void invalidateCaches_IS(void); void enableCaches(void); diff --git a/ports_smp/cortex_a7_smp/gnu/example_build/v7.h b/ports_smp/cortex_a7_smp/gnu/example_build/v7.h index 0fc0183f3..88e88508d 100644 --- a/ports_smp/cortex_a7_smp/gnu/example_build/v7.h +++ b/ports_smp/cortex_a7_smp/gnu/example_build/v7.h @@ -23,7 +23,6 @@ void disableInterrupts(void); // ------------------------------------------------------------ // Caches -void invalidateCaches_IS(void); void cleanInvalidateDCache(void); void invalidateCaches_IS(void); void enableCaches(void); diff --git a/ports_smp/cortex_a9_smp/gnu/example_build/v7.h b/ports_smp/cortex_a9_smp/gnu/example_build/v7.h index 5a08b43fd..6016ef64f 100644 --- a/ports_smp/cortex_a9_smp/gnu/example_build/v7.h +++ b/ports_smp/cortex_a9_smp/gnu/example_build/v7.h @@ -35,7 +35,6 @@ void disableInterrupts(void); // ------------------------------------------------------------ // Caches -void invalidateCaches_IS(void); void cleanInvalidateDCache(void); void invalidateCaches_IS(void); void enableCaches(void); From 5d619e5c4ba36fdf4fe5bc6ffb34f18dc7076ac5 Mon Sep 17 00:00:00 2001 From: Alex Kiselev Date: Wed, 21 Jun 2023 09:08:45 +0200 Subject: [PATCH 04/10] SysTick initialization problem fixed in tx_initialize_low_level.s Problem with first system tick was detected, it needs much more time for the first tick as it's defined. The reason for this behavior is incorrect initialization of the SysTick timer in the port file for the Cortex-M0. It doesn't reset the SysTick Current Value Register despite the fact that its value is not initialized at startup (see https://developer.arm.com/documentation/dui0552/a/cortex-m3-peripherals/system-timer--systick). So if we have 0xFFFFFF (this register has 24-bit), it means we will get about 256*256*256 / 48000000 for the tact frequency of 48MHz to reach the zero, that makes 350ms delay at startup. --- ports/cortex_m0/ac5/example_build/tx_initialize_low_level.s | 3 +++ ports/cortex_m0/gnu/example_build/tx_initialize_low_level.S | 3 +++ ports/cortex_m0/iar/example_build/tx_initialize_low_level.s | 3 +++ ports/cortex_m0/keil/example_build/tx_initialize_low_level.s | 3 +++ 4 files changed, 12 insertions(+) diff --git a/ports/cortex_m0/ac5/example_build/tx_initialize_low_level.s b/ports/cortex_m0/ac5/example_build/tx_initialize_low_level.s index 4a4f20db6..0c19cc2fe 100644 --- a/ports/cortex_m0/ac5/example_build/tx_initialize_low_level.s +++ b/ports/cortex_m0/ac5/example_build/tx_initialize_low_level.s @@ -176,6 +176,9 @@ _tx_initialize_low_level ; /* Configure SysTick. */ ; LDR r0, =0xE000E000 ; Build address of NVIC registers + LDR r1, =0 + STR r1, [r0, #0x10] // Reset SysTick Control + STR r1, [r0, #0x18] // Reset SysTick Counter Value LDR r1, =SYSTICK_CYCLES STR r1, [r0, #0x14] ; Setup SysTick Reload Value MOVS r1, #0x7 ; Build SysTick Control Enable Value diff --git a/ports/cortex_m0/gnu/example_build/tx_initialize_low_level.S b/ports/cortex_m0/gnu/example_build/tx_initialize_low_level.S index aaf3ece2c..fd08b2822 100644 --- a/ports/cortex_m0/gnu/example_build/tx_initialize_low_level.S +++ b/ports/cortex_m0/gnu/example_build/tx_initialize_low_level.S @@ -134,6 +134,9 @@ _tx_initialize_low_level: @ /* Configure SysTick for 100Hz clock, or 16384 cycles if no reference. */ @ LDR r0, =0xE000E000 @ Build address of NVIC registers + LDR r1, =0 + STR r1, [r0, #0x10] // Reset SysTick Control + STR r1, [r0, #0x18] // Reset SysTick Counter Value LDR r1, =SYSTICK_CYCLES STR r1, [r0, #0x14] // Setup SysTick Reload Value LDR r1, =0x7 // Build SysTick Control Enable Value diff --git a/ports/cortex_m0/iar/example_build/tx_initialize_low_level.s b/ports/cortex_m0/iar/example_build/tx_initialize_low_level.s index 3de316e59..09742eccc 100644 --- a/ports/cortex_m0/iar/example_build/tx_initialize_low_level.s +++ b/ports/cortex_m0/iar/example_build/tx_initialize_low_level.s @@ -125,6 +125,9 @@ _tx_initialize_low_level: ; /* Configure SysTick. */ ; LDR r0, =0xE000E000 ; Build address of NVIC registers + LDR r1, =0 + STR r1, [r0, #0x10] // Reset SysTick Control + STR r1, [r0, #0x18] // Reset SysTick Counter Value LDR r1, =SYSTICK_CYCLES STR r1, [r0, #0x14] ; Setup SysTick Reload Value MOVS r1, #0x7 ; Build SysTick Control Enable Value diff --git a/ports/cortex_m0/keil/example_build/tx_initialize_low_level.s b/ports/cortex_m0/keil/example_build/tx_initialize_low_level.s index 4a4f20db6..0c19cc2fe 100644 --- a/ports/cortex_m0/keil/example_build/tx_initialize_low_level.s +++ b/ports/cortex_m0/keil/example_build/tx_initialize_low_level.s @@ -176,6 +176,9 @@ _tx_initialize_low_level ; /* Configure SysTick. */ ; LDR r0, =0xE000E000 ; Build address of NVIC registers + LDR r1, =0 + STR r1, [r0, #0x10] // Reset SysTick Control + STR r1, [r0, #0x18] // Reset SysTick Counter Value LDR r1, =SYSTICK_CYCLES STR r1, [r0, #0x14] ; Setup SysTick Reload Value MOVS r1, #0x7 ; Build SysTick Control Enable Value From 9d29a9a8de6277b6df1f6f5c5717351a9c75f68c Mon Sep 17 00:00:00 2001 From: Yang Hau Date: Sun, 18 Feb 2024 21:06:56 +0900 Subject: [PATCH 05/10] fix the typos --- test/smp/cmake/regression/CMakeLists.txt | 4 +- test/smp/regression/testcontrol.c | 14 +- .../threadx_mutex_information_test.c | 34 ++--- ...x_mutex_nested_priority_inheritance_test.c | 4 +- ..._smp_resume_suspend_accending_order_test.c | 66 ++++----- ..._smp_resume_suspend_decending_order_test.c | 134 +++++++++--------- .../threadx_thread_basic_execution_test.c | 4 +- .../threadx_thread_delayed_suspension_test.c | 18 +-- .../threadx_thread_simple_suspend_test.c | 2 +- .../threadx_thread_sleep_for_100ticks_test.c | 24 ++-- .../threadx_thread_terminate_delete_test.c | 2 +- test/tx/regression/testcontrol.c | 6 +- .../threadx_mutex_information_test.c | 34 ++--- ...x_mutex_nested_priority_inheritance_test.c | 4 +- .../threadx_thread_basic_execution_test.c | 4 +- .../threadx_thread_delayed_suspension_test.c | 18 +-- .../threadx_thread_simple_suspend_test.c | 2 +- .../threadx_thread_sleep_for_100ticks_test.c | 24 ++-- .../threadx_thread_terminate_delete_test.c | 2 +- 19 files changed, 200 insertions(+), 200 deletions(-) diff --git a/test/smp/cmake/regression/CMakeLists.txt b/test/smp/cmake/regression/CMakeLists.txt index ad002d185..6b68f711e 100644 --- a/test/smp/cmake/regression/CMakeLists.txt +++ b/test/smp/cmake/regression/CMakeLists.txt @@ -74,8 +74,8 @@ set(regression_test_cases ${SOURCE_DIR}/threadx_smp_random_resume_suspend_test.c ${SOURCE_DIR}/threadx_smp_rebalance_exclusion_test.c ${SOURCE_DIR}/threadx_smp_relinquish_test.c - ${SOURCE_DIR}/threadx_smp_resume_suspend_accending_order_test.c - ${SOURCE_DIR}/threadx_smp_resume_suspend_decending_order_test.c + ${SOURCE_DIR}/threadx_smp_resume_suspend_ascending_order_test.c + ${SOURCE_DIR}/threadx_smp_resume_suspend_descending_order_test.c ${SOURCE_DIR}/threadx_smp_time_slice_test.c ${SOURCE_DIR}/threadx_smp_two_threads_one_core_test.c ${SOURCE_DIR}/threadx_thread_basic_execution_test.c diff --git a/test/smp/regression/testcontrol.c b/test/smp/regression/testcontrol.c index 8e3d872e4..ed2991956 100644 --- a/test/smp/regression/testcontrol.c +++ b/test/smp/regression/testcontrol.c @@ -208,7 +208,7 @@ void threadx_semaphore_information_application_define(void *); void threadx_thread_basic_execution_application_define(void *); void threadx_thread_completed_application_define(void *); void threadx_thread_relinquish_application_define(void *); -void threadx_thread_simple_supsend_application_define(void *); +void threadx_thread_simple_suspend_application_define(void *); void threadx_thread_multiple_suspension_application_define(void *); void threadx_thread_multiple_non_current_suspension_application_define(void *); void threadx_thread_multi_level_preemption_threshold_application_define(void *); @@ -249,8 +249,8 @@ void threadx_smp_two_threads_one_core_test(void *first_unused_memory); void threadx_smp_multiple_threads_one_core_test(void *first_unused_memory); void threadx_smp_one_thread_dynamic_exclusion_test(void *first_unused_memory); void threadx_smp_non_trivial_scheduling_test(void *first_unused_memory); -void threadx_smp_resume_suspend_accending_order_test(void *first_unused_memory); -void threadx_smp_resume_suspend_decending_order_test(void *first_unused_memory); +void threadx_smp_resume_suspend_ascending_order_test(void *first_unused_memory); +void threadx_smp_resume_suspend_descending_order_test(void *first_unused_memory); void threadx_smp_preemption_threshold_test(void *first_unused_memory); void threadx_smp_relinquish_test(void *first_unused_memory); void threadx_smp_time_slice_test(void *first_unused_memory); @@ -273,8 +273,8 @@ TEST_ENTRY test_control_tests[] = threadx_smp_multiple_threads_one_core_test, threadx_smp_one_thread_dynamic_exclusion_test, threadx_smp_non_trivial_scheduling_test, - threadx_smp_resume_suspend_accending_order_test, - threadx_smp_resume_suspend_decending_order_test, + threadx_smp_resume_suspend_ascending_order_test, + threadx_smp_resume_suspend_descending_order_test, threadx_smp_preemption_threshold_test, threadx_smp_relinquish_test, threadx_smp_time_slice_test, @@ -351,7 +351,7 @@ TEST_ENTRY test_control_tests[] = threadx_thread_basic_execution_application_define, threadx_thread_completed_application_define, threadx_thread_relinquish_application_define, - threadx_thread_simple_supsend_application_define, + threadx_thread_simple_suspend_application_define, threadx_thread_multiple_suspension_application_define, threadx_thread_multiple_non_current_suspension_application_define, threadx_thread_multi_level_preemption_threshold_application_define, @@ -1428,7 +1428,7 @@ UINT old_posture = TX_INT_ENABLE; if (old_posture == TX_INT_DISABLE) { - /* System error - interrupts should alwasy be enabled in our test threads! */ + /* System error - interrupts should always be enabled in our test threads! */ printf(" ***** SYSTEM ERROR ***** test returned with interrupts disabled!\n"); test_control_system_errors++; } diff --git a/test/smp/regression/threadx_mutex_information_test.c b/test/smp/regression/threadx_mutex_information_test.c index e95c16c6b..76d04e75c 100644 --- a/test/smp/regression/threadx_mutex_information_test.c +++ b/test/smp/regression/threadx_mutex_information_test.c @@ -312,7 +312,7 @@ ULONG inheritances; test_control_return(1); } - /* Now get the performance inforamtion. */ + /* Now get the performance information. */ status = tx_mutex_performance_info_get(&mutex_2, &puts, &gets, &suspensions, &timeouts, &inversions, &inheritances); /* Check status. */ @@ -326,7 +326,7 @@ ULONG inheritances; test_control_return(1); } - /* Now get the system performance inforamtion. */ + /* Now get the system performance information. */ status = tx_mutex_performance_system_info_get(&puts, &gets, &suspensions, &timeouts, &inversions, &inheritances); /* Check status. */ @@ -342,7 +342,7 @@ ULONG inheritances; #else - /* Now get the performance inforamtion. */ + /* Now get the performance information. */ status = tx_mutex_performance_info_get(&mutex_2, &puts, &gets, &suspensions, &timeouts, &inversions, &inheritances); /* Check status. */ @@ -354,7 +354,7 @@ ULONG inheritances; test_control_return(1); } - /* Now get the performance inforamtion. */ + /* Now get the performance information. */ status = tx_mutex_performance_info_get(TX_NULL, &puts, &gets, &suspensions, &timeouts, &inversions, &inheritances); /* Check status. */ @@ -366,7 +366,7 @@ ULONG inheritances; test_control_return(1); } - /* Now get the performance inforamtion. */ + /* Now get the performance information. */ status = tx_mutex_performance_info_get(TX_NULL, TX_NULL, &gets, &suspensions, &timeouts, &inversions, &inheritances); /* Check status. */ @@ -378,7 +378,7 @@ ULONG inheritances; test_control_return(1); } - /* Now get the performance inforamtion. */ + /* Now get the performance information. */ status = tx_mutex_performance_info_get(TX_NULL, TX_NULL, TX_NULL, &suspensions, &timeouts, &inversions, &inheritances); /* Check status. */ @@ -390,7 +390,7 @@ ULONG inheritances; test_control_return(1); } - /* Now get the performance inforamtion. */ + /* Now get the performance information. */ status = tx_mutex_performance_info_get(TX_NULL, TX_NULL, TX_NULL, TX_NULL, &timeouts, &inversions, &inheritances); /* Check status. */ @@ -402,7 +402,7 @@ ULONG inheritances; test_control_return(1); } - /* Now get the performance inforamtion. */ + /* Now get the performance information. */ status = tx_mutex_performance_info_get(TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, &inversions, &inheritances); /* Check status. */ @@ -414,7 +414,7 @@ ULONG inheritances; test_control_return(1); } - /* Now get the performance inforamtion. */ + /* Now get the performance information. */ status = tx_mutex_performance_info_get(TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, &inheritances); /* Check status. */ @@ -426,7 +426,7 @@ ULONG inheritances; test_control_return(1); } - /* Now get the performance inforamtion. */ + /* Now get the performance information. */ status = tx_mutex_performance_info_get(TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL); /* Check status. */ @@ -438,7 +438,7 @@ ULONG inheritances; test_control_return(1); } - /* Now get the system performance inforamtion. */ + /* Now get the system performance information. */ status = tx_mutex_performance_system_info_get(&puts, &gets, &suspensions, &timeouts, &inversions, &inheritances); /* Check status. */ @@ -450,7 +450,7 @@ ULONG inheritances; test_control_return(1); } - /* Now get the system performance inforamtion. */ + /* Now get the system performance information. */ status = tx_mutex_performance_system_info_get(TX_NULL, &gets, &suspensions, &timeouts, &inversions, &inheritances); /* Check status. */ @@ -462,7 +462,7 @@ ULONG inheritances; test_control_return(1); } - /* Now get the system performance inforamtion. */ + /* Now get the system performance information. */ status = tx_mutex_performance_system_info_get(TX_NULL, TX_NULL, &suspensions, &timeouts, &inversions, &inheritances); /* Check status. */ @@ -474,7 +474,7 @@ ULONG inheritances; test_control_return(1); } - /* Now get the system performance inforamtion. */ + /* Now get the system performance information. */ status = tx_mutex_performance_system_info_get(TX_NULL, TX_NULL, TX_NULL, &timeouts, &inversions, &inheritances); /* Check status. */ @@ -486,7 +486,7 @@ ULONG inheritances; test_control_return(1); } - /* Now get the system performance inforamtion. */ + /* Now get the system performance information. */ status = tx_mutex_performance_system_info_get(TX_NULL, TX_NULL, TX_NULL, TX_NULL, &inversions, &inheritances); /* Check status. */ @@ -498,7 +498,7 @@ ULONG inheritances; test_control_return(1); } - /* Now get the system performance inforamtion. */ + /* Now get the system performance information. */ status = tx_mutex_performance_system_info_get(TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, &inheritances); /* Check status. */ @@ -510,7 +510,7 @@ ULONG inheritances; test_control_return(1); } - /* Now get the system performance inforamtion. */ + /* Now get the system performance information. */ status = tx_mutex_performance_system_info_get(TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL); /* Check status. */ diff --git a/test/smp/regression/threadx_mutex_nested_priority_inheritance_test.c b/test/smp/regression/threadx_mutex_nested_priority_inheritance_test.c index 7397b4e2d..1738527e4 100644 --- a/test/smp/regression/threadx_mutex_nested_priority_inheritance_test.c +++ b/test/smp/regression/threadx_mutex_nested_priority_inheritance_test.c @@ -404,7 +404,7 @@ UINT status; tx_mutex_put(&mutex_2); - /* Should reurn us back to priority 15. */ + /* Should return us back to priority 15. */ if (thread_0.tx_thread_priority != 15) { @@ -441,7 +441,7 @@ UINT status; tx_mutex_put(&mutex_2); - /* Should reurn us back to priority 8. */ + /* Should return us back to priority 8. */ if (thread_0.tx_thread_priority != 8) { diff --git a/test/smp/regression/threadx_smp_resume_suspend_accending_order_test.c b/test/smp/regression/threadx_smp_resume_suspend_accending_order_test.c index 3a845878c..35ef18933 100644 --- a/test/smp/regression/threadx_smp_resume_suspend_accending_order_test.c +++ b/test/smp/regression/threadx_smp_resume_suspend_accending_order_test.c @@ -1,4 +1,4 @@ -/* Define the ThreadX SMP resume and suspend threads in accending order test. */ +/* Define the ThreadX SMP resume and suspend threads in ascending order test. */ #include #include "tx_api.h" @@ -71,7 +71,7 @@ static void delay(UINT i) #ifdef CTEST void test_application_define(void *first_unused_memory) #else -void threadx_smp_resume_suspend_accending_order_test(void *first_unused_memory) +void threadx_smp_resume_suspend_ascending_order_test(void *first_unused_memory) #endif { @@ -969,7 +969,7 @@ UINT status; test_control_return(1); } - /* Suspend thread in accending priority. */ + /* Suspend thread in ascending priority. */ delay(1); status = tx_thread_suspend(&thread_1); @@ -983,7 +983,7 @@ UINT status; test_control_return(1); } - /* Suspend thread in accending priority. */ + /* Suspend thread in ascending priority. */ delay(2); status = tx_thread_suspend(&thread_2); @@ -997,7 +997,7 @@ UINT status; test_control_return(1); } - /* Suspend thread in accending priority. */ + /* Suspend thread in ascending priority. */ delay(3); status = tx_thread_suspend(&thread_3); @@ -1011,7 +1011,7 @@ UINT status; test_control_return(1); } - /* Suspend thread in accending priority. */ + /* Suspend thread in ascending priority. */ delay(4); status = tx_thread_suspend(&thread_4); @@ -1025,7 +1025,7 @@ UINT status; test_control_return(1); } - /* Suspend thread in accending priority. */ + /* Suspend thread in ascending priority. */ delay(5); status = tx_thread_suspend(&thread_5); @@ -1039,7 +1039,7 @@ UINT status; test_control_return(1); } - /* Suspend thread in accending priority. */ + /* Suspend thread in ascending priority. */ delay(6); status = tx_thread_suspend(&thread_6); @@ -1053,7 +1053,7 @@ UINT status; test_control_return(1); } - /* Suspend thread in accending priority. */ + /* Suspend thread in ascending priority. */ delay(7); status = tx_thread_suspend(&thread_7); @@ -1067,7 +1067,7 @@ UINT status; test_control_return(1); } - /* Suspend thread in accending priority. */ + /* Suspend thread in ascending priority. */ delay(8); status = tx_thread_suspend(&thread_8); @@ -1081,7 +1081,7 @@ UINT status; test_control_return(1); } - /* Suspend thread in accending priority. */ + /* Suspend thread in ascending priority. */ delay(9); status = tx_thread_suspend(&thread_9); @@ -1095,7 +1095,7 @@ UINT status; test_control_return(1); } - /* Suspend thread in accending priority. */ + /* Suspend thread in ascending priority. */ delay(10); status = tx_thread_suspend(&thread_10); @@ -1109,7 +1109,7 @@ UINT status; test_control_return(1); } - /* Suspend thread in accending priority. */ + /* Suspend thread in ascending priority. */ delay(11); status = tx_thread_suspend(&thread_11); @@ -1123,7 +1123,7 @@ UINT status; test_control_return(1); } - /* Suspend thread in accending priority. */ + /* Suspend thread in ascending priority. */ delay(12); status = tx_thread_suspend(&thread_12); @@ -1137,7 +1137,7 @@ UINT status; test_control_return(1); } - /* Suspend thread in accending priority. */ + /* Suspend thread in ascending priority. */ delay(13); status = tx_thread_suspend(&thread_13); @@ -1151,7 +1151,7 @@ UINT status; test_control_return(1); } - /* Suspend thread in accending priority. */ + /* Suspend thread in ascending priority. */ delay(14); status = tx_thread_suspend(&thread_14); @@ -1165,7 +1165,7 @@ UINT status; test_control_return(1); } - /* Suspend thread in accending priority. */ + /* Suspend thread in ascending priority. */ delay(15); status = tx_thread_suspend(&thread_15); @@ -1179,7 +1179,7 @@ UINT status; test_control_return(1); } - /* Suspend thread in accending priority. */ + /* Suspend thread in ascending priority. */ delay(16); status = tx_thread_suspend(&thread_16); @@ -1193,7 +1193,7 @@ UINT status; test_control_return(1); } - /* Suspend thread in accending priority. */ + /* Suspend thread in ascending priority. */ delay(17); status = tx_thread_suspend(&thread_17); @@ -1207,7 +1207,7 @@ UINT status; test_control_return(1); } - /* Suspend thread in accending priority. */ + /* Suspend thread in ascending priority. */ delay(18); status = tx_thread_suspend(&thread_18); @@ -1221,7 +1221,7 @@ UINT status; test_control_return(1); } - /* Suspend thread in accending priority. */ + /* Suspend thread in ascending priority. */ delay(19); status = tx_thread_suspend(&thread_19); @@ -1235,7 +1235,7 @@ UINT status; test_control_return(1); } - /* Suspend thread in accending priority. */ + /* Suspend thread in ascending priority. */ delay(20); status = tx_thread_suspend(&thread_20); @@ -1249,7 +1249,7 @@ UINT status; test_control_return(1); } - /* Suspend thread in accending priority. */ + /* Suspend thread in ascending priority. */ delay(21); status = tx_thread_suspend(&thread_21); @@ -1263,7 +1263,7 @@ UINT status; test_control_return(1); } - /* Suspend thread in accending priority. */ + /* Suspend thread in ascending priority. */ delay(22); status = tx_thread_suspend(&thread_22); @@ -1277,7 +1277,7 @@ UINT status; test_control_return(1); } - /* Suspend thread in accending priority. */ + /* Suspend thread in ascending priority. */ delay(23); status = tx_thread_suspend(&thread_23); @@ -1291,7 +1291,7 @@ UINT status; test_control_return(1); } - /* Suspend thread in accending priority. */ + /* Suspend thread in ascending priority. */ delay(24); status = tx_thread_suspend(&thread_24); @@ -1305,7 +1305,7 @@ UINT status; test_control_return(1); } - /* Suspend thread in accending priority. */ + /* Suspend thread in ascending priority. */ delay(25); status = tx_thread_suspend(&thread_25); @@ -1319,7 +1319,7 @@ UINT status; test_control_return(1); } - /* Suspend thread in accending priority. */ + /* Suspend thread in ascending priority. */ delay(26); status = tx_thread_suspend(&thread_26); @@ -1333,7 +1333,7 @@ UINT status; test_control_return(1); } - /* Suspend thread in accending priority. */ + /* Suspend thread in ascending priority. */ delay(27); status = tx_thread_suspend(&thread_27); @@ -1347,7 +1347,7 @@ UINT status; test_control_return(1); } - /* Suspend thread in accending priority. */ + /* Suspend thread in ascending priority. */ delay(28); status = tx_thread_suspend(&thread_28); @@ -1361,7 +1361,7 @@ UINT status; test_control_return(1); } - /* Suspend thread in accending priority. */ + /* Suspend thread in ascending priority. */ delay(29); status = tx_thread_suspend(&thread_29); @@ -1375,7 +1375,7 @@ UINT status; test_control_return(1); } - /* Suspend thread in accending priority. */ + /* Suspend thread in ascending priority. */ delay(30); status = tx_thread_suspend(&thread_30); @@ -1389,7 +1389,7 @@ UINT status; test_control_return(1); } - /* Suspend thread in accending priority. */ + /* Suspend thread in ascending priority. */ delay(31); status = tx_thread_suspend(&thread_31); diff --git a/test/smp/regression/threadx_smp_resume_suspend_decending_order_test.c b/test/smp/regression/threadx_smp_resume_suspend_decending_order_test.c index 6eae504e7..da159587e 100644 --- a/test/smp/regression/threadx_smp_resume_suspend_decending_order_test.c +++ b/test/smp/regression/threadx_smp_resume_suspend_decending_order_test.c @@ -1,4 +1,4 @@ -/* Define the ThreadX SMP resume and suspend threads in accending order test. */ +/* Define the ThreadX SMP resume and suspend threads in ascending order test. */ #include #include "tx_api.h" @@ -71,7 +71,7 @@ static void delay(UINT i) #ifdef CTEST void test_application_define(void *first_unused_memory) #else -void threadx_smp_resume_suspend_decending_order_test(void *first_unused_memory) +void threadx_smp_resume_suspend_descending_order_test(void *first_unused_memory) #endif { @@ -96,7 +96,7 @@ UINT i; if (status != TX_SUCCESS) { - printf("Running SMP Resume-Suspend Decending Priority Order Test............ ERROR #1\n"); + printf("Running SMP Resume-Suspend descending Priority Order Test............ ERROR #1\n"); test_control_return(1); } @@ -110,7 +110,7 @@ UINT i; if (status != TX_SUCCESS) { - printf("Running SMP Resume-Suspend Decending Priority Order Test............ ERROR #2\n"); + printf("Running SMP Resume-Suspend descending Priority Order Test............ ERROR #2\n"); test_control_return(1); } @@ -124,7 +124,7 @@ UINT i; if (status != TX_SUCCESS) { - printf("Running SMP Resume-Suspend Decending Priority Order Test............ ERROR #3\n"); + printf("Running SMP Resume-Suspend descending Priority Order Test............ ERROR #3\n"); test_control_return(1); } @@ -138,7 +138,7 @@ UINT i; if (status != TX_SUCCESS) { - printf("Running SMP Resume-Suspend Decending Priority Order Test............ ERROR #4\n"); + printf("Running SMP Resume-Suspend descending Priority Order Test............ ERROR #4\n"); test_control_return(1); } @@ -152,7 +152,7 @@ UINT i; if (status != TX_SUCCESS) { - printf("Running SMP Resume-Suspend Decending Priority Order Test............ ERROR #5\n"); + printf("Running SMP Resume-Suspend descending Priority Order Test............ ERROR #5\n"); test_control_return(1); } @@ -166,7 +166,7 @@ UINT i; if (status != TX_SUCCESS) { - printf("Running SMP Resume-Suspend Decending Priority Order Test............ ERROR #6\n"); + printf("Running SMP Resume-Suspend descending Priority Order Test............ ERROR #6\n"); test_control_return(1); } @@ -180,7 +180,7 @@ UINT i; if (status != TX_SUCCESS) { - printf("Running SMP Resume-Suspend Decending Priority Order Test............ ERROR #7\n"); + printf("Running SMP Resume-Suspend descending Priority Order Test............ ERROR #7\n"); test_control_return(1); } @@ -194,7 +194,7 @@ UINT i; if (status != TX_SUCCESS) { - printf("Running SMP Resume-Suspend Decending Priority Order Test............ ERROR #8\n"); + printf("Running SMP Resume-Suspend descending Priority Order Test............ ERROR #8\n"); test_control_return(1); } @@ -208,7 +208,7 @@ UINT i; if (status != TX_SUCCESS) { - printf("Running SMP Resume-Suspend Decending Priority Order Test............ ERROR #9\n"); + printf("Running SMP Resume-Suspend descending Priority Order Test............ ERROR #9\n"); test_control_return(1); } @@ -222,7 +222,7 @@ UINT i; if (status != TX_SUCCESS) { - printf("Running SMP Resume-Suspend Decending Priority Order Test............ ERROR #9\n"); + printf("Running SMP Resume-Suspend descending Priority Order Test............ ERROR #9\n"); test_control_return(1); } @@ -236,7 +236,7 @@ UINT i; if (status != TX_SUCCESS) { - printf("Running SMP Resume-Suspend Decending Priority Order Test............ ERROR #11\n"); + printf("Running SMP Resume-Suspend descending Priority Order Test............ ERROR #11\n"); test_control_return(1); } @@ -250,7 +250,7 @@ UINT i; if (status != TX_SUCCESS) { - printf("Running SMP Resume-Suspend Decending Priority Order Test............ ERROR #12\n"); + printf("Running SMP Resume-Suspend descending Priority Order Test............ ERROR #12\n"); test_control_return(1); } @@ -264,7 +264,7 @@ UINT i; if (status != TX_SUCCESS) { - printf("Running SMP Resume-Suspend Decending Priority Order Test............ ERROR #13\n"); + printf("Running SMP Resume-Suspend descending Priority Order Test............ ERROR #13\n"); test_control_return(1); } @@ -278,7 +278,7 @@ UINT i; if (status != TX_SUCCESS) { - printf("Running SMP Resume-Suspend Decending Priority Order Test............ ERROR #14\n"); + printf("Running SMP Resume-Suspend descending Priority Order Test............ ERROR #14\n"); test_control_return(1); } @@ -292,7 +292,7 @@ UINT i; if (status != TX_SUCCESS) { - printf("Running SMP Resume-Suspend Decending Priority Order Test............ ERROR #15\n"); + printf("Running SMP Resume-Suspend descending Priority Order Test............ ERROR #15\n"); test_control_return(1); } @@ -306,7 +306,7 @@ UINT i; if (status != TX_SUCCESS) { - printf("Running SMP Resume-Suspend Decending Priority Order Test............ ERROR #16\n"); + printf("Running SMP Resume-Suspend descending Priority Order Test............ ERROR #16\n"); test_control_return(1); } @@ -320,7 +320,7 @@ UINT i; if (status != TX_SUCCESS) { - printf("Running SMP Resume-Suspend Decending Priority Order Test............ ERROR #17\n"); + printf("Running SMP Resume-Suspend descending Priority Order Test............ ERROR #17\n"); test_control_return(1); } @@ -334,7 +334,7 @@ UINT i; if (status != TX_SUCCESS) { - printf("Running SMP Resume-Suspend Decending Priority Order Test............ ERROR #18\n"); + printf("Running SMP Resume-Suspend descending Priority Order Test............ ERROR #18\n"); test_control_return(1); } @@ -348,7 +348,7 @@ UINT i; if (status != TX_SUCCESS) { - printf("Running SMP Resume-Suspend Decending Priority Order Test............ ERROR #19\n"); + printf("Running SMP Resume-Suspend descending Priority Order Test............ ERROR #19\n"); test_control_return(1); } @@ -362,7 +362,7 @@ UINT i; if (status != TX_SUCCESS) { - printf("Running SMP Resume-Suspend Decending Priority Order Test............ ERROR #20\n"); + printf("Running SMP Resume-Suspend descending Priority Order Test............ ERROR #20\n"); test_control_return(1); } @@ -376,7 +376,7 @@ UINT i; if (status != TX_SUCCESS) { - printf("Running SMP Resume-Suspend Decending Priority Order Test............ ERROR #21\n"); + printf("Running SMP Resume-Suspend descending Priority Order Test............ ERROR #21\n"); test_control_return(1); } @@ -390,7 +390,7 @@ UINT i; if (status != TX_SUCCESS) { - printf("Running SMP Resume-Suspend Decending Priority Order Test............ ERROR #22\n"); + printf("Running SMP Resume-Suspend descending Priority Order Test............ ERROR #22\n"); test_control_return(1); } @@ -404,7 +404,7 @@ UINT i; if (status != TX_SUCCESS) { - printf("Running SMP Resume-Suspend Decending Priority Order Test............ ERROR #23\n"); + printf("Running SMP Resume-Suspend descending Priority Order Test............ ERROR #23\n"); test_control_return(1); } @@ -418,7 +418,7 @@ UINT i; if (status != TX_SUCCESS) { - printf("Running SMP Resume-Suspend Decending Priority Order Test............ ERROR #24\n"); + printf("Running SMP Resume-Suspend descending Priority Order Test............ ERROR #24\n"); test_control_return(1); } @@ -432,7 +432,7 @@ UINT i; if (status != TX_SUCCESS) { - printf("Running SMP Resume-Suspend Decending Priority Order Test............ ERROR #25\n"); + printf("Running SMP Resume-Suspend descending Priority Order Test............ ERROR #25\n"); test_control_return(1); } @@ -446,7 +446,7 @@ UINT i; if (status != TX_SUCCESS) { - printf("Running SMP Resume-Suspend Decending Priority Order Test............ ERROR #26\n"); + printf("Running SMP Resume-Suspend descending Priority Order Test............ ERROR #26\n"); test_control_return(1); } @@ -460,7 +460,7 @@ UINT i; if (status != TX_SUCCESS) { - printf("Running SMP Resume-Suspend Decending Priority Order Test............ ERROR #27\n"); + printf("Running SMP Resume-Suspend descending Priority Order Test............ ERROR #27\n"); test_control_return(1); } @@ -474,7 +474,7 @@ UINT i; if (status != TX_SUCCESS) { - printf("Running SMP Resume-Suspend Decending Priority Order Test............ ERROR #28\n"); + printf("Running SMP Resume-Suspend descending Priority Order Test............ ERROR #28\n"); test_control_return(1); } @@ -488,7 +488,7 @@ UINT i; if (status != TX_SUCCESS) { - printf("Running SMP Resume-Suspend Decending Priority Order Test............ ERROR #29\n"); + printf("Running SMP Resume-Suspend descending Priority Order Test............ ERROR #29\n"); test_control_return(1); } @@ -502,7 +502,7 @@ UINT i; if (status != TX_SUCCESS) { - printf("Running SMP Resume-Suspend Decending Priority Order Test............ ERROR #30\n"); + printf("Running SMP Resume-Suspend descending Priority Order Test............ ERROR #30\n"); test_control_return(1); } @@ -516,7 +516,7 @@ UINT i; if (status != TX_SUCCESS) { - printf("Running SMP Resume-Suspend Decending Priority Order Test............ ERROR #31\n"); + printf("Running SMP Resume-Suspend descending Priority Order Test............ ERROR #31\n"); test_control_return(1); } @@ -530,7 +530,7 @@ UINT i; if (status != TX_SUCCESS) { - printf("Running SMP Resume-Suspend Decending Priority Order Test............ ERROR #32\n"); + printf("Running SMP Resume-Suspend descending Priority Order Test............ ERROR #32\n"); test_control_return(1); } @@ -547,7 +547,7 @@ UINT i; if (status != TX_SUCCESS) { - printf("Running SMP Resume-Suspend Decending Priority Order Test............ ERROR #33\n"); + printf("Running SMP Resume-Suspend descending Priority Order Test............ ERROR #33\n"); test_control_return(1); } } @@ -564,7 +564,7 @@ UINT status; /* Inform user. */ - printf("Running SMP Resume-Suspend Decending Priority Order Test............ "); + printf("Running SMP Resume-Suspend descending Priority Order Test............ "); /* Resume all the threads. */ status = tx_thread_resume(&thread_31); @@ -999,7 +999,7 @@ UINT status; test_control_return(1); } - /* Suspend thread in decending priority. */ + /* Suspend thread in descending priority. */ status = tx_thread_suspend(&thread_31); /* Check for the correct results. */ @@ -1012,7 +1012,7 @@ UINT status; test_control_return(1); } - /* Suspend thread in accending priority. */ + /* Suspend thread in ascending priority. */ status = tx_thread_suspend(&thread_30); /* Check for the correct results. */ @@ -1025,7 +1025,7 @@ UINT status; test_control_return(1); } - /* Suspend thread in accending priority. */ + /* Suspend thread in ascending priority. */ status = tx_thread_suspend(&thread_29); /* Check for the correct results. */ @@ -1038,7 +1038,7 @@ UINT status; test_control_return(1); } - /* Suspend thread in accending priority. */ + /* Suspend thread in ascending priority. */ status = tx_thread_suspend(&thread_28); /* Check for the correct results. */ @@ -1051,7 +1051,7 @@ UINT status; test_control_return(1); } - /* Suspend thread in accending priority. */ + /* Suspend thread in ascending priority. */ status = tx_thread_suspend(&thread_27); /* Check for the correct results. */ @@ -1064,7 +1064,7 @@ UINT status; test_control_return(1); } - /* Suspend thread in accending priority. */ + /* Suspend thread in ascending priority. */ status = tx_thread_suspend(&thread_26); /* Check for the correct results. */ @@ -1077,7 +1077,7 @@ UINT status; test_control_return(1); } - /* Suspend thread in accending priority. */ + /* Suspend thread in ascending priority. */ status = tx_thread_suspend(&thread_25); /* Check for the correct results. */ @@ -1090,7 +1090,7 @@ UINT status; test_control_return(1); } - /* Suspend thread in accending priority. */ + /* Suspend thread in ascending priority. */ status = tx_thread_suspend(&thread_24); /* Check for the correct results. */ @@ -1103,7 +1103,7 @@ UINT status; test_control_return(1); } - /* Suspend thread in accending priority. */ + /* Suspend thread in ascending priority. */ status = tx_thread_suspend(&thread_23); /* Check for the correct results. */ @@ -1116,7 +1116,7 @@ UINT status; test_control_return(1); } - /* Suspend thread in accending priority. */ + /* Suspend thread in ascending priority. */ status = tx_thread_suspend(&thread_22); /* Check for the correct results. */ @@ -1129,7 +1129,7 @@ UINT status; test_control_return(1); } - /* Suspend thread in accending priority. */ + /* Suspend thread in ascending priority. */ status = tx_thread_suspend(&thread_21); /* Check for the correct results. */ @@ -1142,7 +1142,7 @@ UINT status; test_control_return(1); } - /* Suspend thread in accending priority. */ + /* Suspend thread in ascending priority. */ status = tx_thread_suspend(&thread_20); /* Check for the correct results. */ @@ -1155,7 +1155,7 @@ UINT status; test_control_return(1); } - /* Suspend thread in accending priority. */ + /* Suspend thread in ascending priority. */ status = tx_thread_suspend(&thread_19); /* Check for the correct results. */ @@ -1168,7 +1168,7 @@ UINT status; test_control_return(1); } - /* Suspend thread in accending priority. */ + /* Suspend thread in ascending priority. */ status = tx_thread_suspend(&thread_18); /* Check for the correct results. */ @@ -1181,7 +1181,7 @@ UINT status; test_control_return(1); } - /* Suspend thread in accending priority. */ + /* Suspend thread in ascending priority. */ status = tx_thread_suspend(&thread_17); /* Check for the correct results. */ @@ -1194,7 +1194,7 @@ UINT status; test_control_return(1); } - /* Suspend thread in accending priority. */ + /* Suspend thread in ascending priority. */ status = tx_thread_suspend(&thread_16); /* Check for the correct results. */ @@ -1207,7 +1207,7 @@ UINT status; test_control_return(1); } - /* Suspend thread in accending priority. */ + /* Suspend thread in ascending priority. */ status = tx_thread_suspend(&thread_15); /* Check for the correct results. */ @@ -1220,7 +1220,7 @@ UINT status; test_control_return(1); } - /* Suspend thread in accending priority. */ + /* Suspend thread in ascending priority. */ status = tx_thread_suspend(&thread_14); /* Check for the correct results. */ @@ -1233,7 +1233,7 @@ UINT status; test_control_return(1); } - /* Suspend thread in accending priority. */ + /* Suspend thread in ascending priority. */ status = tx_thread_suspend(&thread_13); /* Check for the correct results. */ @@ -1246,7 +1246,7 @@ UINT status; test_control_return(1); } - /* Suspend thread in accending priority. */ + /* Suspend thread in ascending priority. */ status = tx_thread_suspend(&thread_12); /* Check for the correct results. */ @@ -1259,7 +1259,7 @@ UINT status; test_control_return(1); } - /* Suspend thread in accending priority. */ + /* Suspend thread in ascending priority. */ status = tx_thread_suspend(&thread_11); /* Check for the correct results. */ @@ -1272,7 +1272,7 @@ UINT status; test_control_return(1); } - /* Suspend thread in accending priority. */ + /* Suspend thread in ascending priority. */ status = tx_thread_suspend(&thread_10); /* Check for the correct results. */ @@ -1285,7 +1285,7 @@ UINT status; test_control_return(1); } - /* Suspend thread in accending priority. */ + /* Suspend thread in ascending priority. */ status = tx_thread_suspend(&thread_9); /* Check for the correct results. */ @@ -1298,7 +1298,7 @@ UINT status; test_control_return(1); } - /* Suspend thread in accending priority. */ + /* Suspend thread in ascending priority. */ status = tx_thread_suspend(&thread_8); /* Check for the correct results. */ @@ -1311,7 +1311,7 @@ UINT status; test_control_return(1); } - /* Suspend thread in accending priority. */ + /* Suspend thread in ascending priority. */ status = tx_thread_suspend(&thread_7); /* Check for the correct results. */ @@ -1324,7 +1324,7 @@ UINT status; test_control_return(1); } - /* Suspend thread in accending priority. */ + /* Suspend thread in ascending priority. */ status = tx_thread_suspend(&thread_6); /* Check for the correct results. */ @@ -1337,7 +1337,7 @@ UINT status; test_control_return(1); } - /* Suspend thread in accending priority. */ + /* Suspend thread in ascending priority. */ status = tx_thread_suspend(&thread_5); /* Check for the correct results. */ @@ -1350,7 +1350,7 @@ UINT status; test_control_return(1); } - /* Suspend thread in accending priority. */ + /* Suspend thread in ascending priority. */ status = tx_thread_suspend(&thread_4); /* Check for the correct results. */ @@ -1363,7 +1363,7 @@ UINT status; test_control_return(1); } - /* Suspend thread in accending priority. */ + /* Suspend thread in ascending priority. */ status = tx_thread_suspend(&thread_3); /* Check for the correct results. */ @@ -1376,7 +1376,7 @@ UINT status; test_control_return(1); } - /* Suspend thread in accending priority. */ + /* Suspend thread in ascending priority. */ status = tx_thread_suspend(&thread_2); /* Check for the correct results. */ @@ -1389,7 +1389,7 @@ UINT status; test_control_return(1); } - /* Suspend thread in accending priority. */ + /* Suspend thread in ascending priority. */ status = tx_thread_suspend(&thread_1); /* Check for the correct results. */ diff --git a/test/smp/regression/threadx_thread_basic_execution_test.c b/test/smp/regression/threadx_thread_basic_execution_test.c index 02e18d249..df1070dae 100644 --- a/test/smp/regression/threadx_thread_basic_execution_test.c +++ b/test/smp/regression/threadx_thread_basic_execution_test.c @@ -741,7 +741,7 @@ VOID (*temp_mutex_release)(TX_THREAD *thread_ptr); test_control_return(1); } - /* Attempt a thread termiante with a NULL pointer. */ + /* Attempt a thread terminate with a NULL pointer. */ status = tx_thread_terminate(TX_NULL); /* Check for status. */ @@ -764,7 +764,7 @@ VOID (*temp_mutex_release)(TX_THREAD *thread_ptr); test_control_return(1); } - /* Attempt a thread time-slice chagne with a NULL pointer. */ + /* Attempt a thread time-slice change with a NULL pointer. */ status = tx_thread_time_slice_change(TX_NULL, 1, &old_time_slice); /* Check for status. */ diff --git a/test/smp/regression/threadx_thread_delayed_suspension_test.c b/test/smp/regression/threadx_thread_delayed_suspension_test.c index 6d6d27d0b..4b6955596 100644 --- a/test/smp/regression/threadx_thread_delayed_suspension_test.c +++ b/test/smp/regression/threadx_thread_delayed_suspension_test.c @@ -56,7 +56,7 @@ static volatile ULONG destination = 0; static ULONG start_time; static ULONG lower_bound; static ULONG upper_bound; -static ULONG current_itterations; +static ULONG current_iterations; #ifdef DEBUG_1 static ULONG last_loop_count; #endif @@ -106,8 +106,8 @@ ULONG i; if (upper_bound > max_loop_count) lower_bound = max_loop_count; - if ((current_itterations < lower_bound) || (current_itterations > upper_bound)) - current_itterations = lower_bound; + if ((current_iterations < lower_bound) || (current_iterations > upper_bound)) + current_iterations = lower_bound; #ifdef DEBUG_1 /* Last loop count. */ @@ -350,7 +350,7 @@ ULONG i; lower_bound = lower_bound - 5; upper_bound = max_loop_count + 5; - current_itterations = lower_bound; + current_iterations = lower_bound; /* This thread simply suspends over and over... */ while(1) @@ -366,20 +366,20 @@ ULONG i; /* Call delay function. */ delay_function(); loop_count++; - } while (loop_count < current_itterations); + } while (loop_count < current_iterations); /* Suspend this thread. */ tx_semaphore_get(&semaphore_1, TX_WAIT_FOREVER); - /* Adjust the current itterations. */ - current_itterations++; - if (current_itterations > upper_bound) + /* Adjust the current iterations. */ + current_iterations++; + if (current_iterations > upper_bound) { if (lower_bound > min_loop_count) lower_bound--; if (upper_bound < max_loop_count) upper_bound++; - current_itterations = lower_bound; + current_iterations = lower_bound; } /* Increment the thread counter. */ diff --git a/test/smp/regression/threadx_thread_simple_suspend_test.c b/test/smp/regression/threadx_thread_simple_suspend_test.c index 52215a754..9514de1df 100644 --- a/test/smp/regression/threadx_thread_simple_suspend_test.c +++ b/test/smp/regression/threadx_thread_simple_suspend_test.c @@ -25,7 +25,7 @@ void test_control_return(UINT status); #ifdef CTEST void test_application_define(void *first_unused_memory) #else -void threadx_thread_simple_supsend_application_define(void *first_unused_memory) +void threadx_thread_simple_suspend_application_define(void *first_unused_memory) #endif { diff --git a/test/smp/regression/threadx_thread_sleep_for_100ticks_test.c b/test/smp/regression/threadx_thread_sleep_for_100ticks_test.c index 69eadbc67..7ab8a4710 100644 --- a/test/smp/regression/threadx_thread_sleep_for_100ticks_test.c +++ b/test/smp/regression/threadx_thread_sleep_for_100ticks_test.c @@ -42,7 +42,7 @@ static ULONG array_delay[ARRAY_SIZE]; static ULONG start_time; static ULONG lower_bound; static ULONG upper_bound; -static ULONG current_itterations; +static ULONG current_iterations; #ifdef DEBUG_1 static ULONG last_loop_count; #endif @@ -108,8 +108,8 @@ ULONG i; if (upper_bound > max_loop_count) lower_bound = max_loop_count; - if ((current_itterations < lower_bound) || (current_itterations > upper_bound)) - current_itterations = lower_bound; + if ((current_iterations < lower_bound) || (current_iterations > upper_bound)) + current_iterations = lower_bound; #ifdef DEBUG_1 /* Last loop count. */ @@ -218,7 +218,7 @@ CHAR *pointer; min_loop_count = 0xFFFFFFFF; max_loop_count = 0; loop_count = 0xFFFFFFFF; - current_itterations = 0; + current_iterations = 0; #ifdef DEBUG_1 last_loop_count = 0x0; #endif @@ -305,7 +305,7 @@ volatile ULONG value = 0; upper_bound = max_loop_count; #endif - current_itterations = lower_bound; + current_iterations = lower_bound; #ifdef DEBUG i = 0; #endif @@ -323,7 +323,7 @@ volatile ULONG value = 0; /* Call delay function. */ delay_function(); loop_count++; - } while (loop_count < current_itterations); + } while (loop_count < current_iterations); /* Check for a timer interrupt... if so, just skip the semaphore get. */ if (start_time != _tx_timer_system_clock) @@ -332,15 +332,15 @@ volatile ULONG value = 0; /* Suspend on the semaphore for 20 ticks... */ tx_semaphore_get(&test_semaphore, 20); - /* Adjust the current itterations. */ - current_itterations++; - if (current_itterations > upper_bound) + /* Adjust the current iterations. */ + current_iterations++; + if (current_iterations > upper_bound) { if (lower_bound > min_loop_count) lower_bound--; if (upper_bound < max_loop_count) upper_bound++; - current_itterations = lower_bound; + current_iterations = lower_bound; } /* Set the tick count simply to use value. */ @@ -355,7 +355,7 @@ volatile ULONG value = 0; printf("loop count: NA\n"); else printf("loop count: %lu\n", loop_count); - printf("current: %lu\n", current_itterations); + printf("current: %lu\n", current_iterations); printf("last loop count: %lu\n", last_loop_count); printf("minimum: %lu\n", min_loop_count); printf("maximum: %lu\n", max_loop_count); @@ -373,7 +373,7 @@ volatile ULONG value = 0; printf("loop count: NA\n"); else printf("loop count: %lu\n", loop_count); - printf("current: %lu\n", current_itterations); + printf("current: %lu\n", current_iterations); printf("last loop count: %lu\n", last_loop_count); printf("minimum: %lu\n", min_loop_count); printf("maximum: %lu\n", max_loop_count); diff --git a/test/smp/regression/threadx_thread_terminate_delete_test.c b/test/smp/regression/threadx_thread_terminate_delete_test.c index dbe919f38..4a8661fa3 100644 --- a/test/smp/regression/threadx_thread_terminate_delete_test.c +++ b/test/smp/regression/threadx_thread_terminate_delete_test.c @@ -244,7 +244,7 @@ UINT status; test_control_return(1); } - /* Delete thread 1 (thread 1 alread terminated) and 2. */ + /* Delete thread 1 (thread 1 alreadyterminated) and 2. */ status = tx_thread_delete(&thread_2); /* Check for status. */ diff --git a/test/tx/regression/testcontrol.c b/test/tx/regression/testcontrol.c index a53c50a5c..62d178cf2 100644 --- a/test/tx/regression/testcontrol.c +++ b/test/tx/regression/testcontrol.c @@ -194,7 +194,7 @@ void threadx_semaphore_information_application_define(void *); void threadx_thread_basic_execution_application_define(void *); void threadx_thread_completed_application_define(void *); void threadx_thread_relinquish_application_define(void *); -void threadx_thread_simple_supsend_application_define(void *); +void threadx_thread_simple_suspend_application_define(void *); void threadx_thread_multiple_suspension_application_define(void *); void threadx_thread_multiple_non_current_suspension_application_define(void *); void threadx_thread_multi_level_preemption_threshold_application_define(void *); @@ -310,7 +310,7 @@ TEST_ENTRY test_control_tests[] = threadx_thread_basic_execution_application_define, threadx_thread_completed_application_define, threadx_thread_relinquish_application_define, - threadx_thread_simple_supsend_application_define, + threadx_thread_simple_suspend_application_define, threadx_thread_multiple_suspension_application_define, threadx_thread_multiple_non_current_suspension_application_define, threadx_thread_multi_level_preemption_threshold_application_define, @@ -1230,7 +1230,7 @@ UINT old_posture = TX_INT_ENABLE; if (old_posture == TX_INT_DISABLE) { - /* System error - interrupts should alwasy be enabled in our test threads! */ + /* System error - interrupts should always be enabled in our test threads! */ printf(" ***** SYSTEM ERROR ***** test returned with interrupts disabled!\n"); test_control_system_errors++; } diff --git a/test/tx/regression/threadx_mutex_information_test.c b/test/tx/regression/threadx_mutex_information_test.c index e95c16c6b..76d04e75c 100644 --- a/test/tx/regression/threadx_mutex_information_test.c +++ b/test/tx/regression/threadx_mutex_information_test.c @@ -312,7 +312,7 @@ ULONG inheritances; test_control_return(1); } - /* Now get the performance inforamtion. */ + /* Now get the performance information. */ status = tx_mutex_performance_info_get(&mutex_2, &puts, &gets, &suspensions, &timeouts, &inversions, &inheritances); /* Check status. */ @@ -326,7 +326,7 @@ ULONG inheritances; test_control_return(1); } - /* Now get the system performance inforamtion. */ + /* Now get the system performance information. */ status = tx_mutex_performance_system_info_get(&puts, &gets, &suspensions, &timeouts, &inversions, &inheritances); /* Check status. */ @@ -342,7 +342,7 @@ ULONG inheritances; #else - /* Now get the performance inforamtion. */ + /* Now get the performance information. */ status = tx_mutex_performance_info_get(&mutex_2, &puts, &gets, &suspensions, &timeouts, &inversions, &inheritances); /* Check status. */ @@ -354,7 +354,7 @@ ULONG inheritances; test_control_return(1); } - /* Now get the performance inforamtion. */ + /* Now get the performance information. */ status = tx_mutex_performance_info_get(TX_NULL, &puts, &gets, &suspensions, &timeouts, &inversions, &inheritances); /* Check status. */ @@ -366,7 +366,7 @@ ULONG inheritances; test_control_return(1); } - /* Now get the performance inforamtion. */ + /* Now get the performance information. */ status = tx_mutex_performance_info_get(TX_NULL, TX_NULL, &gets, &suspensions, &timeouts, &inversions, &inheritances); /* Check status. */ @@ -378,7 +378,7 @@ ULONG inheritances; test_control_return(1); } - /* Now get the performance inforamtion. */ + /* Now get the performance information. */ status = tx_mutex_performance_info_get(TX_NULL, TX_NULL, TX_NULL, &suspensions, &timeouts, &inversions, &inheritances); /* Check status. */ @@ -390,7 +390,7 @@ ULONG inheritances; test_control_return(1); } - /* Now get the performance inforamtion. */ + /* Now get the performance information. */ status = tx_mutex_performance_info_get(TX_NULL, TX_NULL, TX_NULL, TX_NULL, &timeouts, &inversions, &inheritances); /* Check status. */ @@ -402,7 +402,7 @@ ULONG inheritances; test_control_return(1); } - /* Now get the performance inforamtion. */ + /* Now get the performance information. */ status = tx_mutex_performance_info_get(TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, &inversions, &inheritances); /* Check status. */ @@ -414,7 +414,7 @@ ULONG inheritances; test_control_return(1); } - /* Now get the performance inforamtion. */ + /* Now get the performance information. */ status = tx_mutex_performance_info_get(TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, &inheritances); /* Check status. */ @@ -426,7 +426,7 @@ ULONG inheritances; test_control_return(1); } - /* Now get the performance inforamtion. */ + /* Now get the performance information. */ status = tx_mutex_performance_info_get(TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL); /* Check status. */ @@ -438,7 +438,7 @@ ULONG inheritances; test_control_return(1); } - /* Now get the system performance inforamtion. */ + /* Now get the system performance information. */ status = tx_mutex_performance_system_info_get(&puts, &gets, &suspensions, &timeouts, &inversions, &inheritances); /* Check status. */ @@ -450,7 +450,7 @@ ULONG inheritances; test_control_return(1); } - /* Now get the system performance inforamtion. */ + /* Now get the system performance information. */ status = tx_mutex_performance_system_info_get(TX_NULL, &gets, &suspensions, &timeouts, &inversions, &inheritances); /* Check status. */ @@ -462,7 +462,7 @@ ULONG inheritances; test_control_return(1); } - /* Now get the system performance inforamtion. */ + /* Now get the system performance information. */ status = tx_mutex_performance_system_info_get(TX_NULL, TX_NULL, &suspensions, &timeouts, &inversions, &inheritances); /* Check status. */ @@ -474,7 +474,7 @@ ULONG inheritances; test_control_return(1); } - /* Now get the system performance inforamtion. */ + /* Now get the system performance information. */ status = tx_mutex_performance_system_info_get(TX_NULL, TX_NULL, TX_NULL, &timeouts, &inversions, &inheritances); /* Check status. */ @@ -486,7 +486,7 @@ ULONG inheritances; test_control_return(1); } - /* Now get the system performance inforamtion. */ + /* Now get the system performance information. */ status = tx_mutex_performance_system_info_get(TX_NULL, TX_NULL, TX_NULL, TX_NULL, &inversions, &inheritances); /* Check status. */ @@ -498,7 +498,7 @@ ULONG inheritances; test_control_return(1); } - /* Now get the system performance inforamtion. */ + /* Now get the system performance information. */ status = tx_mutex_performance_system_info_get(TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, &inheritances); /* Check status. */ @@ -510,7 +510,7 @@ ULONG inheritances; test_control_return(1); } - /* Now get the system performance inforamtion. */ + /* Now get the system performance information. */ status = tx_mutex_performance_system_info_get(TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL, TX_NULL); /* Check status. */ diff --git a/test/tx/regression/threadx_mutex_nested_priority_inheritance_test.c b/test/tx/regression/threadx_mutex_nested_priority_inheritance_test.c index 7397b4e2d..1738527e4 100644 --- a/test/tx/regression/threadx_mutex_nested_priority_inheritance_test.c +++ b/test/tx/regression/threadx_mutex_nested_priority_inheritance_test.c @@ -404,7 +404,7 @@ UINT status; tx_mutex_put(&mutex_2); - /* Should reurn us back to priority 15. */ + /* Should return us back to priority 15. */ if (thread_0.tx_thread_priority != 15) { @@ -441,7 +441,7 @@ UINT status; tx_mutex_put(&mutex_2); - /* Should reurn us back to priority 8. */ + /* Should return us back to priority 8. */ if (thread_0.tx_thread_priority != 8) { diff --git a/test/tx/regression/threadx_thread_basic_execution_test.c b/test/tx/regression/threadx_thread_basic_execution_test.c index 7a5ae864a..89ce33526 100644 --- a/test/tx/regression/threadx_thread_basic_execution_test.c +++ b/test/tx/regression/threadx_thread_basic_execution_test.c @@ -813,7 +813,7 @@ VOID (*temp_mutex_release)(TX_THREAD *thread_ptr); test_control_return(1); } - /* Attempt a thread termiante with a NULL pointer. */ + /* Attempt a thread terminate with a NULL pointer. */ status = tx_thread_terminate(TX_NULL); /* Check for status. */ @@ -836,7 +836,7 @@ VOID (*temp_mutex_release)(TX_THREAD *thread_ptr); test_control_return(1); } - /* Attempt a thread time-slice chagne with a NULL pointer. */ + /* Attempt a thread time-slice change with a NULL pointer. */ status = tx_thread_time_slice_change(TX_NULL, 1, &old_time_slice); /* Check for status. */ diff --git a/test/tx/regression/threadx_thread_delayed_suspension_test.c b/test/tx/regression/threadx_thread_delayed_suspension_test.c index 6d6d27d0b..4b6955596 100644 --- a/test/tx/regression/threadx_thread_delayed_suspension_test.c +++ b/test/tx/regression/threadx_thread_delayed_suspension_test.c @@ -56,7 +56,7 @@ static volatile ULONG destination = 0; static ULONG start_time; static ULONG lower_bound; static ULONG upper_bound; -static ULONG current_itterations; +static ULONG current_iterations; #ifdef DEBUG_1 static ULONG last_loop_count; #endif @@ -106,8 +106,8 @@ ULONG i; if (upper_bound > max_loop_count) lower_bound = max_loop_count; - if ((current_itterations < lower_bound) || (current_itterations > upper_bound)) - current_itterations = lower_bound; + if ((current_iterations < lower_bound) || (current_iterations > upper_bound)) + current_iterations = lower_bound; #ifdef DEBUG_1 /* Last loop count. */ @@ -350,7 +350,7 @@ ULONG i; lower_bound = lower_bound - 5; upper_bound = max_loop_count + 5; - current_itterations = lower_bound; + current_iterations = lower_bound; /* This thread simply suspends over and over... */ while(1) @@ -366,20 +366,20 @@ ULONG i; /* Call delay function. */ delay_function(); loop_count++; - } while (loop_count < current_itterations); + } while (loop_count < current_iterations); /* Suspend this thread. */ tx_semaphore_get(&semaphore_1, TX_WAIT_FOREVER); - /* Adjust the current itterations. */ - current_itterations++; - if (current_itterations > upper_bound) + /* Adjust the current iterations. */ + current_iterations++; + if (current_iterations > upper_bound) { if (lower_bound > min_loop_count) lower_bound--; if (upper_bound < max_loop_count) upper_bound++; - current_itterations = lower_bound; + current_iterations = lower_bound; } /* Increment the thread counter. */ diff --git a/test/tx/regression/threadx_thread_simple_suspend_test.c b/test/tx/regression/threadx_thread_simple_suspend_test.c index 52215a754..9514de1df 100644 --- a/test/tx/regression/threadx_thread_simple_suspend_test.c +++ b/test/tx/regression/threadx_thread_simple_suspend_test.c @@ -25,7 +25,7 @@ void test_control_return(UINT status); #ifdef CTEST void test_application_define(void *first_unused_memory) #else -void threadx_thread_simple_supsend_application_define(void *first_unused_memory) +void threadx_thread_simple_suspend_application_define(void *first_unused_memory) #endif { diff --git a/test/tx/regression/threadx_thread_sleep_for_100ticks_test.c b/test/tx/regression/threadx_thread_sleep_for_100ticks_test.c index 69eadbc67..7ab8a4710 100644 --- a/test/tx/regression/threadx_thread_sleep_for_100ticks_test.c +++ b/test/tx/regression/threadx_thread_sleep_for_100ticks_test.c @@ -42,7 +42,7 @@ static ULONG array_delay[ARRAY_SIZE]; static ULONG start_time; static ULONG lower_bound; static ULONG upper_bound; -static ULONG current_itterations; +static ULONG current_iterations; #ifdef DEBUG_1 static ULONG last_loop_count; #endif @@ -108,8 +108,8 @@ ULONG i; if (upper_bound > max_loop_count) lower_bound = max_loop_count; - if ((current_itterations < lower_bound) || (current_itterations > upper_bound)) - current_itterations = lower_bound; + if ((current_iterations < lower_bound) || (current_iterations > upper_bound)) + current_iterations = lower_bound; #ifdef DEBUG_1 /* Last loop count. */ @@ -218,7 +218,7 @@ CHAR *pointer; min_loop_count = 0xFFFFFFFF; max_loop_count = 0; loop_count = 0xFFFFFFFF; - current_itterations = 0; + current_iterations = 0; #ifdef DEBUG_1 last_loop_count = 0x0; #endif @@ -305,7 +305,7 @@ volatile ULONG value = 0; upper_bound = max_loop_count; #endif - current_itterations = lower_bound; + current_iterations = lower_bound; #ifdef DEBUG i = 0; #endif @@ -323,7 +323,7 @@ volatile ULONG value = 0; /* Call delay function. */ delay_function(); loop_count++; - } while (loop_count < current_itterations); + } while (loop_count < current_iterations); /* Check for a timer interrupt... if so, just skip the semaphore get. */ if (start_time != _tx_timer_system_clock) @@ -332,15 +332,15 @@ volatile ULONG value = 0; /* Suspend on the semaphore for 20 ticks... */ tx_semaphore_get(&test_semaphore, 20); - /* Adjust the current itterations. */ - current_itterations++; - if (current_itterations > upper_bound) + /* Adjust the current iterations. */ + current_iterations++; + if (current_iterations > upper_bound) { if (lower_bound > min_loop_count) lower_bound--; if (upper_bound < max_loop_count) upper_bound++; - current_itterations = lower_bound; + current_iterations = lower_bound; } /* Set the tick count simply to use value. */ @@ -355,7 +355,7 @@ volatile ULONG value = 0; printf("loop count: NA\n"); else printf("loop count: %lu\n", loop_count); - printf("current: %lu\n", current_itterations); + printf("current: %lu\n", current_iterations); printf("last loop count: %lu\n", last_loop_count); printf("minimum: %lu\n", min_loop_count); printf("maximum: %lu\n", max_loop_count); @@ -373,7 +373,7 @@ volatile ULONG value = 0; printf("loop count: NA\n"); else printf("loop count: %lu\n", loop_count); - printf("current: %lu\n", current_itterations); + printf("current: %lu\n", current_iterations); printf("last loop count: %lu\n", last_loop_count); printf("minimum: %lu\n", min_loop_count); printf("maximum: %lu\n", max_loop_count); diff --git a/test/tx/regression/threadx_thread_terminate_delete_test.c b/test/tx/regression/threadx_thread_terminate_delete_test.c index dbe919f38..4a8661fa3 100644 --- a/test/tx/regression/threadx_thread_terminate_delete_test.c +++ b/test/tx/regression/threadx_thread_terminate_delete_test.c @@ -244,7 +244,7 @@ UINT status; test_control_return(1); } - /* Delete thread 1 (thread 1 alread terminated) and 2. */ + /* Delete thread 1 (thread 1 alreadyterminated) and 2. */ status = tx_thread_delete(&thread_2); /* Check for status. */ From 416dfac3fd596c6fcc5b299886426eb40a42ecaa Mon Sep 17 00:00:00 2001 From: Alex Kiselev Date: Thu, 5 Sep 2024 15:11:35 +0200 Subject: [PATCH 06/10] Comment style changed according to conversation --- ports/cortex_m0/ac5/example_build/tx_initialize_low_level.s | 4 ++-- ports/cortex_m0/iar/example_build/tx_initialize_low_level.s | 4 ++-- ports/cortex_m0/keil/example_build/tx_initialize_low_level.s | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ports/cortex_m0/ac5/example_build/tx_initialize_low_level.s b/ports/cortex_m0/ac5/example_build/tx_initialize_low_level.s index 0c19cc2fe..719b6b8c2 100644 --- a/ports/cortex_m0/ac5/example_build/tx_initialize_low_level.s +++ b/ports/cortex_m0/ac5/example_build/tx_initialize_low_level.s @@ -177,8 +177,8 @@ _tx_initialize_low_level ; LDR r0, =0xE000E000 ; Build address of NVIC registers LDR r1, =0 - STR r1, [r0, #0x10] // Reset SysTick Control - STR r1, [r0, #0x18] // Reset SysTick Counter Value + STR r1, [r0, #0x10] ; Reset SysTick Control + STR r1, [r0, #0x18] ; Reset SysTick Counter Value LDR r1, =SYSTICK_CYCLES STR r1, [r0, #0x14] ; Setup SysTick Reload Value MOVS r1, #0x7 ; Build SysTick Control Enable Value diff --git a/ports/cortex_m0/iar/example_build/tx_initialize_low_level.s b/ports/cortex_m0/iar/example_build/tx_initialize_low_level.s index 09742eccc..49245c6be 100644 --- a/ports/cortex_m0/iar/example_build/tx_initialize_low_level.s +++ b/ports/cortex_m0/iar/example_build/tx_initialize_low_level.s @@ -126,8 +126,8 @@ _tx_initialize_low_level: ; LDR r0, =0xE000E000 ; Build address of NVIC registers LDR r1, =0 - STR r1, [r0, #0x10] // Reset SysTick Control - STR r1, [r0, #0x18] // Reset SysTick Counter Value + STR r1, [r0, #0x10] ; Reset SysTick Control + STR r1, [r0, #0x18] ; Reset SysTick Counter Value LDR r1, =SYSTICK_CYCLES STR r1, [r0, #0x14] ; Setup SysTick Reload Value MOVS r1, #0x7 ; Build SysTick Control Enable Value diff --git a/ports/cortex_m0/keil/example_build/tx_initialize_low_level.s b/ports/cortex_m0/keil/example_build/tx_initialize_low_level.s index 0c19cc2fe..719b6b8c2 100644 --- a/ports/cortex_m0/keil/example_build/tx_initialize_low_level.s +++ b/ports/cortex_m0/keil/example_build/tx_initialize_low_level.s @@ -177,8 +177,8 @@ _tx_initialize_low_level ; LDR r0, =0xE000E000 ; Build address of NVIC registers LDR r1, =0 - STR r1, [r0, #0x10] // Reset SysTick Control - STR r1, [r0, #0x18] // Reset SysTick Counter Value + STR r1, [r0, #0x10] ; Reset SysTick Control + STR r1, [r0, #0x18] ; Reset SysTick Counter Value LDR r1, =SYSTICK_CYCLES STR r1, [r0, #0x14] ; Setup SysTick Reload Value MOVS r1, #0x7 ; Build SysTick Control Enable Value From 2f1fc5291827ee1b4279237646a2bc808a299896 Mon Sep 17 00:00:00 2001 From: "shuta.lst" Date: Wed, 4 Mar 2026 10:51:20 +0800 Subject: [PATCH 07/10] RISC-V64 arch. port support RVV Extension; --- ports/risc-v64/gnu/inc/tx_port.h | 12 +- .../gnu/src/tx_thread_context_restore.S | 124 ++++++++++++++++++ .../risc-v64/gnu/src/tx_thread_context_save.S | 75 +++++++++++ ports/risc-v64/gnu/src/tx_thread_schedule.S | 80 +++++++++++ .../risc-v64/gnu/src/tx_thread_stack_build.S | 46 ++++++- .../gnu/src/tx_thread_system_return.S | 36 +++++ 6 files changed, 369 insertions(+), 4 deletions(-) diff --git a/ports/risc-v64/gnu/inc/tx_port.h b/ports/risc-v64/gnu/inc/tx_port.h index ed985072e..b146529b5 100644 --- a/ports/risc-v64/gnu/inc/tx_port.h +++ b/ports/risc-v64/gnu/inc/tx_port.h @@ -105,7 +105,11 @@ typedef unsigned short USHORT; thread creation is less than this value, the thread create call will return an error. */ #ifndef TX_MINIMUM_STACK -#define TX_MINIMUM_STACK 1024 /* Minimum stack size for this port */ +#if defined(__riscv_vector) +#define TX_MINIMUM_STACK (1024 + 16448) /* Minimum stack size for this port */ +#else +#define TX_MINIMUM_STACK 1024 /* Minimum stack size for this port */ +#endif #endif @@ -113,7 +117,11 @@ typedef unsigned short USHORT; if TX_TIMER_PROCESS_IN_ISR is not defined. */ #ifndef TX_TIMER_THREAD_STACK_SIZE -#define TX_TIMER_THREAD_STACK_SIZE 1024 /* Default timer thread stack size */ +#if defined(__riscv_vector) +#define TX_TIMER_THREAD_STACK_SIZE (1024 + 16448) /* Default timer thread stack size */ +#else +#define TX_TIMER_THREAD_STACK_SIZE 1024 /* Default timer thread stack size */ +#endif #endif #ifndef TX_TIMER_THREAD_PRIORITY diff --git a/ports/risc-v64/gnu/src/tx_thread_context_restore.S b/ports/risc-v64/gnu/src/tx_thread_context_restore.S index 1080e6172..7abd66518 100644 --- a/ports/risc-v64/gnu/src/tx_thread_context_restore.S +++ b/ports/risc-v64/gnu/src/tx_thread_context_restore.S @@ -138,6 +138,34 @@ _tx_thread_context_restore: csrw fcsr, t0 #endif +#if defined(__riscv_vector) + /* Recover vector registers v0-v31 */ +#if defined(__riscv_float_abi_single) || defined(__riscv_float_abi_double) + addi t1, sp, 64*8 +#else + addi t1, sp, 31*8 +#endif + addi t2, t1, 4*8 + vsetvli t3, zero, e8, m8, ta, ma + vle8.v v0, (t2) // Recover v0 ~ v7 + add t2, t2, t3 + vle8.v v8, (t2) // Recover v8 ~ v15 + add t2, t2, t3 + vle8.v v16, (t2) // Recover v16 ~ v23 + add t2, t2, t3 + vle8.v v24, (t2) // Recover v24 ~ v31 + add t2, t2, t3 + + /* Recover vector CSRs */ + ld t2, 0*8(t1) + ld t3, 1*8(t1) + ld t4, 2*8(t1) + vsetvl zero, t4, t3 + csrw vstart, t2 + ld t4, 3*8(t1) + csrw vcsr, t4 +#endif + /* Recover standard registers. */ /* Restore registers, @@ -168,6 +196,10 @@ _tx_thread_context_restore: #if defined(__riscv_float_abi_single) || defined(__riscv_float_abi_double) li t0, 0x2000 // Set FS bits (bits 14:13 to 01) for FP state or t1, t1, t0 +#endif +#if defined(__riscv_vector) + li t0, 0x0200 // Set VS bits (bits 10:9 to 01) for vector state + or t1, t1, t0 #endif csrw mstatus, t1 // Update mstatus safely @@ -194,6 +226,21 @@ _tx_thread_context_restore: #else addi sp, sp, 32*8 // Recover stack frame - without floating point enabled #endif + +#if defined(__riscv_vector) +#if defined(__riscv_float_abi_single) || defined(__riscv_float_abi_double) + addi t0, sp, -65*8 +#else + addi t0, sp, -32*8 +#endif + csrr t1, vlenb // Get vector register byte length + slli t1, t1, 5 // Multiply by 32 (number of vector registers) + addi t1, t1, 4*8 // Add vector CSR space: vstart, vtype, vl, vcsr + add sp, sp, t1 // Recover vector stack frame + + ld t1, 18*8(t0) // Recover t1 + ld t0, 19*8(t0) // Recover t0 +#endif mret // Return to point of interrupt /* } */ @@ -273,6 +320,34 @@ _tx_thread_no_preempt_restore: csrw fcsr, t0 // Restore fcsr #endif +#if defined(__riscv_vector) + /* Recover vector registers v0-v31 */ +#if defined(__riscv_float_abi_single) || defined(__riscv_float_abi_double) + addi t1, sp, 64*8 +#else + addi t1, sp, 31*8 +#endif + addi t2, t1, 4*8 + vsetvli t3, zero, e8, m8, ta, ma + vle8.v v0, (t2) // Recover v0 ~ v7 + add t2, t2, t3 + vle8.v v8, (t2) // Recover v8 ~ v15 + add t2, t2, t3 + vle8.v v16, (t2) // Recover v16 ~ v23 + add t2, t2, t3 + vle8.v v24, (t2) // Recover v24 ~ v31 + add t2, t2, t3 + + /* Recover vector CSRs */ + ld t2, 0*8(t1) + ld t3, 1*8(t1) + ld t4, 2*8(t1) + vsetvl zero, t4, t3 + csrw vstart, t2 + ld t4, 3*8(t1) + csrw vcsr, t4 +#endif + /* Recover the saved context and return to the point of interrupt. */ /* Recover standard registers. */ @@ -294,6 +369,10 @@ _tx_thread_no_preempt_restore: #if defined(__riscv_float_abi_single) || defined(__riscv_float_abi_double) li t0, 0x2000 // Set FS bits for FP state or t1, t1, t0 +#endif +#if defined(__riscv_vector) + li t0, 0x0200 // Set VS bits (bits 10:9 to 01) for vector state + or t1, t1, t0 #endif csrw mstatus, t1 // Update mstatus safely @@ -320,6 +399,21 @@ _tx_thread_no_preempt_restore: #else addi sp, sp, 32*8 // Recover stack frame - without floating point enabled #endif + +#if defined(__riscv_vector) +#if defined(__riscv_float_abi_single) || defined(__riscv_float_abi_double) + addi t0, sp, -65*8 +#else + addi t0, sp, -32*8 +#endif + csrr t1, vlenb // Get vector register byte length + slli t1, t1, 5 // Multiply by 32 (number of vector registers) + addi t1, t1, 4*8 // Add vector CSR space: vstart, vtype, vl, vcsr + add sp, sp, t1 // Recover vector stack frame + + ld t1, 18*8(t0) // Recover t1 + ld t0, 19*8(t0) // Recover t0 +#endif mret // Return to point of interrupt /* } @@ -362,6 +456,36 @@ _tx_thread_preempt_restore: fsd f27, 58*8(t0) // Store fs11 #endif +#if defined(__riscv_vector) + /* Store vector registers and CSRs */ +#if defined(__riscv_float_abi_single) || defined(__riscv_float_abi_double) + addi t1, t0, 64*8 +#else + addi t1, t0, 31*8 +#endif + /* Store vector CSRs */ + csrr t2, vstart // Store vstart + sd t2, 0*8(t1) + csrr t2, vtype // Store vtype + sd t2, 1*8(t1) + csrr t2, vl // Store vl + sd t2, 2*8(t1) + csrr t2, vcsr // Store vcsr + sd t2, 3*8(t1) + + /* Store vector registers v0-v31 */ + addi t2, t1, 4*8 + vsetvli t3, zero, e8, m8, ta, ma + vse8.v v0, 0(t2) // Store v0 ~ v7 + add t2, t2, t3 + vse8.v v8, 0(t2) // Store v8 ~ v15 + add t2, t2, t3 + vse8.v v16, 0(t2) // Store v16 ~ v23 + add t2, t2, t3 + vse8.v v24, 0(t2) // Store v24 ~ v31 + add t2, t2, t3 +#endif + /* Store standard preserved registers. */ sd x9, 11*8(t0) // Store s1 diff --git a/ports/risc-v64/gnu/src/tx_thread_context_save.S b/ports/risc-v64/gnu/src/tx_thread_context_save.S index b9aa13c92..5e2b25922 100644 --- a/ports/risc-v64/gnu/src/tx_thread_context_save.S +++ b/ports/risc-v64/gnu/src/tx_thread_context_save.S @@ -151,6 +151,36 @@ _tx_thread_context_save: sd t0, 63*8(sp) // Store fcsr #endif +#if defined(__riscv_vector) + /* Store vector registers and CSRs */ +#if defined(__riscv_float_abi_single) || defined(__riscv_float_abi_double) + addi t1, sp, 64*8 +#else + addi t1, sp, 31*8 +#endif + /* Store vector CSRs */ + csrr t2, vstart // Store vstart + sd t2, 0*8(t1) + csrr t2, vtype // Store vtype + sd t2, 1*8(t1) + csrr t2, vl // Store vl + sd t2, 2*8(t1) + csrr t2, vcsr // Store vcsr + sd t2, 3*8(t1) + + /* Store vector registers v0-v31 */ + addi t2, t1, 4*8 + vsetvli t3, zero, e8, m8, ta, ma + vse8.v v0, 0(t2) // Store v0 ~ v7 + add t2, t2, t3 + vse8.v v8, 0(t2) // Store v8 ~ v15 + add t2, t2, t3 + vse8.v v16, 0(t2) // Store v16 ~ v23 + add t2, t2, t3 + vse8.v v24, 0(t2) // Store v24 ~ v31 + add t2, t2, t3 +#endif + #ifdef TX_ENABLE_EXECUTION_CHANGE_NOTIFY call _tx_execution_isr_enter // Call the ISR execution enter function #endif @@ -241,6 +271,36 @@ _tx_thread_not_nested_save: sd t0, 63*8(sp) // Store fcsr #endif +#if defined(__riscv_vector) + /* Store vector registers and CSRs */ +#if defined(__riscv_float_abi_single) || defined(__riscv_float_abi_double) + addi t1, sp, 64*8 +#else + addi t1, sp, 31*8 +#endif + /* Store vector CSRs */ + csrr t2, vstart // Store vstart + sd t2, 0*8(t1) + csrr t2, vtype // Store vtype + sd t2, 1*8(t1) + csrr t2, vl // Store vl + sd t2, 2*8(t1) + csrr t2, vcsr // Store vcsr + sd t2, 3*8(t1) + + /* Store vector registers v0-v31 */ + addi t2, t1, 4*8 + vsetvli t3, zero, e8, m8, ta, ma + vse8.v v0, 0(t2) // Store v0 ~ v7 + add t2, t2, t3 + vse8.v v8, 0(t2) // Store v8 ~ v15 + add t2, t2, t3 + vse8.v v16, 0(t2) // Store v16 ~ v23 + add t2, t2, t3 + vse8.v v24, 0(t2) // Store v24 ~ v31 + add t2, t2, t3 +#endif + /* Save the current stack pointer in the thread's control block. */ /* _tx_thread_current_ptr -> tx_thread_stack_ptr = sp; */ @@ -280,4 +340,19 @@ _tx_thread_idle_system_save: #else addi sp, sp, 32*8 // Recover the reserved stack space #endif + +#if defined(__riscv_vector) +#if defined(__riscv_float_abi_single) || defined(__riscv_float_abi_double) + addi t0, sp, -65*8 +#else + addi t0, sp, -32*8 +#endif + csrr t1, vlenb // Get vector register byte length + slli t1, t1, 5 // Multiply by 32 (number of vector registers) + addi t1, t1, 4*8 // Add vector CSR space: vstart, vtype, vl, vcsr + add sp, sp, t1 // Recover vector stack frame + + ld t1, 18*8(t0) // Recover t1 + ld t0, 19*8(t0) // Recover t0 +#endif ret // Return to calling ISR diff --git a/ports/risc-v64/gnu/src/tx_thread_schedule.S b/ports/risc-v64/gnu/src/tx_thread_schedule.S index 2618e98bd..947d288d6 100644 --- a/ports/risc-v64/gnu/src/tx_thread_schedule.S +++ b/ports/risc-v64/gnu/src/tx_thread_schedule.S @@ -211,6 +211,34 @@ _tx_thread_schedule_loop: csrw fcsr, t0 // Restore fcsr #endif +#if defined(__riscv_vector) + /* Recover vector registers v0-v31 */ +#if defined(__riscv_float_abi_single) || defined(__riscv_float_abi_double) + addi t1, sp, 64*8 +#else + addi t1, sp, 31*8 +#endif + addi t2, t1, 4*8 + vsetvli t3, zero, e8, m8, ta, ma + vle8.v v0, (t2) // Recover v0 ~ v7 + add t2, t2, t3 + vle8.v v8, (t2) // Recover v8 ~ v15 + add t2, t2, t3 + vle8.v v16, (t2) // Recover v16 ~ v23 + add t2, t2, t3 + vle8.v v24, (t2) // Recover v24 ~ v31 + add t2, t2, t3 + + /* Recover vector CSRs */ + ld t2, 0*8(t1) + ld t3, 1*8(t1) + ld t4, 2*8(t1) + vsetvl zero, t4, t3 + csrw vstart, t2 + ld t4, 3*8(t1) + csrw vcsr, t4 +#endif + /* Recover standard registers. */ ld t0, 30*8(sp) // Recover mepc @@ -219,6 +247,10 @@ _tx_thread_schedule_loop: #if defined(__riscv_float_abi_single) || defined(__riscv_float_abi_double) li t1, 0x2000 // Set FS bits for FP state or t0, t0, t1 +#endif +#if defined(__riscv_vector) + li t1, 0x0200 // Set VS bits (bits 10:9 to 01) for vector state + or t0, t0, t1 #endif csrw mstatus, t0 // Set mstatus @@ -255,6 +287,20 @@ _tx_thread_schedule_loop: addi sp, sp, 65*8 // Recover stack frame - with floating point registers #else addi sp, sp, 32*8 // Recover stack frame - without floating point registers +#endif +#if defined(__riscv_vector) +#if defined(__riscv_float_abi_single) || defined(__riscv_float_abi_double) + addi t0, sp, -65*8 +#else + addi t0, sp, -32*8 +#endif + csrr t1, vlenb // Get vector register byte length + slli t1, t1, 5 // Multiply by 32 (number of vector registers) + addi t1, t1, 4*8 // Add vector CSR space: vstart, vtype, vl, vcsr + add sp, sp, t1 // Recover vector stack frame + + ld t1, 18*8(t0) // Recover t1 + ld t0, 19*8(t0) // Recover t0 #endif mret // Return to point of interrupt @@ -292,6 +338,34 @@ _tx_thread_synch_return: csrw fcsr, t0 // #endif +#if defined(__riscv_vector) + /* Recover vector registers v0-v31 */ +#if defined(__riscv_float_abi_single) || defined(__riscv_float_abi_double) + addi t1, sp, 28*8 +#else + addi t1, sp, 15*8 +#endif + addi t2, t1, 4*8 + vsetvli t3, zero, e8, m8, ta, ma + vle8.v v0, (t2) // Recover v0 ~ v7 + add t2, t2, t3 + vle8.v v8, (t2) // Recover v8 ~ v15 + add t2, t2, t3 + vle8.v v16, (t2) // Recover v16 ~ v23 + add t2, t2, t3 + vle8.v v24, (t2) // Recover v24 ~ v31 + add t2, t2, t3 + + /* Recover vector CSRs */ + ld t2, 0*8(t1) + ld t3, 1*8(t1) + ld t4, 2*8(t1) + vsetvl zero, t4, t3 + csrw vstart, t2 + ld t4, 3*8(t1) + csrw vcsr, t4 +#endif + /* Recover standard preserved registers. */ /* Recover standard registers. */ @@ -314,6 +388,12 @@ _tx_thread_synch_return: addi sp, sp, 29*8 // Recover stack frame #else addi sp, sp, 16*8 // Recover stack frame +#endif +#if defined(__riscv_vector) + csrr t1, vlenb // Get vector register byte length + slli t1, t1, 5 // Multiply by 32 (number of vector registers) + addi t1, t1, 4*8 // Add vector CSR space: vstart, vtype, vl, vcsr + add sp, sp, t1 // Recover vector stack frame #endif ret // Return to thread diff --git a/ports/risc-v64/gnu/src/tx_thread_stack_build.S b/ports/risc-v64/gnu/src/tx_thread_stack_build.S index eecfbfece..4dcc30bf2 100644 --- a/ports/risc-v64/gnu/src/tx_thread_stack_build.S +++ b/ports/risc-v64/gnu/src/tx_thread_stack_build.S @@ -133,6 +133,15 @@ If floating point support: f30 61 Inital ft10 f31 62 Inital ft11 fscr 63 Inital fscr +If vector extension support: + vstart 64 Initial vstart + vtype 65 Initial vtype + vl 66 Initial vl + vcsr 67 Initial vcsr + v0 68 Initial v0 + v1 69 Initial v1 + ... + v31 99 Initial v31 Stack Bottom: (higher memory address) */ @@ -147,6 +156,17 @@ If floating point support: #else addi t0, t0, -32*8 // Allocate space for the stack frame #endif + +#if defined(__riscv_vector) + /* Vector extension support: calculate space based on vlenb */ + csrr t4, vlenb // Get vector register byte length + slli t4, t4, 5 // Multiply by 32 (number of vector registers) + addi t4, t4, 4*8 // Add vector CSR space: vstart, vtype, vl, vcsr + sub t0, t0, t4 // Allocate vector space for the stack frame +#else + li t4, 0 +#endif + li t1, 1 // Build stack type sd t1, 0*8(t0) // Place stack type on the top sd zero, 1*8(t0) // Initial s11 @@ -213,9 +233,31 @@ If floating point support: sd zero, 62*8(t0) // Initial ft11 csrr a1, fcsr // Read fcsr for initial value sd a1, 63*8(t0) // Initial fcsr - sd zero, 64*8(t0) // Reserved word (0) +#endif + +#if defined(__riscv_vector) + /* Clear vector register space */ +#if defined(__riscv_float_abi_single) || defined(__riscv_float_abi_double) + addi t2, t0, 64*8 // t2 = start of vector registers +#else + addi t2, t0, 31*8 // t2 = start of vector registers +#endif + add t3, t2, t4 // t3 = end of vector registers + +vector_clear_loop: + beq t2, t3, vector_clear_done // Done if reached end + sd zero, 0(t2) // Clear 8 bytes + addi t2, t2, 8 // Move to next 8 bytes + j vector_clear_loop + +vector_clear_done: +#endif + + add t2, t0, t4 +#if defined(__riscv_float_abi_single) || defined(__riscv_float_abi_double) + sd zero, 64*8(t2) // Reserved word (0) #else - sd zero, 31*8(t0) // Reserved word (0) + sd zero, 31*8(t2) // Reserved word (0) #endif /* Setup stack pointer. */ diff --git a/ports/risc-v64/gnu/src/tx_thread_system_return.S b/ports/risc-v64/gnu/src/tx_thread_system_return.S index b7dc9f3aa..2c7a2c011 100644 --- a/ports/risc-v64/gnu/src/tx_thread_system_return.S +++ b/ports/risc-v64/gnu/src/tx_thread_system_return.S @@ -73,6 +73,12 @@ _tx_thread_system_return: #else addi sp, sp, -16*8 // Allocate space on the stack - without floating point enabled #endif +#if defined(__riscv_vector) + csrr t1, vlenb // Get vector register byte length + slli t1, t1, 5 // Multiply by 32 (number of vector registers) + addi t1, t1, 4*8 // Add vector CSR space: vstart, vtype, vl, vcsr + sub sp, sp, t1 // Allocate vector space on the stack +#endif /* Store floating point preserved registers. */ #if defined(__riscv_float_abi_single) @@ -107,6 +113,36 @@ _tx_thread_system_return: sd t0, 27*8(sp) // Store fcsr #endif +#if defined(__riscv_vector) + /* Store vector registers and CSRs */ +#if defined(__riscv_float_abi_single) || defined(__riscv_float_abi_double) + addi t1, sp, 28*8 +#else + addi t1, sp, 15*8 +#endif + /* Store vector CSRs */ + csrr t2, vstart // Store vstart + sd t2, 0*8(t1) + csrr t2, vtype // Store vtype + sd t2, 1*8(t1) + csrr t2, vl // Store vl + sd t2, 2*8(t1) + csrr t2, vcsr // Store vcsr + sd t2, 3*8(t1) + + /* Store vector registers v0-v31 */ + addi t2, t1, 4*8 + vsetvli t3, zero, e8, m8, ta, ma + vse8.v v0, 0(t2) // Store v0 ~ v7 + add t2, t2, t3 + vse8.v v8, 0(t2) // Store v8 ~ v15 + add t2, t2, t3 + vse8.v v16, 0(t2) // Store v16 ~ v23 + add t2, t2, t3 + vse8.v v24, 0(t2) // Store v24 ~ v31 + add t2, t2, t3 +#endif + sd zero, 0(sp) // Solicited stack type sd ra, 13*8(sp) // Save return address sd s0, 12*8(sp) // Save s0 From dfafc96149630f2a098559aecf69fa49b9565d22 Mon Sep 17 00:00:00 2001 From: "shuta.lst" Date: Tue, 7 Apr 2026 14:03:24 +0800 Subject: [PATCH 08/10] RISC-V64 qemu_virt example support RVV Extension; --- ports/risc-v64/gnu/example_build/qemu_virt/csr.h | 1 + .../gnu/example_build/qemu_virt/demo_threadx.c | 5 +++++ ports/risc-v64/gnu/example_build/qemu_virt/entry.s | 4 ++++ ports/risc-v64/gnu/example_build/qemu_virt/link.lds | 3 +++ .../example_build/qemu_virt/tx_initialize_low_level.S | 11 +++++++++++ 5 files changed, 24 insertions(+) diff --git a/ports/risc-v64/gnu/example_build/qemu_virt/csr.h b/ports/risc-v64/gnu/example_build/qemu_virt/csr.h index 4e222375d..6d35a07f7 100644 --- a/ports/risc-v64/gnu/example_build/qemu_virt/csr.h +++ b/ports/risc-v64/gnu/example_build/qemu_virt/csr.h @@ -21,6 +21,7 @@ #define MSTATUS_MIE (1L << 3) // machine-mode interrupt enable. #define MSTATUS_MPIE (1L << 7) #define MSTATUS_FS (1L << 13) +#define MSTATUS_VS (1L << 9) // Machine-mode Interrupt Enable #define MIE_MTIE (1L << 7) diff --git a/ports/risc-v64/gnu/example_build/qemu_virt/demo_threadx.c b/ports/risc-v64/gnu/example_build/qemu_virt/demo_threadx.c index aff197db3..4a7e8b9b8 100644 --- a/ports/risc-v64/gnu/example_build/qemu_virt/demo_threadx.c +++ b/ports/risc-v64/gnu/example_build/qemu_virt/demo_threadx.c @@ -4,8 +4,13 @@ #include "tx_api.h" #include "uart.h" +#if defined(__riscv_vector) +#define DEMO_STACK_SIZE (1024 + 16448) /* 16448 for RVV Extension */ +#define DEMO_BYTE_POOL_SIZE (9180 + 148032) /* 148032 for RVV Extension */ +#else #define DEMO_STACK_SIZE 1024 #define DEMO_BYTE_POOL_SIZE 9180 +#endif #define DEMO_BLOCK_POOL_SIZE 100 #define DEMO_QUEUE_SIZE 100 diff --git a/ports/risc-v64/gnu/example_build/qemu_virt/entry.s b/ports/risc-v64/gnu/example_build/qemu_virt/entry.s index 9b202ca16..791d08eb2 100644 --- a/ports/risc-v64/gnu/example_build/qemu_virt/entry.s +++ b/ports/risc-v64/gnu/example_build/qemu_virt/entry.s @@ -41,7 +41,11 @@ _start: li x30, 0 li x31, 0 la t0, _sysstack_start +#ifdef __riscv_vector + li t1, 0x5000 +#else li t1, 0x1000 +#endif add sp, t0, t1 la t0, _bss_start la t1, _bss_end diff --git a/ports/risc-v64/gnu/example_build/qemu_virt/link.lds b/ports/risc-v64/gnu/example_build/qemu_virt/link.lds index b2d0d2df1..42544da1d 100644 --- a/ports/risc-v64/gnu/example_build/qemu_virt/link.lds +++ b/ports/risc-v64/gnu/example_build/qemu_virt/link.lds @@ -42,6 +42,9 @@ SECTIONS . = ALIGN(4096); _sysstack_start = .; . += 0x1000; +#ifdef __riscv_vector + . += 0x4000; +#endif _sysstack_end = .; } diff --git a/ports/risc-v64/gnu/example_build/qemu_virt/tx_initialize_low_level.S b/ports/risc-v64/gnu/example_build/qemu_virt/tx_initialize_low_level.S index 3c4a00af8..e58f8034b 100644 --- a/ports/risc-v64/gnu/example_build/qemu_virt/tx_initialize_low_level.S +++ b/ports/risc-v64/gnu/example_build/qemu_virt/tx_initialize_low_level.S @@ -70,6 +70,13 @@ #else addi sp, sp, -256 // Allocate space for all registers - without floating point enabled (32*8) #endif +#if defined(__riscv_vector) + /* Allocate space for vector registers */ + csrr t4, vlenb + slli t4, t4, 5 + addi t4, t4, 4*8 + sub sp, sp, t4 +#endif sd x1, 224(sp) // Store RA (28*8 = 224, because call will override ra [ra is a callee register in riscv]) @@ -153,6 +160,10 @@ _tx_initialize_low_level: li t0, MSTATUS_FS csrrs zero, mstatus, t0 // set MSTATUS_FS bit to open f/d isa in riscv fscsr x0 +#endif +#ifdef __riscv_vector + li t0, MSTATUS_VS + csrrs zero, mstatus, t0 // set MSTATUS_VS bit to open vector isa in riscv #endif addi sp, sp, -8 sd ra, 0(sp) From 2cdebde30a5213261313b9cb2a903fa4511435d5 Mon Sep 17 00:00:00 2001 From: Jonathan Blanchard Date: Sun, 12 Apr 2026 10:17:10 -0400 Subject: [PATCH 09/10] Fix default TX_TIMER_TICKS_PER_SECOND default value in tx_user_sample.h Changed default value to TX_16_ULONG. --- common/inc/tx_user_sample.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/inc/tx_user_sample.h b/common/inc/tx_user_sample.h index 9621c30cd..0733c16c4 100644 --- a/common/inc/tx_user_sample.h +++ b/common/inc/tx_user_sample.h @@ -95,7 +95,7 @@ the new value must be a multiple of ULONG. */ /* -#define TX_QUEUE_MESSAGE_MAX_SIZE TX_ULONG_16 +#define TX_QUEUE_MESSAGE_MAX_SIZE TX_16_ULONG */ /* Define the common timer tick reference for use by other middleware components. The default From 98e4754381b24e18b3712d1cc4ff528a93b13a77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Desbiens?= Date: Wed, 15 Apr 2026 10:52:14 -0400 Subject: [PATCH 10/10] build: add conditional CMake support for ThreadX SMP - Introduce THREADX_SMP option in root CMakeLists.txt. - Implement conditional source and port directory selection for SMP builds. - Add CMake support for common_smp and Cortex-A9 SMP port. - Fix linker flags in Cortex-A9 SMP sample build script. - Remove duplicate invalidateCaches_IS declarations in v7.h headers. Assisted-by: Gemini (Experimental) --- CMakeLists.txt | 24 +- cmake/cortex_a9.cmake | 13 ++ common_smp/CMakeLists.txt | 218 ++++++++++++++++++ ports/cortex_a12/gnu/example_build/v7.h | 1 - ports/cortex_a15/gnu/example_build/v7.h | 1 - ports/cortex_a17/gnu/example_build/v7.h | 1 - ports/cortex_a5/gnu/example_build/v7.h | 1 - ports/cortex_a7/gnu/example_build/v7.h | 1 - ports/cortex_a8/gnu/example_build/v7.h | 1 - ports/cortex_a9/gnu/example_build/v7.h | 1 - .../threadx/ports/gnu/example_build/v7.h | 1 - ports_smp/cortex_a9_smp/gnu/CMakeLists.txt | 31 +++ .../example_build/build_threadx_sample.bat | 2 +- 13 files changed, 284 insertions(+), 12 deletions(-) create mode 100644 cmake/cortex_a9.cmake create mode 100644 common_smp/CMakeLists.txt create mode 100644 ports_smp/cortex_a9_smp/gnu/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index 9d348e684..e988d3a60 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,6 +11,21 @@ endif() if(NOT DEFINED THREADX_TOOLCHAIN) message(FATAL_ERROR "Error: THREADX_TOOLCHAIN not defined") endif() + +option(THREADX_SMP "Build ThreadX SMP version" OFF) + +if(THREADX_SMP) + set(TX_PORT_DIR "ports_smp") + set(TX_COMMON_DIR "common_smp") + set(TX_ARCH_DIR "${THREADX_ARCH}_smp") + message(STATUS "Building ThreadX SMP version") +else() + set(TX_PORT_DIR "ports") + set(TX_COMMON_DIR "common") + set(TX_ARCH_DIR "${THREADX_ARCH}") + message(STATUS "Building standard ThreadX version") +endif() + message(STATUS "THREADX_ARCH: ${THREADX_ARCH}") message(STATUS "THREADX_TOOLCHAIN: ${THREADX_TOOLCHAIN}") @@ -25,11 +40,11 @@ set(CUSTOM_INC_DIR ${CMAKE_CURRENT_BINARY_DIR}/custom_inc) if(DEFINED THREADX_CUSTOM_PORT) add_subdirectory(${THREADX_CUSTOM_PORT} threadx_port) else() - add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/ports/${THREADX_ARCH}/${THREADX_TOOLCHAIN}) + add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/${TX_PORT_DIR}/${TX_ARCH_DIR}/${THREADX_TOOLCHAIN}) endif() # Pick up the common stuff -add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/common) +add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/${TX_COMMON_DIR}) # Define the FreeRTOS adaptation layer add_library(freertos-threadx EXCLUDE_FROM_ALL) @@ -46,7 +61,7 @@ target_link_libraries(freertos-threadx PUBLIC threadx) # If the user provided an override, copy it to the custom directory if (NOT TX_USER_FILE) message(STATUS "Using default tx_user.h file") - set(TX_USER_FILE ${CMAKE_CURRENT_LIST_DIR}/common/inc/tx_user_sample.h) + set(TX_USER_FILE ${CMAKE_CURRENT_LIST_DIR}/${TX_COMMON_DIR}/inc/tx_user_sample.h) else() message(STATUS "Using custom tx_user.h file from ${TX_USER_FILE}") endif() @@ -56,6 +71,9 @@ target_include_directories(${PROJECT_NAME} ${CUSTOM_INC_DIR} ) target_compile_definitions(${PROJECT_NAME} PUBLIC "TX_INCLUDE_USER_DEFINE_FILE" ) +if(THREADX_SMP) + target_compile_definitions(${PROJECT_NAME} PUBLIC "TX_MPCORE" ) +endif() # Enable a build target that produces a ZIP file of all sources set(CPACK_SOURCE_GENERATOR "ZIP") diff --git a/cmake/cortex_a9.cmake b/cmake/cortex_a9.cmake new file mode 100644 index 000000000..b84963a47 --- /dev/null +++ b/cmake/cortex_a9.cmake @@ -0,0 +1,13 @@ +# Name of the target +set(CMAKE_SYSTEM_NAME Generic) +set(CMAKE_SYSTEM_PROCESSOR cortex-a9) + +set(THREADX_ARCH "cortex_a9") +set(THREADX_TOOLCHAIN "gnu") + +set(MCPU_FLAGS "-marm -mcpu=cortex-a9") +set(VFP_FLAGS "") +set(SPEC_FLAGS "--specs=nosys.specs") +# set(LD_FLAGS "-nostartfiles") + +include(${CMAKE_CURRENT_LIST_DIR}/arm-none-eabi.cmake) diff --git a/common_smp/CMakeLists.txt b/common_smp/CMakeLists.txt new file mode 100644 index 000000000..80b9d3154 --- /dev/null +++ b/common_smp/CMakeLists.txt @@ -0,0 +1,218 @@ +function(target_sources_if_not_overridden filename) + list(FIND TX_SRC_OVERRIDES ${filename} OVERRIDE_FOUND) + if( OVERRIDE_FOUND EQUAL -1 ) + # message(STATUS "** Using original ${filename} from common_smp/src **") + target_sources(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_LIST_DIR}/src/${filename}) + endif() +endfunction() + +# These files can be overridden by setting them in the variable list named TX_SRC_OVERRIDES +target_sources_if_not_overridden("tx_thread_delete.c") +target_sources_if_not_overridden("tx_thread_reset.c") + +target_sources(${PROJECT_NAME} + PRIVATE + # {{BEGIN_TARGET_SOURCES}} + ${CMAKE_CURRENT_LIST_DIR}/src/tx_block_allocate.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_block_pool_cleanup.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_block_pool_create.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_block_pool_delete.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_block_pool_info_get.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_block_pool_initialize.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_block_pool_performance_info_get.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_block_pool_performance_system_info_get.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_block_pool_prioritize.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_block_release.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_byte_allocate.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_byte_pool_cleanup.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_byte_pool_create.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_byte_pool_delete.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_byte_pool_info_get.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_byte_pool_initialize.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_byte_pool_performance_info_get.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_byte_pool_performance_system_info_get.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_byte_pool_prioritize.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_byte_pool_search.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_byte_release.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_event_flags_cleanup.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_event_flags_create.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_event_flags_delete.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_event_flags_get.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_event_flags_info_get.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_event_flags_initialize.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_event_flags_performance_info_get.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_event_flags_performance_system_info_get.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_event_flags_set_notify.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_event_flags_set.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_initialize_high_level.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_initialize_kernel_enter.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_initialize_kernel_setup.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_misra.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_mutex_cleanup.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_mutex_create.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_mutex_delete.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_mutex_get.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_mutex_info_get.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_mutex_initialize.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_mutex_performance_info_get.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_mutex_performance_system_info_get.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_mutex_prioritize.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_mutex_priority_change.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_mutex_put.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_queue_cleanup.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_queue_create.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_queue_delete.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_queue_flush.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_queue_front_send.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_queue_info_get.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_queue_initialize.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_queue_performance_info_get.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_queue_performance_system_info_get.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_queue_prioritize.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_queue_receive.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_queue_send_notify.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_queue_send.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_semaphore_ceiling_put.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_semaphore_cleanup.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_semaphore_create.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_semaphore_delete.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_semaphore_get.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_semaphore_info_get.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_semaphore_initialize.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_semaphore_performance_info_get.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_semaphore_performance_system_info_get.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_semaphore_prioritize.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_semaphore_put_notify.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_semaphore_put.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_thread_create.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_thread_delete.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_thread_entry_exit_notify.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_thread_identify.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_thread_info_get.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_thread_initialize.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_thread_performance_info_get.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_thread_performance_system_info_get.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_thread_preemption_change.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_thread_priority_change.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_thread_relinquish.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_thread_reset.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_thread_resume.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_thread_shell_entry.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_thread_sleep.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_thread_smp_core_exclude_get.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_thread_smp_core_exclude.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_thread_smp_current_state_set.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_thread_smp_debug_entry_insert.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_thread_smp_high_level_initialize.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_thread_smp_rebalance_execute_list.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_thread_smp_utilities.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_thread_stack_analyze.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_thread_stack_error_handler.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_thread_stack_error_notify.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_thread_suspend.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_thread_system_preempt_check.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_thread_system_resume.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_thread_system_suspend.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_thread_terminate.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_thread_time_slice_change.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_thread_time_slice.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_thread_timeout.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_thread_wait_abort.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_time_get.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_time_set.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_timer_activate.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_timer_change.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_timer_create.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_timer_deactivate.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_timer_delete.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_timer_expiration_process.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_timer_info_get.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_timer_initialize.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_timer_performance_info_get.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_timer_performance_system_info_get.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_timer_smp_core_exclude_get.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_timer_smp_core_exclude.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_timer_system_activate.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_timer_system_deactivate.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_timer_thread_entry.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_trace_buffer_full_notify.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_trace_disable.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_trace_enable.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_trace_event_filter.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_trace_event_unfilter.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_trace_initialize.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_trace_interrupt_control.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_trace_isr_enter_insert.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_trace_isr_exit_insert.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_trace_object_register.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_trace_object_unregister.c + ${CMAKE_CURRENT_LIST_DIR}/src/tx_trace_user_event_insert.c + ${CMAKE_CURRENT_LIST_DIR}/src/txe_block_allocate.c + ${CMAKE_CURRENT_LIST_DIR}/src/txe_block_pool_create.c + ${CMAKE_CURRENT_LIST_DIR}/src/txe_block_pool_delete.c + ${CMAKE_CURRENT_LIST_DIR}/src/txe_block_pool_info_get.c + ${CMAKE_CURRENT_LIST_DIR}/src/txe_block_pool_prioritize.c + ${CMAKE_CURRENT_LIST_DIR}/src/txe_block_release.c + ${CMAKE_CURRENT_LIST_DIR}/src/txe_byte_allocate.c + ${CMAKE_CURRENT_LIST_DIR}/src/txe_byte_pool_create.c + ${CMAKE_CURRENT_LIST_DIR}/src/txe_byte_pool_delete.c + ${CMAKE_CURRENT_LIST_DIR}/src/txe_byte_pool_info_get.c + ${CMAKE_CURRENT_LIST_DIR}/src/txe_byte_pool_prioritize.c + ${CMAKE_CURRENT_LIST_DIR}/src/txe_byte_release.c + ${CMAKE_CURRENT_LIST_DIR}/src/txe_event_flags_create.c + ${CMAKE_CURRENT_LIST_DIR}/src/txe_event_flags_delete.c + ${CMAKE_CURRENT_LIST_DIR}/src/txe_event_flags_get.c + ${CMAKE_CURRENT_LIST_DIR}/src/txe_event_flags_info_get.c + ${CMAKE_CURRENT_LIST_DIR}/src/txe_event_flags_set_notify.c + ${CMAKE_CURRENT_LIST_DIR}/src/txe_event_flags_set.c + ${CMAKE_CURRENT_LIST_DIR}/src/txe_mutex_create.c + ${CMAKE_CURRENT_LIST_DIR}/src/txe_mutex_delete.c + ${CMAKE_CURRENT_LIST_DIR}/src/txe_mutex_get.c + ${CMAKE_CURRENT_LIST_DIR}/src/txe_mutex_info_get.c + ${CMAKE_CURRENT_LIST_DIR}/src/txe_mutex_prioritize.c + ${CMAKE_CURRENT_LIST_DIR}/src/txe_mutex_put.c + ${CMAKE_CURRENT_LIST_DIR}/src/txe_queue_create.c + ${CMAKE_CURRENT_LIST_DIR}/src/txe_queue_delete.c + ${CMAKE_CURRENT_LIST_DIR}/src/txe_queue_flush.c + ${CMAKE_CURRENT_LIST_DIR}/src/txe_queue_front_send.c + ${CMAKE_CURRENT_LIST_DIR}/src/txe_queue_info_get.c + ${CMAKE_CURRENT_LIST_DIR}/src/txe_queue_prioritize.c + ${CMAKE_CURRENT_LIST_DIR}/src/txe_queue_receive.c + ${CMAKE_CURRENT_LIST_DIR}/src/txe_queue_send_notify.c + ${CMAKE_CURRENT_LIST_DIR}/src/txe_queue_send.c + ${CMAKE_CURRENT_LIST_DIR}/src/txe_semaphore_ceiling_put.c + ${CMAKE_CURRENT_LIST_DIR}/src/txe_semaphore_create.c + ${CMAKE_CURRENT_LIST_DIR}/src/txe_semaphore_delete.c + ${CMAKE_CURRENT_LIST_DIR}/src/txe_semaphore_get.c + ${CMAKE_CURRENT_LIST_DIR}/src/txe_semaphore_info_get.c + ${CMAKE_CURRENT_LIST_DIR}/src/txe_semaphore_prioritize.c + ${CMAKE_CURRENT_LIST_DIR}/src/txe_semaphore_put_notify.c + ${CMAKE_CURRENT_LIST_DIR}/src/txe_semaphore_put.c + ${CMAKE_CURRENT_LIST_DIR}/src/txe_thread_create.c + ${CMAKE_CURRENT_LIST_DIR}/src/txe_thread_delete.c + ${CMAKE_CURRENT_LIST_DIR}/src/txe_thread_entry_exit_notify.c + ${CMAKE_CURRENT_LIST_DIR}/src/txe_thread_info_get.c + ${CMAKE_CURRENT_LIST_DIR}/src/txe_thread_preemption_change.c + ${CMAKE_CURRENT_LIST_DIR}/src/txe_thread_priority_change.c + ${CMAKE_CURRENT_LIST_DIR}/src/txe_thread_relinquish.c + ${CMAKE_CURRENT_LIST_DIR}/src/txe_thread_reset.c + ${CMAKE_CURRENT_LIST_DIR}/src/txe_thread_resume.c + ${CMAKE_CURRENT_LIST_DIR}/src/txe_thread_suspend.c + ${CMAKE_CURRENT_LIST_DIR}/src/txe_thread_terminate.c + ${CMAKE_CURRENT_LIST_DIR}/src/txe_thread_time_slice_change.c + ${CMAKE_CURRENT_LIST_DIR}/src/txe_thread_wait_abort.c + ${CMAKE_CURRENT_LIST_DIR}/src/txe_timer_activate.c + ${CMAKE_CURRENT_LIST_DIR}/src/txe_timer_change.c + ${CMAKE_CURRENT_LIST_DIR}/src/txe_timer_create.c + ${CMAKE_CURRENT_LIST_DIR}/src/txe_timer_deactivate.c + ${CMAKE_CURRENT_LIST_DIR}/src/txe_timer_delete.c + ${CMAKE_CURRENT_LIST_DIR}/src/txe_timer_info_get.c + # {{END_TARGET_SOURCES}} +) + +# Add the Common/inc directory to the project include list +target_include_directories(${PROJECT_NAME} + SYSTEM + PUBLIC + ${CMAKE_CURRENT_LIST_DIR}/inc +) diff --git a/ports/cortex_a12/gnu/example_build/v7.h b/ports/cortex_a12/gnu/example_build/v7.h index c18b945c5..1133b0acc 100644 --- a/ports/cortex_a12/gnu/example_build/v7.h +++ b/ports/cortex_a12/gnu/example_build/v7.h @@ -37,7 +37,6 @@ void disableInterrupts(void); void invalidateCaches_IS(void); void cleanInvalidateDCache(void); -void invalidateCaches_IS(void); void enableCaches(void); void disableCaches(void); void invalidateCaches(void); diff --git a/ports/cortex_a15/gnu/example_build/v7.h b/ports/cortex_a15/gnu/example_build/v7.h index c18b945c5..1133b0acc 100644 --- a/ports/cortex_a15/gnu/example_build/v7.h +++ b/ports/cortex_a15/gnu/example_build/v7.h @@ -37,7 +37,6 @@ void disableInterrupts(void); void invalidateCaches_IS(void); void cleanInvalidateDCache(void); -void invalidateCaches_IS(void); void enableCaches(void); void disableCaches(void); void invalidateCaches(void); diff --git a/ports/cortex_a17/gnu/example_build/v7.h b/ports/cortex_a17/gnu/example_build/v7.h index c18b945c5..1133b0acc 100644 --- a/ports/cortex_a17/gnu/example_build/v7.h +++ b/ports/cortex_a17/gnu/example_build/v7.h @@ -37,7 +37,6 @@ void disableInterrupts(void); void invalidateCaches_IS(void); void cleanInvalidateDCache(void); -void invalidateCaches_IS(void); void enableCaches(void); void disableCaches(void); void invalidateCaches(void); diff --git a/ports/cortex_a5/gnu/example_build/v7.h b/ports/cortex_a5/gnu/example_build/v7.h index c18b945c5..1133b0acc 100644 --- a/ports/cortex_a5/gnu/example_build/v7.h +++ b/ports/cortex_a5/gnu/example_build/v7.h @@ -37,7 +37,6 @@ void disableInterrupts(void); void invalidateCaches_IS(void); void cleanInvalidateDCache(void); -void invalidateCaches_IS(void); void enableCaches(void); void disableCaches(void); void invalidateCaches(void); diff --git a/ports/cortex_a7/gnu/example_build/v7.h b/ports/cortex_a7/gnu/example_build/v7.h index c18b945c5..1133b0acc 100644 --- a/ports/cortex_a7/gnu/example_build/v7.h +++ b/ports/cortex_a7/gnu/example_build/v7.h @@ -37,7 +37,6 @@ void disableInterrupts(void); void invalidateCaches_IS(void); void cleanInvalidateDCache(void); -void invalidateCaches_IS(void); void enableCaches(void); void disableCaches(void); void invalidateCaches(void); diff --git a/ports/cortex_a8/gnu/example_build/v7.h b/ports/cortex_a8/gnu/example_build/v7.h index c18b945c5..1133b0acc 100644 --- a/ports/cortex_a8/gnu/example_build/v7.h +++ b/ports/cortex_a8/gnu/example_build/v7.h @@ -37,7 +37,6 @@ void disableInterrupts(void); void invalidateCaches_IS(void); void cleanInvalidateDCache(void); -void invalidateCaches_IS(void); void enableCaches(void); void disableCaches(void); void invalidateCaches(void); diff --git a/ports/cortex_a9/gnu/example_build/v7.h b/ports/cortex_a9/gnu/example_build/v7.h index c18b945c5..1133b0acc 100644 --- a/ports/cortex_a9/gnu/example_build/v7.h +++ b/ports/cortex_a9/gnu/example_build/v7.h @@ -37,7 +37,6 @@ void disableInterrupts(void); void invalidateCaches_IS(void); void cleanInvalidateDCache(void); -void invalidateCaches_IS(void); void enableCaches(void); void disableCaches(void); void invalidateCaches(void); diff --git a/ports_arch/ARMv7-A/threadx/ports/gnu/example_build/v7.h b/ports_arch/ARMv7-A/threadx/ports/gnu/example_build/v7.h index c18b945c5..1133b0acc 100644 --- a/ports_arch/ARMv7-A/threadx/ports/gnu/example_build/v7.h +++ b/ports_arch/ARMv7-A/threadx/ports/gnu/example_build/v7.h @@ -37,7 +37,6 @@ void disableInterrupts(void); void invalidateCaches_IS(void); void cleanInvalidateDCache(void); -void invalidateCaches_IS(void); void enableCaches(void); void disableCaches(void); void invalidateCaches(void); diff --git a/ports_smp/cortex_a9_smp/gnu/CMakeLists.txt b/ports_smp/cortex_a9_smp/gnu/CMakeLists.txt new file mode 100644 index 000000000..4b13e1a15 --- /dev/null +++ b/ports_smp/cortex_a9_smp/gnu/CMakeLists.txt @@ -0,0 +1,31 @@ +target_sources(${PROJECT_NAME} + PRIVATE + # {{BEGIN_TARGET_SOURCES}} + ${CMAKE_CURRENT_LIST_DIR}/src/tx_thread_context_restore.S + ${CMAKE_CURRENT_LIST_DIR}/src/tx_thread_context_save.S + ${CMAKE_CURRENT_LIST_DIR}/src/tx_thread_interrupt_control.S + ${CMAKE_CURRENT_LIST_DIR}/src/tx_thread_interrupt_disable.S + ${CMAKE_CURRENT_LIST_DIR}/src/tx_thread_interrupt_restore.S + ${CMAKE_CURRENT_LIST_DIR}/src/tx_thread_irq_nesting_end.S + ${CMAKE_CURRENT_LIST_DIR}/src/tx_thread_irq_nesting_start.S + ${CMAKE_CURRENT_LIST_DIR}/src/tx_thread_schedule.S + ${CMAKE_CURRENT_LIST_DIR}/src/tx_thread_smp_core_get.S + ${CMAKE_CURRENT_LIST_DIR}/src/tx_thread_smp_core_preempt.S + ${CMAKE_CURRENT_LIST_DIR}/src/tx_thread_smp_current_state_get.S + ${CMAKE_CURRENT_LIST_DIR}/src/tx_thread_smp_current_thread_get.S + ${CMAKE_CURRENT_LIST_DIR}/src/tx_thread_smp_initialize_wait.S + ${CMAKE_CURRENT_LIST_DIR}/src/tx_thread_smp_low_level_initialize.S + ${CMAKE_CURRENT_LIST_DIR}/src/tx_thread_smp_protect.S + ${CMAKE_CURRENT_LIST_DIR}/src/tx_thread_smp_time_get.S + ${CMAKE_CURRENT_LIST_DIR}/src/tx_thread_smp_unprotect.S + ${CMAKE_CURRENT_LIST_DIR}/src/tx_thread_stack_build.S + ${CMAKE_CURRENT_LIST_DIR}/src/tx_thread_system_return.S + ${CMAKE_CURRENT_LIST_DIR}/src/tx_thread_vectored_context_save.S + ${CMAKE_CURRENT_LIST_DIR}/src/tx_timer_interrupt.S + # {{END_TARGET_SOURCES}} +) + +target_include_directories(${PROJECT_NAME} + PUBLIC + ${CMAKE_CURRENT_LIST_DIR}/inc +) diff --git a/ports_smp/cortex_a9_smp/gnu/example_build/build_threadx_sample.bat b/ports_smp/cortex_a9_smp/gnu/example_build/build_threadx_sample.bat index 0e2611181..07f887eda 100644 --- a/ports_smp/cortex_a9_smp/gnu/example_build/build_threadx_sample.bat +++ b/ports_smp/cortex_a9_smp/gnu/example_build/build_threadx_sample.bat @@ -5,4 +5,4 @@ arm-none-eabi-gcc -c -g -mcpu=cortex-a9 MP_SCU.S arm-none-eabi-gcc -c -g -mcpu=cortex-a9 MP_Mutexes.S arm-none-eabi-gcc -c -g -mcpu=cortex-a9 MP_PrivateTimer.S arm-none-eabi-gcc -c -g -mcpu=cortex-a9 v7.S -arm-none-eabi-gcc -T sample_threadx.ld -e Vectors -o sample_threadx.axf MP_PrivateTimer.o MP_GIC.o MP_Mutexes.o MP_SCU.o sample_threadx.o startup.o v7.o tx.a -Wl,-M > sample_threadx.map +arm-none-eabi-gcc -T sample_threadx.ld -e Vectors -mcpu=cortex-a9 --specs=nosys.specs -o sample_threadx.axf MP_PrivateTimer.o MP_GIC.o MP_Mutexes.o MP_SCU.o sample_threadx.o startup.o v7.o tx.a -Wl,-M > sample_threadx.map