Skip to content

Fixed the missing immediate prefix on MOV in Cortex-M schedulers - #693

Merged
fdesbiens merged 1 commit into
eclipse-threadx:devfrom
fdesbiens:fix/issue-461
Sep 3, 2026
Merged

Fixed the missing immediate prefix on MOV in Cortex-M schedulers#693
fdesbiens merged 1 commit into
eclipse-threadx:devfrom
fdesbiens:fix/issue-461

Conversation

@fdesbiens

Copy link
Copy Markdown
Contributor

Fixes #461

_tx_thread_schedule writes MOV r0, 0 instead of MOV r0, #0 on the BASEPRI-masking path. UAL requires the # prefix on an immediate operand, so this is invalid syntax even though it is widely tolerated.

GNU as and the LLVM-based assemblers accept the unprefixed form and emit the intended encoding, which is why the problem went unnoticed. Stricter assemblers reject it outright, and the affected ports cannot be built with those toolchains. This matches what @42Bastian reported and what @billlamiework confirmed on the issue.

The GNU and AC6 sources had already been corrected at some point; the IAR and AC5 sources had not. This brings them into line.

Scope: 31 occurrences across 22 files — the Cortex-M3, M4, M7, M33, M52, M55 and M85 ports, their module manager counterparts, and the shared ARMv7-M and ARMv8-M architecture sources.

Verification: both spellings assemble to the identical Thumb-2 encoding (f04f 0000), confirmed with GNU as and the LLVM-based ARM assembler. The generated code and runtime behaviour are unchanged; this is purely a source-correctness fix.

The BASEPRI-masking path in tx_thread_schedule wrote "MOV r0, 0" rather
than "MOV r0, #0". UAL requires the "#" prefix on an immediate operand.
GNU as and the LLVM-based assemblers accept the unprefixed form and emit
the intended encoding, but stricter assemblers reject it outright, so the
affected ports could not be built with those toolchains.

The GNU and AC6 sources had already been corrected; this brings the IAR
and AC5 sources into line. Verified that both spellings assemble to the
same Thumb-2 encoding (f04f 0000), so this is a source-correctness fix
with no change in generated code or runtime behaviour.

Covers 31 occurrences across the Cortex-M3, M4, M7, M33, M52, M55 and M85
ports, their module manager counterparts, and the shared ARMv7-M and
ARMv8-M architecture sources.

Fixes eclipse-threadx#461

Assisted-by: Copilot (Opus 5) <noreply@github.com>
@fdesbiens fdesbiens mentioned this pull request Sep 3, 2026
@fdesbiens
fdesbiens merged commit c469a77 into eclipse-threadx:dev Sep 3, 2026
12 checks passed
@fdesbiens
fdesbiens deleted the fix/issue-461 branch September 3, 2026 15:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant