Skip to content

netdev: devicetree.resource stubs list every scratch register the call may destroy (#70, B of 3) - #72

Merged
tinic merged 1 commit into
mainfrom
fix/lvo-clobber-dtree
Sep 26, 2026
Merged

tinic merged 1 commit into
mainfrom
fix/lvo-clobber-dtree

Conversation

@tinic

@tinic tinic commented Sep 26, 2026

Copy link
Copy Markdown
Owner

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:

image before (7108650) after bytes differing
anxgenet.device c4031fd5 50fb1b3e 7, all inside the $VER commit stamp (file 0x5ff6-0x6011, stamp at 0x6000)
InstallNetProbe 2e8882fb 3115b100 7, all inside the $VER commit 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:

🤖 Generated with Claude Code

…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
tinic merged commit c6dcd50 into main Sep 26, 2026
42 checks passed
@tinic
tinic deleted the fix/lvo-clobber-dtree branch September 26, 2026 02:35
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>
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