From dfa8fecffcf4f23f2ef6453e4408c28cba9e279e Mon Sep 17 00:00:00 2001 From: Jeewoong Kim Date: Wed, 7 Oct 2026 17:43:38 +0900 Subject: [PATCH] Added ARMv7-A TX_THREAD offset checks The ARMv7-A assembly uses hard-coded offsets to access TX_THREAD members. Changes to the structure layout could break these accesses. Added compile-time checks in the shared ARMv7-A source tree and regenerated the GNU and AC6 port copies. Built all seven GNU port and verified that an incorrect VFP offset causes a compilation failure. Assisted-by: ChatGPT (GPT-5.6 Sol) --- .../cortex_a12/ac6/src/tx_port_offset_check.c | 62 +++++++++++++++++++ ports/cortex_a12/gnu/CMakeLists.txt | 1 + .../cortex_a12/gnu/src/tx_port_offset_check.c | 62 +++++++++++++++++++ .../cortex_a15/ac6/src/tx_port_offset_check.c | 62 +++++++++++++++++++ ports/cortex_a15/gnu/CMakeLists.txt | 1 + .../cortex_a15/gnu/src/tx_port_offset_check.c | 62 +++++++++++++++++++ .../cortex_a17/ac6/src/tx_port_offset_check.c | 62 +++++++++++++++++++ ports/cortex_a17/gnu/CMakeLists.txt | 1 + .../cortex_a17/gnu/src/tx_port_offset_check.c | 62 +++++++++++++++++++ .../cortex_a5/ac6/src/tx_port_offset_check.c | 62 +++++++++++++++++++ ports/cortex_a5/gnu/CMakeLists.txt | 1 + .../cortex_a5/gnu/src/tx_port_offset_check.c | 62 +++++++++++++++++++ .../cortex_a7/ac6/src/tx_port_offset_check.c | 62 +++++++++++++++++++ ports/cortex_a7/gnu/CMakeLists.txt | 1 + .../cortex_a7/gnu/src/tx_port_offset_check.c | 62 +++++++++++++++++++ .../cortex_a8/ac6/src/tx_port_offset_check.c | 62 +++++++++++++++++++ ports/cortex_a8/gnu/CMakeLists.txt | 1 + .../cortex_a8/gnu/src/tx_port_offset_check.c | 62 +++++++++++++++++++ .../cortex_a9/ac6/src/tx_port_offset_check.c | 62 +++++++++++++++++++ ports/cortex_a9/gnu/CMakeLists.txt | 1 + .../cortex_a9/gnu/src/tx_port_offset_check.c | 62 +++++++++++++++++++ .../threadx/common/src/tx_port_offset_check.c | 62 +++++++++++++++++++ .../ARMv7-A/threadx/ports/gnu/CMakeLists.txt | 1 + 23 files changed, 938 insertions(+) create mode 100644 ports/cortex_a12/ac6/src/tx_port_offset_check.c create mode 100644 ports/cortex_a12/gnu/src/tx_port_offset_check.c create mode 100644 ports/cortex_a15/ac6/src/tx_port_offset_check.c create mode 100644 ports/cortex_a15/gnu/src/tx_port_offset_check.c create mode 100644 ports/cortex_a17/ac6/src/tx_port_offset_check.c create mode 100644 ports/cortex_a17/gnu/src/tx_port_offset_check.c create mode 100644 ports/cortex_a5/ac6/src/tx_port_offset_check.c create mode 100644 ports/cortex_a5/gnu/src/tx_port_offset_check.c create mode 100644 ports/cortex_a7/ac6/src/tx_port_offset_check.c create mode 100644 ports/cortex_a7/gnu/src/tx_port_offset_check.c create mode 100644 ports/cortex_a8/ac6/src/tx_port_offset_check.c create mode 100644 ports/cortex_a8/gnu/src/tx_port_offset_check.c create mode 100644 ports/cortex_a9/ac6/src/tx_port_offset_check.c create mode 100644 ports/cortex_a9/gnu/src/tx_port_offset_check.c create mode 100644 ports_arch/ARMv7-A/threadx/common/src/tx_port_offset_check.c diff --git a/ports/cortex_a12/ac6/src/tx_port_offset_check.c b/ports/cortex_a12/ac6/src/tx_port_offset_check.c new file mode 100644 index 000000000..a6dc4e825 --- /dev/null +++ b/ports/cortex_a12/ac6/src/tx_port_offset_check.c @@ -0,0 +1,62 @@ +/*************************************************************************** + * Copyright (c) 2026-present Eclipse ThreadX contributors + * + * This program and the accompanying materials are made available under the + * terms of the MIT License which is available at + * https://opensource.org/licenses/MIT. + * + * SPDX-License-Identifier: MIT + **************************************************************************/ + +/* Verify TX_THREAD offsets used by the ARMv7-A assembly. + + The assembly uses fixed byte offsets to access TX_THREAD fields. + These checks prevent changes to the C structure layout from + silently breaking the assembly's assumptions. */ + +#include "tx_api.h" +#include + +/* Offset of the VFP enable flag as encoded in the ARMv7-A assembly. + Overridable only so that the assertion itself can be tested. */ + +#ifndef TX_PORT_VFP_ENABLE_OFFSET +#define TX_PORT_VFP_ENABLE_OFFSET 144 +#endif + +/* TX_THREAD offsets hard-coded by the ARMv7-A assembly: + + tx_thread_schedule.S: + run_count #4, stack_ptr #8, time_slice #24, vfp_enable #144 + + tx_thread_stack_build.S: + stack_ptr #8, stack_start #12, stack_end #16 + + tx_thread_context_restore.S, tx_thread_fiq_context_restore.S, + tx_thread_system_return.S: + stack_ptr #8, time_slice #24, vfp_enable #144 */ + +typedef char +tx_port_assert_run_count_offset_is_4[ + (offsetof(TX_THREAD, tx_thread_run_count) == 4) ? 1 : -1]; + +typedef char +tx_port_assert_stack_ptr_offset_is_8[ + (offsetof(TX_THREAD, tx_thread_stack_ptr) == 8) ? 1 : -1]; + +typedef char +tx_port_assert_stack_start_offset_is_12[ + (offsetof(TX_THREAD, tx_thread_stack_start) == 12) ? 1 : -1]; + +typedef char +tx_port_assert_stack_end_offset_is_16[ + (offsetof(TX_THREAD, tx_thread_stack_end) == 16) ? 1 : -1]; + +typedef char +tx_port_assert_time_slice_offset_is_24[ + (offsetof(TX_THREAD, tx_thread_time_slice) == 24) ? 1 : -1]; + +typedef char +tx_port_assert_vfp_enable_offset_is_144[ + (offsetof(TX_THREAD, tx_thread_vfp_enable) == TX_PORT_VFP_ENABLE_OFFSET) + ? 1 : -1]; diff --git a/ports/cortex_a12/gnu/CMakeLists.txt b/ports/cortex_a12/gnu/CMakeLists.txt index fc2158767..faf6dbdcd 100644 --- a/ports/cortex_a12/gnu/CMakeLists.txt +++ b/ports/cortex_a12/gnu/CMakeLists.txt @@ -24,6 +24,7 @@ target_sources(${PROJECT_NAME} ${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 + ${CMAKE_CURRENT_LIST_DIR}/src/tx_port_offset_check.c # {{END_TARGET_SOURCES}} ) diff --git a/ports/cortex_a12/gnu/src/tx_port_offset_check.c b/ports/cortex_a12/gnu/src/tx_port_offset_check.c new file mode 100644 index 000000000..a6dc4e825 --- /dev/null +++ b/ports/cortex_a12/gnu/src/tx_port_offset_check.c @@ -0,0 +1,62 @@ +/*************************************************************************** + * Copyright (c) 2026-present Eclipse ThreadX contributors + * + * This program and the accompanying materials are made available under the + * terms of the MIT License which is available at + * https://opensource.org/licenses/MIT. + * + * SPDX-License-Identifier: MIT + **************************************************************************/ + +/* Verify TX_THREAD offsets used by the ARMv7-A assembly. + + The assembly uses fixed byte offsets to access TX_THREAD fields. + These checks prevent changes to the C structure layout from + silently breaking the assembly's assumptions. */ + +#include "tx_api.h" +#include + +/* Offset of the VFP enable flag as encoded in the ARMv7-A assembly. + Overridable only so that the assertion itself can be tested. */ + +#ifndef TX_PORT_VFP_ENABLE_OFFSET +#define TX_PORT_VFP_ENABLE_OFFSET 144 +#endif + +/* TX_THREAD offsets hard-coded by the ARMv7-A assembly: + + tx_thread_schedule.S: + run_count #4, stack_ptr #8, time_slice #24, vfp_enable #144 + + tx_thread_stack_build.S: + stack_ptr #8, stack_start #12, stack_end #16 + + tx_thread_context_restore.S, tx_thread_fiq_context_restore.S, + tx_thread_system_return.S: + stack_ptr #8, time_slice #24, vfp_enable #144 */ + +typedef char +tx_port_assert_run_count_offset_is_4[ + (offsetof(TX_THREAD, tx_thread_run_count) == 4) ? 1 : -1]; + +typedef char +tx_port_assert_stack_ptr_offset_is_8[ + (offsetof(TX_THREAD, tx_thread_stack_ptr) == 8) ? 1 : -1]; + +typedef char +tx_port_assert_stack_start_offset_is_12[ + (offsetof(TX_THREAD, tx_thread_stack_start) == 12) ? 1 : -1]; + +typedef char +tx_port_assert_stack_end_offset_is_16[ + (offsetof(TX_THREAD, tx_thread_stack_end) == 16) ? 1 : -1]; + +typedef char +tx_port_assert_time_slice_offset_is_24[ + (offsetof(TX_THREAD, tx_thread_time_slice) == 24) ? 1 : -1]; + +typedef char +tx_port_assert_vfp_enable_offset_is_144[ + (offsetof(TX_THREAD, tx_thread_vfp_enable) == TX_PORT_VFP_ENABLE_OFFSET) + ? 1 : -1]; diff --git a/ports/cortex_a15/ac6/src/tx_port_offset_check.c b/ports/cortex_a15/ac6/src/tx_port_offset_check.c new file mode 100644 index 000000000..a6dc4e825 --- /dev/null +++ b/ports/cortex_a15/ac6/src/tx_port_offset_check.c @@ -0,0 +1,62 @@ +/*************************************************************************** + * Copyright (c) 2026-present Eclipse ThreadX contributors + * + * This program and the accompanying materials are made available under the + * terms of the MIT License which is available at + * https://opensource.org/licenses/MIT. + * + * SPDX-License-Identifier: MIT + **************************************************************************/ + +/* Verify TX_THREAD offsets used by the ARMv7-A assembly. + + The assembly uses fixed byte offsets to access TX_THREAD fields. + These checks prevent changes to the C structure layout from + silently breaking the assembly's assumptions. */ + +#include "tx_api.h" +#include + +/* Offset of the VFP enable flag as encoded in the ARMv7-A assembly. + Overridable only so that the assertion itself can be tested. */ + +#ifndef TX_PORT_VFP_ENABLE_OFFSET +#define TX_PORT_VFP_ENABLE_OFFSET 144 +#endif + +/* TX_THREAD offsets hard-coded by the ARMv7-A assembly: + + tx_thread_schedule.S: + run_count #4, stack_ptr #8, time_slice #24, vfp_enable #144 + + tx_thread_stack_build.S: + stack_ptr #8, stack_start #12, stack_end #16 + + tx_thread_context_restore.S, tx_thread_fiq_context_restore.S, + tx_thread_system_return.S: + stack_ptr #8, time_slice #24, vfp_enable #144 */ + +typedef char +tx_port_assert_run_count_offset_is_4[ + (offsetof(TX_THREAD, tx_thread_run_count) == 4) ? 1 : -1]; + +typedef char +tx_port_assert_stack_ptr_offset_is_8[ + (offsetof(TX_THREAD, tx_thread_stack_ptr) == 8) ? 1 : -1]; + +typedef char +tx_port_assert_stack_start_offset_is_12[ + (offsetof(TX_THREAD, tx_thread_stack_start) == 12) ? 1 : -1]; + +typedef char +tx_port_assert_stack_end_offset_is_16[ + (offsetof(TX_THREAD, tx_thread_stack_end) == 16) ? 1 : -1]; + +typedef char +tx_port_assert_time_slice_offset_is_24[ + (offsetof(TX_THREAD, tx_thread_time_slice) == 24) ? 1 : -1]; + +typedef char +tx_port_assert_vfp_enable_offset_is_144[ + (offsetof(TX_THREAD, tx_thread_vfp_enable) == TX_PORT_VFP_ENABLE_OFFSET) + ? 1 : -1]; diff --git a/ports/cortex_a15/gnu/CMakeLists.txt b/ports/cortex_a15/gnu/CMakeLists.txt index fc2158767..faf6dbdcd 100644 --- a/ports/cortex_a15/gnu/CMakeLists.txt +++ b/ports/cortex_a15/gnu/CMakeLists.txt @@ -24,6 +24,7 @@ target_sources(${PROJECT_NAME} ${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 + ${CMAKE_CURRENT_LIST_DIR}/src/tx_port_offset_check.c # {{END_TARGET_SOURCES}} ) diff --git a/ports/cortex_a15/gnu/src/tx_port_offset_check.c b/ports/cortex_a15/gnu/src/tx_port_offset_check.c new file mode 100644 index 000000000..a6dc4e825 --- /dev/null +++ b/ports/cortex_a15/gnu/src/tx_port_offset_check.c @@ -0,0 +1,62 @@ +/*************************************************************************** + * Copyright (c) 2026-present Eclipse ThreadX contributors + * + * This program and the accompanying materials are made available under the + * terms of the MIT License which is available at + * https://opensource.org/licenses/MIT. + * + * SPDX-License-Identifier: MIT + **************************************************************************/ + +/* Verify TX_THREAD offsets used by the ARMv7-A assembly. + + The assembly uses fixed byte offsets to access TX_THREAD fields. + These checks prevent changes to the C structure layout from + silently breaking the assembly's assumptions. */ + +#include "tx_api.h" +#include + +/* Offset of the VFP enable flag as encoded in the ARMv7-A assembly. + Overridable only so that the assertion itself can be tested. */ + +#ifndef TX_PORT_VFP_ENABLE_OFFSET +#define TX_PORT_VFP_ENABLE_OFFSET 144 +#endif + +/* TX_THREAD offsets hard-coded by the ARMv7-A assembly: + + tx_thread_schedule.S: + run_count #4, stack_ptr #8, time_slice #24, vfp_enable #144 + + tx_thread_stack_build.S: + stack_ptr #8, stack_start #12, stack_end #16 + + tx_thread_context_restore.S, tx_thread_fiq_context_restore.S, + tx_thread_system_return.S: + stack_ptr #8, time_slice #24, vfp_enable #144 */ + +typedef char +tx_port_assert_run_count_offset_is_4[ + (offsetof(TX_THREAD, tx_thread_run_count) == 4) ? 1 : -1]; + +typedef char +tx_port_assert_stack_ptr_offset_is_8[ + (offsetof(TX_THREAD, tx_thread_stack_ptr) == 8) ? 1 : -1]; + +typedef char +tx_port_assert_stack_start_offset_is_12[ + (offsetof(TX_THREAD, tx_thread_stack_start) == 12) ? 1 : -1]; + +typedef char +tx_port_assert_stack_end_offset_is_16[ + (offsetof(TX_THREAD, tx_thread_stack_end) == 16) ? 1 : -1]; + +typedef char +tx_port_assert_time_slice_offset_is_24[ + (offsetof(TX_THREAD, tx_thread_time_slice) == 24) ? 1 : -1]; + +typedef char +tx_port_assert_vfp_enable_offset_is_144[ + (offsetof(TX_THREAD, tx_thread_vfp_enable) == TX_PORT_VFP_ENABLE_OFFSET) + ? 1 : -1]; diff --git a/ports/cortex_a17/ac6/src/tx_port_offset_check.c b/ports/cortex_a17/ac6/src/tx_port_offset_check.c new file mode 100644 index 000000000..a6dc4e825 --- /dev/null +++ b/ports/cortex_a17/ac6/src/tx_port_offset_check.c @@ -0,0 +1,62 @@ +/*************************************************************************** + * Copyright (c) 2026-present Eclipse ThreadX contributors + * + * This program and the accompanying materials are made available under the + * terms of the MIT License which is available at + * https://opensource.org/licenses/MIT. + * + * SPDX-License-Identifier: MIT + **************************************************************************/ + +/* Verify TX_THREAD offsets used by the ARMv7-A assembly. + + The assembly uses fixed byte offsets to access TX_THREAD fields. + These checks prevent changes to the C structure layout from + silently breaking the assembly's assumptions. */ + +#include "tx_api.h" +#include + +/* Offset of the VFP enable flag as encoded in the ARMv7-A assembly. + Overridable only so that the assertion itself can be tested. */ + +#ifndef TX_PORT_VFP_ENABLE_OFFSET +#define TX_PORT_VFP_ENABLE_OFFSET 144 +#endif + +/* TX_THREAD offsets hard-coded by the ARMv7-A assembly: + + tx_thread_schedule.S: + run_count #4, stack_ptr #8, time_slice #24, vfp_enable #144 + + tx_thread_stack_build.S: + stack_ptr #8, stack_start #12, stack_end #16 + + tx_thread_context_restore.S, tx_thread_fiq_context_restore.S, + tx_thread_system_return.S: + stack_ptr #8, time_slice #24, vfp_enable #144 */ + +typedef char +tx_port_assert_run_count_offset_is_4[ + (offsetof(TX_THREAD, tx_thread_run_count) == 4) ? 1 : -1]; + +typedef char +tx_port_assert_stack_ptr_offset_is_8[ + (offsetof(TX_THREAD, tx_thread_stack_ptr) == 8) ? 1 : -1]; + +typedef char +tx_port_assert_stack_start_offset_is_12[ + (offsetof(TX_THREAD, tx_thread_stack_start) == 12) ? 1 : -1]; + +typedef char +tx_port_assert_stack_end_offset_is_16[ + (offsetof(TX_THREAD, tx_thread_stack_end) == 16) ? 1 : -1]; + +typedef char +tx_port_assert_time_slice_offset_is_24[ + (offsetof(TX_THREAD, tx_thread_time_slice) == 24) ? 1 : -1]; + +typedef char +tx_port_assert_vfp_enable_offset_is_144[ + (offsetof(TX_THREAD, tx_thread_vfp_enable) == TX_PORT_VFP_ENABLE_OFFSET) + ? 1 : -1]; diff --git a/ports/cortex_a17/gnu/CMakeLists.txt b/ports/cortex_a17/gnu/CMakeLists.txt index fc2158767..faf6dbdcd 100644 --- a/ports/cortex_a17/gnu/CMakeLists.txt +++ b/ports/cortex_a17/gnu/CMakeLists.txt @@ -24,6 +24,7 @@ target_sources(${PROJECT_NAME} ${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 + ${CMAKE_CURRENT_LIST_DIR}/src/tx_port_offset_check.c # {{END_TARGET_SOURCES}} ) diff --git a/ports/cortex_a17/gnu/src/tx_port_offset_check.c b/ports/cortex_a17/gnu/src/tx_port_offset_check.c new file mode 100644 index 000000000..a6dc4e825 --- /dev/null +++ b/ports/cortex_a17/gnu/src/tx_port_offset_check.c @@ -0,0 +1,62 @@ +/*************************************************************************** + * Copyright (c) 2026-present Eclipse ThreadX contributors + * + * This program and the accompanying materials are made available under the + * terms of the MIT License which is available at + * https://opensource.org/licenses/MIT. + * + * SPDX-License-Identifier: MIT + **************************************************************************/ + +/* Verify TX_THREAD offsets used by the ARMv7-A assembly. + + The assembly uses fixed byte offsets to access TX_THREAD fields. + These checks prevent changes to the C structure layout from + silently breaking the assembly's assumptions. */ + +#include "tx_api.h" +#include + +/* Offset of the VFP enable flag as encoded in the ARMv7-A assembly. + Overridable only so that the assertion itself can be tested. */ + +#ifndef TX_PORT_VFP_ENABLE_OFFSET +#define TX_PORT_VFP_ENABLE_OFFSET 144 +#endif + +/* TX_THREAD offsets hard-coded by the ARMv7-A assembly: + + tx_thread_schedule.S: + run_count #4, stack_ptr #8, time_slice #24, vfp_enable #144 + + tx_thread_stack_build.S: + stack_ptr #8, stack_start #12, stack_end #16 + + tx_thread_context_restore.S, tx_thread_fiq_context_restore.S, + tx_thread_system_return.S: + stack_ptr #8, time_slice #24, vfp_enable #144 */ + +typedef char +tx_port_assert_run_count_offset_is_4[ + (offsetof(TX_THREAD, tx_thread_run_count) == 4) ? 1 : -1]; + +typedef char +tx_port_assert_stack_ptr_offset_is_8[ + (offsetof(TX_THREAD, tx_thread_stack_ptr) == 8) ? 1 : -1]; + +typedef char +tx_port_assert_stack_start_offset_is_12[ + (offsetof(TX_THREAD, tx_thread_stack_start) == 12) ? 1 : -1]; + +typedef char +tx_port_assert_stack_end_offset_is_16[ + (offsetof(TX_THREAD, tx_thread_stack_end) == 16) ? 1 : -1]; + +typedef char +tx_port_assert_time_slice_offset_is_24[ + (offsetof(TX_THREAD, tx_thread_time_slice) == 24) ? 1 : -1]; + +typedef char +tx_port_assert_vfp_enable_offset_is_144[ + (offsetof(TX_THREAD, tx_thread_vfp_enable) == TX_PORT_VFP_ENABLE_OFFSET) + ? 1 : -1]; diff --git a/ports/cortex_a5/ac6/src/tx_port_offset_check.c b/ports/cortex_a5/ac6/src/tx_port_offset_check.c new file mode 100644 index 000000000..a6dc4e825 --- /dev/null +++ b/ports/cortex_a5/ac6/src/tx_port_offset_check.c @@ -0,0 +1,62 @@ +/*************************************************************************** + * Copyright (c) 2026-present Eclipse ThreadX contributors + * + * This program and the accompanying materials are made available under the + * terms of the MIT License which is available at + * https://opensource.org/licenses/MIT. + * + * SPDX-License-Identifier: MIT + **************************************************************************/ + +/* Verify TX_THREAD offsets used by the ARMv7-A assembly. + + The assembly uses fixed byte offsets to access TX_THREAD fields. + These checks prevent changes to the C structure layout from + silently breaking the assembly's assumptions. */ + +#include "tx_api.h" +#include + +/* Offset of the VFP enable flag as encoded in the ARMv7-A assembly. + Overridable only so that the assertion itself can be tested. */ + +#ifndef TX_PORT_VFP_ENABLE_OFFSET +#define TX_PORT_VFP_ENABLE_OFFSET 144 +#endif + +/* TX_THREAD offsets hard-coded by the ARMv7-A assembly: + + tx_thread_schedule.S: + run_count #4, stack_ptr #8, time_slice #24, vfp_enable #144 + + tx_thread_stack_build.S: + stack_ptr #8, stack_start #12, stack_end #16 + + tx_thread_context_restore.S, tx_thread_fiq_context_restore.S, + tx_thread_system_return.S: + stack_ptr #8, time_slice #24, vfp_enable #144 */ + +typedef char +tx_port_assert_run_count_offset_is_4[ + (offsetof(TX_THREAD, tx_thread_run_count) == 4) ? 1 : -1]; + +typedef char +tx_port_assert_stack_ptr_offset_is_8[ + (offsetof(TX_THREAD, tx_thread_stack_ptr) == 8) ? 1 : -1]; + +typedef char +tx_port_assert_stack_start_offset_is_12[ + (offsetof(TX_THREAD, tx_thread_stack_start) == 12) ? 1 : -1]; + +typedef char +tx_port_assert_stack_end_offset_is_16[ + (offsetof(TX_THREAD, tx_thread_stack_end) == 16) ? 1 : -1]; + +typedef char +tx_port_assert_time_slice_offset_is_24[ + (offsetof(TX_THREAD, tx_thread_time_slice) == 24) ? 1 : -1]; + +typedef char +tx_port_assert_vfp_enable_offset_is_144[ + (offsetof(TX_THREAD, tx_thread_vfp_enable) == TX_PORT_VFP_ENABLE_OFFSET) + ? 1 : -1]; diff --git a/ports/cortex_a5/gnu/CMakeLists.txt b/ports/cortex_a5/gnu/CMakeLists.txt index fc2158767..faf6dbdcd 100644 --- a/ports/cortex_a5/gnu/CMakeLists.txt +++ b/ports/cortex_a5/gnu/CMakeLists.txt @@ -24,6 +24,7 @@ target_sources(${PROJECT_NAME} ${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 + ${CMAKE_CURRENT_LIST_DIR}/src/tx_port_offset_check.c # {{END_TARGET_SOURCES}} ) diff --git a/ports/cortex_a5/gnu/src/tx_port_offset_check.c b/ports/cortex_a5/gnu/src/tx_port_offset_check.c new file mode 100644 index 000000000..a6dc4e825 --- /dev/null +++ b/ports/cortex_a5/gnu/src/tx_port_offset_check.c @@ -0,0 +1,62 @@ +/*************************************************************************** + * Copyright (c) 2026-present Eclipse ThreadX contributors + * + * This program and the accompanying materials are made available under the + * terms of the MIT License which is available at + * https://opensource.org/licenses/MIT. + * + * SPDX-License-Identifier: MIT + **************************************************************************/ + +/* Verify TX_THREAD offsets used by the ARMv7-A assembly. + + The assembly uses fixed byte offsets to access TX_THREAD fields. + These checks prevent changes to the C structure layout from + silently breaking the assembly's assumptions. */ + +#include "tx_api.h" +#include + +/* Offset of the VFP enable flag as encoded in the ARMv7-A assembly. + Overridable only so that the assertion itself can be tested. */ + +#ifndef TX_PORT_VFP_ENABLE_OFFSET +#define TX_PORT_VFP_ENABLE_OFFSET 144 +#endif + +/* TX_THREAD offsets hard-coded by the ARMv7-A assembly: + + tx_thread_schedule.S: + run_count #4, stack_ptr #8, time_slice #24, vfp_enable #144 + + tx_thread_stack_build.S: + stack_ptr #8, stack_start #12, stack_end #16 + + tx_thread_context_restore.S, tx_thread_fiq_context_restore.S, + tx_thread_system_return.S: + stack_ptr #8, time_slice #24, vfp_enable #144 */ + +typedef char +tx_port_assert_run_count_offset_is_4[ + (offsetof(TX_THREAD, tx_thread_run_count) == 4) ? 1 : -1]; + +typedef char +tx_port_assert_stack_ptr_offset_is_8[ + (offsetof(TX_THREAD, tx_thread_stack_ptr) == 8) ? 1 : -1]; + +typedef char +tx_port_assert_stack_start_offset_is_12[ + (offsetof(TX_THREAD, tx_thread_stack_start) == 12) ? 1 : -1]; + +typedef char +tx_port_assert_stack_end_offset_is_16[ + (offsetof(TX_THREAD, tx_thread_stack_end) == 16) ? 1 : -1]; + +typedef char +tx_port_assert_time_slice_offset_is_24[ + (offsetof(TX_THREAD, tx_thread_time_slice) == 24) ? 1 : -1]; + +typedef char +tx_port_assert_vfp_enable_offset_is_144[ + (offsetof(TX_THREAD, tx_thread_vfp_enable) == TX_PORT_VFP_ENABLE_OFFSET) + ? 1 : -1]; diff --git a/ports/cortex_a7/ac6/src/tx_port_offset_check.c b/ports/cortex_a7/ac6/src/tx_port_offset_check.c new file mode 100644 index 000000000..a6dc4e825 --- /dev/null +++ b/ports/cortex_a7/ac6/src/tx_port_offset_check.c @@ -0,0 +1,62 @@ +/*************************************************************************** + * Copyright (c) 2026-present Eclipse ThreadX contributors + * + * This program and the accompanying materials are made available under the + * terms of the MIT License which is available at + * https://opensource.org/licenses/MIT. + * + * SPDX-License-Identifier: MIT + **************************************************************************/ + +/* Verify TX_THREAD offsets used by the ARMv7-A assembly. + + The assembly uses fixed byte offsets to access TX_THREAD fields. + These checks prevent changes to the C structure layout from + silently breaking the assembly's assumptions. */ + +#include "tx_api.h" +#include + +/* Offset of the VFP enable flag as encoded in the ARMv7-A assembly. + Overridable only so that the assertion itself can be tested. */ + +#ifndef TX_PORT_VFP_ENABLE_OFFSET +#define TX_PORT_VFP_ENABLE_OFFSET 144 +#endif + +/* TX_THREAD offsets hard-coded by the ARMv7-A assembly: + + tx_thread_schedule.S: + run_count #4, stack_ptr #8, time_slice #24, vfp_enable #144 + + tx_thread_stack_build.S: + stack_ptr #8, stack_start #12, stack_end #16 + + tx_thread_context_restore.S, tx_thread_fiq_context_restore.S, + tx_thread_system_return.S: + stack_ptr #8, time_slice #24, vfp_enable #144 */ + +typedef char +tx_port_assert_run_count_offset_is_4[ + (offsetof(TX_THREAD, tx_thread_run_count) == 4) ? 1 : -1]; + +typedef char +tx_port_assert_stack_ptr_offset_is_8[ + (offsetof(TX_THREAD, tx_thread_stack_ptr) == 8) ? 1 : -1]; + +typedef char +tx_port_assert_stack_start_offset_is_12[ + (offsetof(TX_THREAD, tx_thread_stack_start) == 12) ? 1 : -1]; + +typedef char +tx_port_assert_stack_end_offset_is_16[ + (offsetof(TX_THREAD, tx_thread_stack_end) == 16) ? 1 : -1]; + +typedef char +tx_port_assert_time_slice_offset_is_24[ + (offsetof(TX_THREAD, tx_thread_time_slice) == 24) ? 1 : -1]; + +typedef char +tx_port_assert_vfp_enable_offset_is_144[ + (offsetof(TX_THREAD, tx_thread_vfp_enable) == TX_PORT_VFP_ENABLE_OFFSET) + ? 1 : -1]; diff --git a/ports/cortex_a7/gnu/CMakeLists.txt b/ports/cortex_a7/gnu/CMakeLists.txt index fc2158767..faf6dbdcd 100644 --- a/ports/cortex_a7/gnu/CMakeLists.txt +++ b/ports/cortex_a7/gnu/CMakeLists.txt @@ -24,6 +24,7 @@ target_sources(${PROJECT_NAME} ${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 + ${CMAKE_CURRENT_LIST_DIR}/src/tx_port_offset_check.c # {{END_TARGET_SOURCES}} ) diff --git a/ports/cortex_a7/gnu/src/tx_port_offset_check.c b/ports/cortex_a7/gnu/src/tx_port_offset_check.c new file mode 100644 index 000000000..a6dc4e825 --- /dev/null +++ b/ports/cortex_a7/gnu/src/tx_port_offset_check.c @@ -0,0 +1,62 @@ +/*************************************************************************** + * Copyright (c) 2026-present Eclipse ThreadX contributors + * + * This program and the accompanying materials are made available under the + * terms of the MIT License which is available at + * https://opensource.org/licenses/MIT. + * + * SPDX-License-Identifier: MIT + **************************************************************************/ + +/* Verify TX_THREAD offsets used by the ARMv7-A assembly. + + The assembly uses fixed byte offsets to access TX_THREAD fields. + These checks prevent changes to the C structure layout from + silently breaking the assembly's assumptions. */ + +#include "tx_api.h" +#include + +/* Offset of the VFP enable flag as encoded in the ARMv7-A assembly. + Overridable only so that the assertion itself can be tested. */ + +#ifndef TX_PORT_VFP_ENABLE_OFFSET +#define TX_PORT_VFP_ENABLE_OFFSET 144 +#endif + +/* TX_THREAD offsets hard-coded by the ARMv7-A assembly: + + tx_thread_schedule.S: + run_count #4, stack_ptr #8, time_slice #24, vfp_enable #144 + + tx_thread_stack_build.S: + stack_ptr #8, stack_start #12, stack_end #16 + + tx_thread_context_restore.S, tx_thread_fiq_context_restore.S, + tx_thread_system_return.S: + stack_ptr #8, time_slice #24, vfp_enable #144 */ + +typedef char +tx_port_assert_run_count_offset_is_4[ + (offsetof(TX_THREAD, tx_thread_run_count) == 4) ? 1 : -1]; + +typedef char +tx_port_assert_stack_ptr_offset_is_8[ + (offsetof(TX_THREAD, tx_thread_stack_ptr) == 8) ? 1 : -1]; + +typedef char +tx_port_assert_stack_start_offset_is_12[ + (offsetof(TX_THREAD, tx_thread_stack_start) == 12) ? 1 : -1]; + +typedef char +tx_port_assert_stack_end_offset_is_16[ + (offsetof(TX_THREAD, tx_thread_stack_end) == 16) ? 1 : -1]; + +typedef char +tx_port_assert_time_slice_offset_is_24[ + (offsetof(TX_THREAD, tx_thread_time_slice) == 24) ? 1 : -1]; + +typedef char +tx_port_assert_vfp_enable_offset_is_144[ + (offsetof(TX_THREAD, tx_thread_vfp_enable) == TX_PORT_VFP_ENABLE_OFFSET) + ? 1 : -1]; diff --git a/ports/cortex_a8/ac6/src/tx_port_offset_check.c b/ports/cortex_a8/ac6/src/tx_port_offset_check.c new file mode 100644 index 000000000..a6dc4e825 --- /dev/null +++ b/ports/cortex_a8/ac6/src/tx_port_offset_check.c @@ -0,0 +1,62 @@ +/*************************************************************************** + * Copyright (c) 2026-present Eclipse ThreadX contributors + * + * This program and the accompanying materials are made available under the + * terms of the MIT License which is available at + * https://opensource.org/licenses/MIT. + * + * SPDX-License-Identifier: MIT + **************************************************************************/ + +/* Verify TX_THREAD offsets used by the ARMv7-A assembly. + + The assembly uses fixed byte offsets to access TX_THREAD fields. + These checks prevent changes to the C structure layout from + silently breaking the assembly's assumptions. */ + +#include "tx_api.h" +#include + +/* Offset of the VFP enable flag as encoded in the ARMv7-A assembly. + Overridable only so that the assertion itself can be tested. */ + +#ifndef TX_PORT_VFP_ENABLE_OFFSET +#define TX_PORT_VFP_ENABLE_OFFSET 144 +#endif + +/* TX_THREAD offsets hard-coded by the ARMv7-A assembly: + + tx_thread_schedule.S: + run_count #4, stack_ptr #8, time_slice #24, vfp_enable #144 + + tx_thread_stack_build.S: + stack_ptr #8, stack_start #12, stack_end #16 + + tx_thread_context_restore.S, tx_thread_fiq_context_restore.S, + tx_thread_system_return.S: + stack_ptr #8, time_slice #24, vfp_enable #144 */ + +typedef char +tx_port_assert_run_count_offset_is_4[ + (offsetof(TX_THREAD, tx_thread_run_count) == 4) ? 1 : -1]; + +typedef char +tx_port_assert_stack_ptr_offset_is_8[ + (offsetof(TX_THREAD, tx_thread_stack_ptr) == 8) ? 1 : -1]; + +typedef char +tx_port_assert_stack_start_offset_is_12[ + (offsetof(TX_THREAD, tx_thread_stack_start) == 12) ? 1 : -1]; + +typedef char +tx_port_assert_stack_end_offset_is_16[ + (offsetof(TX_THREAD, tx_thread_stack_end) == 16) ? 1 : -1]; + +typedef char +tx_port_assert_time_slice_offset_is_24[ + (offsetof(TX_THREAD, tx_thread_time_slice) == 24) ? 1 : -1]; + +typedef char +tx_port_assert_vfp_enable_offset_is_144[ + (offsetof(TX_THREAD, tx_thread_vfp_enable) == TX_PORT_VFP_ENABLE_OFFSET) + ? 1 : -1]; diff --git a/ports/cortex_a8/gnu/CMakeLists.txt b/ports/cortex_a8/gnu/CMakeLists.txt index fc2158767..faf6dbdcd 100644 --- a/ports/cortex_a8/gnu/CMakeLists.txt +++ b/ports/cortex_a8/gnu/CMakeLists.txt @@ -24,6 +24,7 @@ target_sources(${PROJECT_NAME} ${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 + ${CMAKE_CURRENT_LIST_DIR}/src/tx_port_offset_check.c # {{END_TARGET_SOURCES}} ) diff --git a/ports/cortex_a8/gnu/src/tx_port_offset_check.c b/ports/cortex_a8/gnu/src/tx_port_offset_check.c new file mode 100644 index 000000000..a6dc4e825 --- /dev/null +++ b/ports/cortex_a8/gnu/src/tx_port_offset_check.c @@ -0,0 +1,62 @@ +/*************************************************************************** + * Copyright (c) 2026-present Eclipse ThreadX contributors + * + * This program and the accompanying materials are made available under the + * terms of the MIT License which is available at + * https://opensource.org/licenses/MIT. + * + * SPDX-License-Identifier: MIT + **************************************************************************/ + +/* Verify TX_THREAD offsets used by the ARMv7-A assembly. + + The assembly uses fixed byte offsets to access TX_THREAD fields. + These checks prevent changes to the C structure layout from + silently breaking the assembly's assumptions. */ + +#include "tx_api.h" +#include + +/* Offset of the VFP enable flag as encoded in the ARMv7-A assembly. + Overridable only so that the assertion itself can be tested. */ + +#ifndef TX_PORT_VFP_ENABLE_OFFSET +#define TX_PORT_VFP_ENABLE_OFFSET 144 +#endif + +/* TX_THREAD offsets hard-coded by the ARMv7-A assembly: + + tx_thread_schedule.S: + run_count #4, stack_ptr #8, time_slice #24, vfp_enable #144 + + tx_thread_stack_build.S: + stack_ptr #8, stack_start #12, stack_end #16 + + tx_thread_context_restore.S, tx_thread_fiq_context_restore.S, + tx_thread_system_return.S: + stack_ptr #8, time_slice #24, vfp_enable #144 */ + +typedef char +tx_port_assert_run_count_offset_is_4[ + (offsetof(TX_THREAD, tx_thread_run_count) == 4) ? 1 : -1]; + +typedef char +tx_port_assert_stack_ptr_offset_is_8[ + (offsetof(TX_THREAD, tx_thread_stack_ptr) == 8) ? 1 : -1]; + +typedef char +tx_port_assert_stack_start_offset_is_12[ + (offsetof(TX_THREAD, tx_thread_stack_start) == 12) ? 1 : -1]; + +typedef char +tx_port_assert_stack_end_offset_is_16[ + (offsetof(TX_THREAD, tx_thread_stack_end) == 16) ? 1 : -1]; + +typedef char +tx_port_assert_time_slice_offset_is_24[ + (offsetof(TX_THREAD, tx_thread_time_slice) == 24) ? 1 : -1]; + +typedef char +tx_port_assert_vfp_enable_offset_is_144[ + (offsetof(TX_THREAD, tx_thread_vfp_enable) == TX_PORT_VFP_ENABLE_OFFSET) + ? 1 : -1]; diff --git a/ports/cortex_a9/ac6/src/tx_port_offset_check.c b/ports/cortex_a9/ac6/src/tx_port_offset_check.c new file mode 100644 index 000000000..a6dc4e825 --- /dev/null +++ b/ports/cortex_a9/ac6/src/tx_port_offset_check.c @@ -0,0 +1,62 @@ +/*************************************************************************** + * Copyright (c) 2026-present Eclipse ThreadX contributors + * + * This program and the accompanying materials are made available under the + * terms of the MIT License which is available at + * https://opensource.org/licenses/MIT. + * + * SPDX-License-Identifier: MIT + **************************************************************************/ + +/* Verify TX_THREAD offsets used by the ARMv7-A assembly. + + The assembly uses fixed byte offsets to access TX_THREAD fields. + These checks prevent changes to the C structure layout from + silently breaking the assembly's assumptions. */ + +#include "tx_api.h" +#include + +/* Offset of the VFP enable flag as encoded in the ARMv7-A assembly. + Overridable only so that the assertion itself can be tested. */ + +#ifndef TX_PORT_VFP_ENABLE_OFFSET +#define TX_PORT_VFP_ENABLE_OFFSET 144 +#endif + +/* TX_THREAD offsets hard-coded by the ARMv7-A assembly: + + tx_thread_schedule.S: + run_count #4, stack_ptr #8, time_slice #24, vfp_enable #144 + + tx_thread_stack_build.S: + stack_ptr #8, stack_start #12, stack_end #16 + + tx_thread_context_restore.S, tx_thread_fiq_context_restore.S, + tx_thread_system_return.S: + stack_ptr #8, time_slice #24, vfp_enable #144 */ + +typedef char +tx_port_assert_run_count_offset_is_4[ + (offsetof(TX_THREAD, tx_thread_run_count) == 4) ? 1 : -1]; + +typedef char +tx_port_assert_stack_ptr_offset_is_8[ + (offsetof(TX_THREAD, tx_thread_stack_ptr) == 8) ? 1 : -1]; + +typedef char +tx_port_assert_stack_start_offset_is_12[ + (offsetof(TX_THREAD, tx_thread_stack_start) == 12) ? 1 : -1]; + +typedef char +tx_port_assert_stack_end_offset_is_16[ + (offsetof(TX_THREAD, tx_thread_stack_end) == 16) ? 1 : -1]; + +typedef char +tx_port_assert_time_slice_offset_is_24[ + (offsetof(TX_THREAD, tx_thread_time_slice) == 24) ? 1 : -1]; + +typedef char +tx_port_assert_vfp_enable_offset_is_144[ + (offsetof(TX_THREAD, tx_thread_vfp_enable) == TX_PORT_VFP_ENABLE_OFFSET) + ? 1 : -1]; diff --git a/ports/cortex_a9/gnu/CMakeLists.txt b/ports/cortex_a9/gnu/CMakeLists.txt index fc2158767..faf6dbdcd 100644 --- a/ports/cortex_a9/gnu/CMakeLists.txt +++ b/ports/cortex_a9/gnu/CMakeLists.txt @@ -24,6 +24,7 @@ target_sources(${PROJECT_NAME} ${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 + ${CMAKE_CURRENT_LIST_DIR}/src/tx_port_offset_check.c # {{END_TARGET_SOURCES}} ) diff --git a/ports/cortex_a9/gnu/src/tx_port_offset_check.c b/ports/cortex_a9/gnu/src/tx_port_offset_check.c new file mode 100644 index 000000000..a6dc4e825 --- /dev/null +++ b/ports/cortex_a9/gnu/src/tx_port_offset_check.c @@ -0,0 +1,62 @@ +/*************************************************************************** + * Copyright (c) 2026-present Eclipse ThreadX contributors + * + * This program and the accompanying materials are made available under the + * terms of the MIT License which is available at + * https://opensource.org/licenses/MIT. + * + * SPDX-License-Identifier: MIT + **************************************************************************/ + +/* Verify TX_THREAD offsets used by the ARMv7-A assembly. + + The assembly uses fixed byte offsets to access TX_THREAD fields. + These checks prevent changes to the C structure layout from + silently breaking the assembly's assumptions. */ + +#include "tx_api.h" +#include + +/* Offset of the VFP enable flag as encoded in the ARMv7-A assembly. + Overridable only so that the assertion itself can be tested. */ + +#ifndef TX_PORT_VFP_ENABLE_OFFSET +#define TX_PORT_VFP_ENABLE_OFFSET 144 +#endif + +/* TX_THREAD offsets hard-coded by the ARMv7-A assembly: + + tx_thread_schedule.S: + run_count #4, stack_ptr #8, time_slice #24, vfp_enable #144 + + tx_thread_stack_build.S: + stack_ptr #8, stack_start #12, stack_end #16 + + tx_thread_context_restore.S, tx_thread_fiq_context_restore.S, + tx_thread_system_return.S: + stack_ptr #8, time_slice #24, vfp_enable #144 */ + +typedef char +tx_port_assert_run_count_offset_is_4[ + (offsetof(TX_THREAD, tx_thread_run_count) == 4) ? 1 : -1]; + +typedef char +tx_port_assert_stack_ptr_offset_is_8[ + (offsetof(TX_THREAD, tx_thread_stack_ptr) == 8) ? 1 : -1]; + +typedef char +tx_port_assert_stack_start_offset_is_12[ + (offsetof(TX_THREAD, tx_thread_stack_start) == 12) ? 1 : -1]; + +typedef char +tx_port_assert_stack_end_offset_is_16[ + (offsetof(TX_THREAD, tx_thread_stack_end) == 16) ? 1 : -1]; + +typedef char +tx_port_assert_time_slice_offset_is_24[ + (offsetof(TX_THREAD, tx_thread_time_slice) == 24) ? 1 : -1]; + +typedef char +tx_port_assert_vfp_enable_offset_is_144[ + (offsetof(TX_THREAD, tx_thread_vfp_enable) == TX_PORT_VFP_ENABLE_OFFSET) + ? 1 : -1]; diff --git a/ports_arch/ARMv7-A/threadx/common/src/tx_port_offset_check.c b/ports_arch/ARMv7-A/threadx/common/src/tx_port_offset_check.c new file mode 100644 index 000000000..a6dc4e825 --- /dev/null +++ b/ports_arch/ARMv7-A/threadx/common/src/tx_port_offset_check.c @@ -0,0 +1,62 @@ +/*************************************************************************** + * Copyright (c) 2026-present Eclipse ThreadX contributors + * + * This program and the accompanying materials are made available under the + * terms of the MIT License which is available at + * https://opensource.org/licenses/MIT. + * + * SPDX-License-Identifier: MIT + **************************************************************************/ + +/* Verify TX_THREAD offsets used by the ARMv7-A assembly. + + The assembly uses fixed byte offsets to access TX_THREAD fields. + These checks prevent changes to the C structure layout from + silently breaking the assembly's assumptions. */ + +#include "tx_api.h" +#include + +/* Offset of the VFP enable flag as encoded in the ARMv7-A assembly. + Overridable only so that the assertion itself can be tested. */ + +#ifndef TX_PORT_VFP_ENABLE_OFFSET +#define TX_PORT_VFP_ENABLE_OFFSET 144 +#endif + +/* TX_THREAD offsets hard-coded by the ARMv7-A assembly: + + tx_thread_schedule.S: + run_count #4, stack_ptr #8, time_slice #24, vfp_enable #144 + + tx_thread_stack_build.S: + stack_ptr #8, stack_start #12, stack_end #16 + + tx_thread_context_restore.S, tx_thread_fiq_context_restore.S, + tx_thread_system_return.S: + stack_ptr #8, time_slice #24, vfp_enable #144 */ + +typedef char +tx_port_assert_run_count_offset_is_4[ + (offsetof(TX_THREAD, tx_thread_run_count) == 4) ? 1 : -1]; + +typedef char +tx_port_assert_stack_ptr_offset_is_8[ + (offsetof(TX_THREAD, tx_thread_stack_ptr) == 8) ? 1 : -1]; + +typedef char +tx_port_assert_stack_start_offset_is_12[ + (offsetof(TX_THREAD, tx_thread_stack_start) == 12) ? 1 : -1]; + +typedef char +tx_port_assert_stack_end_offset_is_16[ + (offsetof(TX_THREAD, tx_thread_stack_end) == 16) ? 1 : -1]; + +typedef char +tx_port_assert_time_slice_offset_is_24[ + (offsetof(TX_THREAD, tx_thread_time_slice) == 24) ? 1 : -1]; + +typedef char +tx_port_assert_vfp_enable_offset_is_144[ + (offsetof(TX_THREAD, tx_thread_vfp_enable) == TX_PORT_VFP_ENABLE_OFFSET) + ? 1 : -1]; diff --git a/ports_arch/ARMv7-A/threadx/ports/gnu/CMakeLists.txt b/ports_arch/ARMv7-A/threadx/ports/gnu/CMakeLists.txt index fc2158767..faf6dbdcd 100644 --- a/ports_arch/ARMv7-A/threadx/ports/gnu/CMakeLists.txt +++ b/ports_arch/ARMv7-A/threadx/ports/gnu/CMakeLists.txt @@ -24,6 +24,7 @@ target_sources(${PROJECT_NAME} ${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 + ${CMAKE_CURRENT_LIST_DIR}/src/tx_port_offset_check.c # {{END_TARGET_SOURCES}} )