netdev: devicetree.resource stubs list every scratch register the call may destroy (#70, B of 3) - #72
Merged
Merged
Conversation
…l may destroy The eight devicetree.resource stubs in netdev_dtree.c passed a0 (and a1 for dt_getchild and dt_findprop) as asm inputs only. The library ABI lets every LVO destroy d0/d1/a0/a1, but GCC was told those registers survived the jsr. All eight were LATENT at main 7108650, in both images that link the file (anxgenet.device and InstallNetProbe). dt_closekey, dt_findprop, dt_proplen and dt_propvalue stay out of line and return straight after the jsr. At the inlined dt_openkey / dt_getchild / dt_getparent / dt_keyname sites, the register is rewritten or a call comes first (the per-site addresses are in #70). Each argument register is now a "+r" operand. The code is unchanged: aligned against the pre-change build, the only difference in either image is the "$VER ... 7108650-dirty" stamp of the uncommitted build. The #70 scanner no longer flags netdev_dtree.c. Part of #70 (shipped sites, PR B of 3). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
tinic
added a commit
that referenced
this pull request
Sep 26, 2026
…call may destroy (#73) installnetprobe.c's three card.resource stubs (OwnCard, ReleaseCard, CopyTuple) passed their argument registers as asm inputs only. The library ABI lets every LVO destroy d0/d1/a0/a1. This was REAL at main 66e0bf5. probe_own_card loads a1 = &handle (0x968) for OwnCard (jsr -6 at 0x96e). On the owned path, the first CopyTuple(0x20) (jsr -72 at 0x98e) was issued without reloading a1, so it used whatever OwnCard left there. After the change, 0x986 is `lea 0x18,a1` before the CopyTuple, which reloads the handle. The other two stubs were latent. Each argument register is now a "+r" operand; unused scratch registers remain clobbers. The #70 scanner no longer flags installnetprobe.c. With #71 and #72 this closes the 16 shipped sites in #70. Part of #70 (shipped sites, PR C of 3). Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.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.
Part of #70, shipped-site fixes, PR B of 3:
src/netdev/netdev_dtree.c→ anxgenet.device + InstallNetProbe. Independent of A (#71) and C.The eight devicetree.resource stubs passed a0 (and a1 for dt_getchild/dt_findprop) as asm inputs only. All eight were LATENT at main 7108650 in both images; the per-site evidence is in #70.
Change: each argument register becomes a
"+r"operand, with a comment at the stub block. No CHANGELOG entry: nothing user-visible changes.No code change results:
$VERcommit stamp (file 0x5ff6-0x6011, stamp at 0x6000)$VERcommit stamp (file 0xc64-0xc7f, stamp at 0xc6e)The out-of-line helpers' windows are identical (
movea.l 8(sp),a0; movea.l 0xc,a6; jsr -N(a6); movea.l (sp)+,a6; rts).Proof:
tools/ci.sh hostin CI conditions: rc 0, 464/464.🤖 Generated with Claude Code