Fixed the missing immediate prefix on MOV in Cortex-M schedulers - #693
Merged
Conversation
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>
Open
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #461
_tx_thread_schedulewritesMOV r0, 0instead ofMOV r0, #0on the BASEPRI-masking path. UAL requires the#prefix on an immediate operand, so this is invalid syntax even though it is widely tolerated.GNU
asand 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 GNUasand the LLVM-based ARM assembler. The generated code and runtime behaviour are unchanged; this is purely a source-correctness fix.