diff options
Diffstat (limited to 'ports_arch/ARMv7-A')
6 files changed, 205 insertions, 4 deletions
diff --git a/ports_arch/ARMv7-A/threadx/common/inc/tx_port.h b/ports_arch/ARMv7-A/threadx/common/inc/tx_port.h index 15d6c3c5..798dc457 100644 --- a/ports_arch/ARMv7-A/threadx/common/inc/tx_port.h +++ b/ports_arch/ARMv7-A/threadx/common/inc/tx_port.h @@ -307,7 +307,7 @@ void tx_thread_vfp_disable(void); #ifdef TX_THREAD_INIT CHAR _tx_version_id[] = - "(c) 2024 Microsoft Corp. (c) 2026-present Eclipse ThreadX contributors. * ThreadX ARMv7-A Version 6.5.1.202602a *"; + "(c) 2024 Microsoft Corp. (c) 2026-present Eclipse ThreadX contributors. * ThreadX ARMv7-A Version 6.5.2.202603 *"; #else extern CHAR _tx_version_id[]; #endif diff --git a/ports_arch/ARMv7-A/threadx/common/src/tx_thread_system_return.S b/ports_arch/ARMv7-A/threadx/common/src/tx_thread_system_return.S index 1a17446b..7671bba2 100644 --- a/ports_arch/ARMv7-A/threadx/common/src/tx_thread_system_return.S +++ b/ports_arch/ARMv7-A/threadx/common/src/tx_thread_system_return.S @@ -9,6 +9,7 @@ * SPDX-License-Identifier: MIT **************************************************************************/ +// Portions of this file were generated with AI assistance. /**************************************************************************/ /**************************************************************************/ @@ -121,7 +122,9 @@ _tx_skip_solicited_vfp_save: LDR r2, =_tx_timer_time_slice // Pickup address of time slice LDR r1, [r2] // Pickup current time slice - /* Save current stack and switch to system stack. */ + /* Save the current stack pointer in the thread control block. The + scheduler runs on the banked SVC mode stack that the startup code + set up, so there is no stack switch to perform. */ STR sp, [r0, #8] // Save thread stack pointer diff --git a/ports_arch/ARMv7-A/threadx/ports/ac6/example_build/sample_threadx/sample_threadx.launch b/ports_arch/ARMv7-A/threadx/ports/ac6/example_build/sample_threadx/sample_threadx.launch index 0bc5b11b..df957414 100644 --- a/ports_arch/ARMv7-A/threadx/ports/ac6/example_build/sample_threadx/sample_threadx.launch +++ b/ports_arch/ARMv7-A/threadx/ports/ac6/example_build/sample_threadx/sample_threadx.launch @@ -124,7 +124,7 @@ <booleanAttribute key="VFS_ENABLED" value="true"/> <stringAttribute key="VFS_LOCAL_DIR" value="${workspace_loc}"/> <stringAttribute key="VFS_REMOTE_MOUNT" value="/writeable"/> - <stringAttribute key="breakpoints" value="<?xml version="1.0" encoding="UTF-8"?> <breakpoints order="ALPHA"> 	<breakpoint ignorecount="0" threadenabled="no" core_list="" continue="no" verboseBreakpoints="yes" kind="SOURCEPOSITION"> 		<master_location index="0" enabled="true" version="2" hostFile="C:\Users\nisohack\Documents\work\x-ware_libs\threadx_github\ports\cortex_a7\ac6\example_build\sample_threadx\tx_initialize_low_level.S" line="215"/> 		<location index="0" enabled="true" version="2" address="S:0x80000314" debugFile="C:/Users/nisohack/Documents/work/x-ware_libs/threadx_github/ports/cortex_a7/ac6/example_build/sample_threadx/tx_initialize_low_level.S" hostFile="C:\Users\nisohack\Documents\work\x-ware_libs\threadx_github\ports\cortex_a7\ac6\example_build\sample_threadx\tx_initialize_low_level.S" line="238"/> 	</breakpoint> </breakpoints> "/> + <stringAttribute key="breakpoints" value="<?xml version="1.0" encoding="UTF-8"?> <breakpoints order="ALPHA"> </breakpoints> "/> <listAttribute key="com.arm.debug.views.common.AddressTracker.debugger.view.DisassemblyView.addresses"> <listEntry value="<Next Instruction>"/> </listAttribute> diff --git a/ports_arch/ARMv7-A/threadx/ports/gnu/CMakeLists.txt b/ports_arch/ARMv7-A/threadx/ports/gnu/CMakeLists.txt new file mode 100644 index 00000000..fc215876 --- /dev/null +++ b/ports_arch/ARMv7-A/threadx/ports/gnu/CMakeLists.txt @@ -0,0 +1,34 @@ +# Copyright (c) 2026 Eclipse ThreadX contributors +# SPDX-License-Identifier: MIT +# Portions of this file were generated with AI assistance. +# +# ThreadX port sources for the ARMv7-A cores, GNU tools. +# Copied into every ARMv7-A gnu port by update.sh, so edit it here. + +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_fiq_context_restore.S + ${CMAKE_CURRENT_LIST_DIR}/src/tx_thread_fiq_context_save.S + ${CMAKE_CURRENT_LIST_DIR}/src/tx_thread_fiq_nesting_end.S + ${CMAKE_CURRENT_LIST_DIR}/src/tx_thread_fiq_nesting_start.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_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} + SYSTEM + PUBLIC + ${CMAKE_CURRENT_LIST_DIR}/inc +) diff --git a/ports_arch/ARMv7-A/threadx/ports/iar/example_build/tx.ewp b/ports_arch/ARMv7-A/threadx/ports/iar/example_build/tx.ewp index ef9fb474..72f03a7a 100644 --- a/ports_arch/ARMv7-A/threadx/ports/iar/example_build/tx.ewp +++ b/ports_arch/ARMv7-A/threadx/ports/iar/example_build/tx.ewp @@ -1047,7 +1047,7 @@ </option> <option> <name>IarchiveOutput</name> - <state>C:\release\threadx\Debug\Exe\tx.a</state> + <state>###Unitialized###</state> </option> </data> </settings> diff --git a/ports_arch/ARMv7-A/update.sh b/ports_arch/ARMv7-A/update.sh new file mode 100755 index 00000000..6272a59a --- /dev/null +++ b/ports_arch/ARMv7-A/update.sh @@ -0,0 +1,164 @@ +#!/bin/bash +############################################################################## +# Copyright (C) 2026 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. +# +# AI Disclosure: This file was largely AI-generated by Claude Code (Opus 5). +# The AI-generated portions may be considered public domain (CC0-1.0) +# and not subject to the project's licence. The human contributor has +# reviewed and verified that the code is correct. +# +# SPDX-License-Identifier: MIT and CC0-1.0 +############################################################################## + +# Update the ARMv7-A ports from the generic ARMv7-A port, generating ports and +# examples from the common files. This is a port of update.ps1 beside it, which +# needs PowerShell and so could only be run on Windows. The two are kept +# equivalent: same cores, same compilers, same copy sets and the same patches. +# +# To update the ThreadX ports for the source tree: +# ./update.sh --port-sets tx --copy-common-files --copy-port-files \ +# --copy-example --patch-files +# +# To update the ThreadX ports for the test tree: +# ./update.sh --port-sets tx --copy-common-files --copy-port-files \ +# --copy-example --copy-validation-test --copy-regression-test \ +# --patch-files +# +# --copy-example, --copy-validation-test and --copy-regression-test are +# accepted and ignored, exactly as in update.ps1, where they are declared as +# parameters but never consulted. They are kept so that both scripts take the +# same command line. + +set -eu + +cd "$(dirname "$(realpath "$0")")" + +cores="cortex_a5 cortex_a7 cortex_a8 cortex_a9 cortex_a12 cortex_a15 cortex_a17" +compilers="ac6 gnu" + +port_sets="" +copy_common_files=0 +copy_port_files=0 +patch_files=0 + +usage() { + sed -n '22,35p' "$0" + exit "${1:-1}" +} + +while [ "$#" -gt 0 ]; do + case "$1" in + --port-sets) + [ "$#" -ge 2 ] || { echo "Error: --port-sets needs a value" >&2; exit 1; } + port_sets="$(printf '%s' "$2" | tr ',' ' ')" + shift 2 + ;; + --copy-common-files) copy_common_files=1; shift ;; + --copy-port-files) copy_port_files=1; shift ;; + --patch-files) patch_files=1; shift ;; + # Accepted and ignored, as in update.ps1. + --copy-example|--copy-validation-test|--copy-regression-test) shift ;; + -h|--help) usage 0 ;; + *) echo "Error: unknown option '$1'" >&2; usage ;; + esac +done + +if [ -z "${port_sets}" ]; then + echo "Error: --port-sets is required" >&2 + usage +fi + +for port_set in ${port_sets}; do + case "${port_set}" in + tx|tx_smp|txm|txm_smp) ;; + *) echo "Error: invalid port set '${port_set}'" >&2; exit 1 ;; + esac +done + +echo "Update the ARMv7-A ports" + +# Copy the contents of a directory over a destination, creating what is missing +# and overwriting what is not. This mirrors Copy-Item -Recurse -Force, which +# merges into the destination rather than replacing it. +copy_files() { + source_dir="$1" + destination_directory="$2" + + if [ -d "${source_dir}" ]; then + cp -Rf "${source_dir}/." "${destination_directory}/" + fi +} + +# Replace every occurrence of a literal string in a file, leaving the file +# alone when it does not exist. Only the files named in the patch list below +# are ever touched. +patch_file() { + path="$1" + original="$2" + substitute="$3" + + [ -f "${path}" ] || return 0 + + original_escaped="$(printf '%s' "${original}" | sed -e 's/[][\.*^$/&]/\\&/g')" + substitute_escaped="$(printf '%s' "${substitute}" | sed -e 's/[\/&]/\\&/g')" + sed -i "s/${original_escaped}/${substitute_escaped}/g" "${path}" +} + +for port_set in ${port_sets}; do + for core in ${cores}; do + case "${port_set}" in + tx) core_directory="../../ports/${core}" ;; + tx_smp) core_directory="../../ports_smp/${core}_smp" ;; + txm) core_directory="../../ports_module/${core}" ;; + txm_smp) core_directory="../../ports_module_smp/${core}_smp" ;; + esac + + core_short="${core#cortex_}" + core_short_lower="$(printf '%s' "${core_short}" | tr '[:upper:]' '[:lower:]')" + core_short_upper="$(printf '%s' "${core_short}" | tr '[:lower:]' '[:upper:]')" + + for compiler in ${compilers}; do + destination_directory="${core_directory}/${compiler}" + mkdir -p "${destination_directory}" + + if [ "${copy_common_files}" -eq 1 ]; then + copy_files "threadx/common" "${destination_directory}" + fi + + if [ "${copy_port_files}" -eq 1 ]; then + copy_files "threadx/ports/${compiler}" "${destination_directory}" + fi + + if [ "${port_set}" = "tx_smp" ]; then + if [ "${copy_common_files}" -eq 1 ]; then + copy_files "threadx_smp/common" "${destination_directory}" + fi + if [ "${copy_port_files}" -eq 1 ]; then + copy_files "threadx_smp/ports/${compiler}" "${destination_directory}" + fi + fi + + if [ "${patch_files}" -eq 1 ]; then + sample_cproject="${destination_directory}/example_build/sample_threadx/.cproject" + patch_file "${sample_cproject}" 'value="cortex-a7"' "value=\"cortex-${core_short_lower}\"" + patch_file "${sample_cproject}" 'Cortex-A7.NoFPU' "Cortex-${core_short_upper}.NoFPU" + + tx_cproject="${destination_directory}/example_build/tx/.cproject" + patch_file "${tx_cproject}" 'value="cortex-a7"' "value=\"cortex-${core_short_lower}\"" + patch_file "${tx_cproject}" 'Cortex-A7.NoFPU' "Cortex-${core_short_upper}.NoFPU" + + launch="${destination_directory}/example_build/sample_threadx/sample_threadx.launch" + patch_file "${launch}" 'Debug Cortex-A7' "Debug Cortex-${core_short_upper}" + patch_file "${launch}" 'VE_Cortex_A7x1' "VE_Cortex_${core_short_upper}x1" + patch_file "${launch}" 've_cortex_a7x1' "ve_cortex_${core_short_lower}x1" + patch_file "${launch}" 'FVP_VE_Cortex-A7x1' "FVP_VE_Cortex-${core_short_upper}x1" + fi + done + done +done + +echo "Done." |
