Replaced the GNU-only dsb 0xF and isb 0xF barrier operands with the UAL sy form, so tx_port.h now assembles under IAR as well as GCC and armclang - #729
Open
fdesbiens wants to merge 1 commit into
Conversation
…AL sy form, so tx_port.h now assembles under IAR as well as GCC and armclang The inline _tx_thread_system_return_inline implementation in the Cortex-M tx_port.h headers issued its data and instruction barriers as "dsb 0xF" and "isb 0xF". A bare hexadecimal operand is a GNU assembler extension. IAR's inline assembler only accepts the architectural option names, so it rejected the line with "operand syntax error" and the header could not be included at all. The block is guarded for GCC, armclang and IAR together, so every IAR user of an affected port hit this the moment inlining was left enabled. Replaced both operands with "sy", the Arm UAL name for the full system domain and the exact value 0xF encodes. The generated instruction is unchanged; only the spelling of the operand differs. "sy" is the canonical form in the Arm Architecture Reference Manual and is accepted by GNU as, armclang and IAR alike, which is why every reporter converged on it independently as a local workaround. The change was applied to the two ports_arch master headers and to all thirty-two generated or hand-maintained copies under ports, covering the Cortex-M0, M23, M3, M33, M4, M52, M55, M7 and M85 families across the ac5, ac6, gnu, iar and keil toolchains. scripts/check_ports.sh probed for the literal strings "dsb 0xF" and "isb 0xF" when reporting toolchain divergence within the hand-maintained M0 and M23 families. Updated the probes to the new spelling so the check keeps working. Verified that arm-none-eabi-gcc assembles the new form for every Cortex-M target the ports cover, and confirmed the regenerated ports match their masters. Assisted-by: Copilot (Opus 5) <noreply@github.com>
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 #551.
Problem
The inline
_tx_thread_system_return_inline()implementation in the Cortex-Mtx_port.hheaders issues its data and instruction barriers asdsb 0xFandisb 0xF. A bare hexadecimal barrier operand is a GNU assembler extension. IAR's inline assembler accepts only the architectural option names, so it rejects the line withoperand syntax errorand the header cannot be included at all.The block is guarded for GCC, armclang and IAR together, so every IAR user of an affected port hits this as soon as inlining is left enabled. Four people have reported it independently on Cortex-M33 and Cortex-M7 with IAR EWARM 9.50 and 9.70.
Fix
Both operands become
sy, the Arm UAL name for the full system domain and the exact value that0xFencodes. The generated instruction is unchanged; only the spelling of the operand differs.syis the canonical form in the Arm Architecture Reference Manual and is accepted by GNU as, armclang and IAR alike, which is why every reporter converged on it independently as a local workaround.Scope
The change is applied to the two
ports_archmaster headers and to all thirty-two generated or hand-maintained copies underports, covering the Cortex-M0, M23, M3, M33, M4, M52, M55, M7 and M85 families across the ac5, ac6, gnu, iar and keil toolchains.scripts/check_ports.shprobed for the literal strings"dsb 0xF"and"isb 0xF"when reporting toolchain divergence within the hand-maintained M0 and M23 families. Its probes are updated to the new spelling so the check keeps working.Validation
scripts/check_ports.shpasses, and the copy scripts reproduce every generated port byte for byte from itsports_archmaster.arm-none-eabi-gcc -O2compiles a translation unit that includestx_api.hand calls_tx_thread_system_return_inline()for every patched port and target. The three headers that do not compile here (cortex_m0/iar,cortex_m23/ac6,cortex_m23/iar) fail identically ondevbecause they include toolchain intrinsic headers that GCC does not ship.dsb syandisb sy.