Skip to content

Fix VFP build failure in Cortex-A tx_thread_schedule.S#493

Merged
fdesbiens merged 2 commits intoeclipse-threadx:devfrom
mehmetteren:dev
Mar 2, 2026
Merged

Fix VFP build failure in Cortex-A tx_thread_schedule.S#493
fdesbiens merged 2 commits intoeclipse-threadx:devfrom
mehmetteren:dev

Conversation

@mehmetteren
Copy link
Contributor

Description

Fixes undefined symbol errors (IRQ_MASK / FIQ_MASK) when building Cortex-A ports (GNU/AC6) with TX_ENABLE_VFP_SUPPORT.

These masks (0x80/0x40) are required for the VFP context restore logic but were missing from tx_thread_schedule.S.

Validation

Hardware: Xilinx Zynq-7000 (ZC702)
Toolchain: GNU Arm Embedded
Result: Confirmed successful compilation and context switching with -DTX_ENABLE_VFP_SUPPORT.

PR checklist

  • Updated function header with a short description and version number
  • Added test case for bug fix or new feature
  • Validated on real hardware

When TX_ENABLE_VFP_SUPPORT is defined, the build fails due to missing
IRQ_MASK and FIQ_MASK symbols in the restore logic.

This adds the local definitions (0x80 and 0x40) to tx_thread_schedule.S
to match tx_thread_interrupt_restore.S, enabling successful compilation
on GNU and AC6 Cortex-A ports.
Copilot AI review requested due to automatic review settings January 6, 2026 16:10
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes build failures in Cortex-A ports (A5, A7, A8, A9, A12, A15, A17) when compiling with VFP (Vector Floating Point) support enabled. The issue was that IRQ_MASK and FIQ_MASK constants were referenced in VFP-related interrupt restoration code but were not defined in the tx_thread_schedule.S files.

Key Changes:

  • Added IRQ_MASK = 0x080 definition conditionally when TX_ENABLE_VFP_SUPPORT is defined
  • Added FIQ_MASK = 0x040 definition conditionally when TX_ENABLE_FIQ_SUPPORT is defined

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated no comments.

Show a summary per file
File Description
ports/cortex_a5/gnu/src/tx_thread_schedule.S Added IRQ_MASK and FIQ_MASK constant definitions for Cortex-A5 GNU toolchain
ports/cortex_a5/ac6/src/tx_thread_schedule.S Added IRQ_MASK and FIQ_MASK constant definitions for Cortex-A5 AC6 toolchain
ports/cortex_a7/gnu/src/tx_thread_schedule.S Added IRQ_MASK and FIQ_MASK constant definitions for Cortex-A7 GNU toolchain
ports/cortex_a7/ac6/src/tx_thread_schedule.S Added IRQ_MASK and FIQ_MASK constant definitions for Cortex-A7 AC6 toolchain
ports/cortex_a8/gnu/src/tx_thread_schedule.S Added IRQ_MASK and FIQ_MASK constant definitions for Cortex-A8 GNU toolchain
ports/cortex_a8/ac6/src/tx_thread_schedule.S Added IRQ_MASK and FIQ_MASK constant definitions for Cortex-A8 AC6 toolchain
ports/cortex_a9/gnu/src/tx_thread_schedule.S Added IRQ_MASK and FIQ_MASK constant definitions for Cortex-A9 GNU toolchain
ports/cortex_a9/ac6/src/tx_thread_schedule.S Added IRQ_MASK and FIQ_MASK constant definitions for Cortex-A9 AC6 toolchain
ports/cortex_a12/gnu/src/tx_thread_schedule.S Added IRQ_MASK and FIQ_MASK constant definitions for Cortex-A12 GNU toolchain
ports/cortex_a12/ac6/src/tx_thread_schedule.S Added IRQ_MASK and FIQ_MASK constant definitions for Cortex-A12 AC6 toolchain
ports/cortex_a15/gnu/src/tx_thread_schedule.S Added IRQ_MASK and FIQ_MASK constant definitions for Cortex-A15 GNU toolchain
ports/cortex_a15/ac6/src/tx_thread_schedule.S Added IRQ_MASK and FIQ_MASK constant definitions for Cortex-A15 AC6 toolchain
ports/cortex_a17/gnu/src/tx_thread_schedule.S Added IRQ_MASK and FIQ_MASK constant definitions for Cortex-A17 GNU toolchain
ports/cortex_a17/ac6/src/tx_thread_schedule.S Added IRQ_MASK and FIQ_MASK constant definitions for Cortex-A17 AC6 toolchain

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@fdesbiens
Copy link
Contributor

Thank you for this contribution, @mehmetteren. I will ask a team member to review it.

@fdesbiens
Copy link
Contributor

Hi @mehmetteren.

Thank you again for this contribution. I propose a few changes to your original PR.

  1. Scope Expansion: Added the missing IRQ_MASK and FIQ_MASK definitions to the common architecture source file:
    ports_arch/ARMv7-A/threadx/common/src/tx_thread_schedule.S.

  2. Copyright Updates: Updated the copyright headers in all 15 modified files (14 ports + 1 common) to include the
    "2026-present Eclipse ThreadX contributors" line.

  3. Syntax Consistency: Converted the IRQ_MASK and FIQ_MASK definitions from assignment syntax (=) to the C
    preprocessor #define directive, ensuring consistency with existing constants like IRQ_MODE and SVC_MODE in the
    same files.

  4. Formatting Consistency: Standardised the hexadecimal values to 2-digit format (0x80 and 0x40) to match the
    surrounding code style.

If you are fine with those, I will be happy to merge this to the dev branch right away. This would ship with our Q1 2026 release in a few days. Let me know what you think!

@fdesbiens fdesbiens self-assigned this Mar 2, 2026
@fdesbiens fdesbiens removed the request for review from cypherbridge March 2, 2026 13:28
@mehmetteren
Copy link
Contributor Author

LGTM, thanks for the changes @fdesbiens !

@fdesbiens fdesbiens merged commit 0c92f48 into eclipse-threadx:dev Mar 2, 2026
1 check passed
@github-project-automation github-project-automation bot moved this from In review to Done in ThreadX Roadmap Mar 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants