fix(fa): preserve the USB disk receiver and match FAAttach #1029

Merged
coah80 merged 1 commits from agent/bittle/fa-attach-receiver-review into main 2026-10-03 03:14:04 +00:00
coah80 commented 2026-10-03 03:13:01 +00:00 (Migrated from github.com)

Exact reconstruction and real receiver fix

FAAttach's local USB-media declaration omitted FADisk*. The original wrapper tail-branches to an implementation that consumes r3 as the disk, but the prior compiled caller reused r3 for the global partition-table base. Explicitly pass disk and forward it through the wrapper. Also represent the attach request as the NULL-terminated FADrvTbl pointer array consumed by pf2_attach, rather than a pointer/count record.

Independent parent verification

  • FAAttach: 99.36% → 100%, 125/125 instructions, ctxdiff zero; 500/500 code and 240/240 data
  • Media wrapper unit remains 2/2 exact, 20/20 code and 8/8 data; complete wrapper object byte-identical
  • All 1027 reports checked with zero regressions; allocated-object comparison changes only FAAttach .text, preserving its 500-byte extent and all relocation identities/non-text data
  • Parent reran 279 source/original instruction cases covering every FAAttach and MSC-helper instruction, all 26 drive letters, USB slot/miss cases, flags, errors, NAND copy/size and callback status reload
  • Regression case demonstrates the old caller misses USB insertion notification by passing the partition-array base; corrected code passes the disk and preserves notification callback state
  • Raw DOL scan confirms exactly two direct wrapper callers: FAAttach and pfstub_entry; the latter already passes message->disk. Wrapper is the original single non-linking branch
  • Pools identical; literal advisory analyzes all three functions but has zero string arguments, so no string-behavior coverage claim
  • Full 43U all_source/report/progress/DOL and worktree/diff checks pass

No hardware execution claim. No metadata, compiler, storage padding, new assembly or linking-flag change. Deeper pfstub adapter declarations are outside this focused correction and are not claimed globally type-consistent.

Base: bf8ebfa353
Tested tree: 569c222fa3
DOL SHA1: 26116613f624061ba99c8d1a299aaa6efa85670d

No merge performed or requested by this author.

Note

Preserve USB disk receiver in FAAttach by replacing request wrapper with FADrvTbl array

  • Removes the FA_ATTACH_REQUEST wrapper type. FAAttach now takes a null-terminated two-entry FADrvTbl pointer array instead of a request object with a driver-table pointer and count (see FAAttach.c).
  • Status access now uses the first array entry, and the MSC media-insertion call passes the opened FADisk.
  • Updates pfd_mscdrv_is_media_insert and uhf_msc_is_media_insert to accept an FADisk pointer and forward it to the lower-level query (see msc_drv.c).
  • Risk: all callers of FAAttach and the MSC media-insertion declarations must use the new FADrvTbl array and FADisk pointer signatures.

Macroscope summarized ff555eb.

## Exact reconstruction and real receiver fix FAAttach's local USB-media declaration omitted FADisk*. The original wrapper tail-branches to an implementation that consumes r3 as the disk, but the prior compiled caller reused r3 for the global partition-table base. Explicitly pass disk and forward it through the wrapper. Also represent the attach request as the NULL-terminated FADrvTbl pointer array consumed by pf2_attach, rather than a pointer/count record. ## Independent parent verification - FAAttach: 99.36% → 100%, 125/125 instructions, ctxdiff zero; 500/500 code and 240/240 data - Media wrapper unit remains 2/2 exact, 20/20 code and 8/8 data; complete wrapper object byte-identical - All 1027 reports checked with zero regressions; allocated-object comparison changes only FAAttach .text, preserving its 500-byte extent and all relocation identities/non-text data - Parent reran 279 source/original instruction cases covering every FAAttach and MSC-helper instruction, all 26 drive letters, USB slot/miss cases, flags, errors, NAND copy/size and callback status reload - Regression case demonstrates the old caller misses USB insertion notification by passing the partition-array base; corrected code passes the disk and preserves notification callback state - Raw DOL scan confirms exactly two direct wrapper callers: FAAttach and pfstub_entry; the latter already passes message->disk. Wrapper is the original single non-linking branch - Pools identical; literal advisory analyzes all three functions but has zero string arguments, so no string-behavior coverage claim - Full 43U all_source/report/progress/DOL and worktree/diff checks pass No hardware execution claim. No metadata, compiler, storage padding, new assembly or linking-flag change. Deeper pfstub adapter declarations are outside this focused correction and are not claimed globally type-consistent. Base: bf8ebfa35379f7243a9ae0de73081573664c8a32 Tested tree: 569c222fa369c5b857d328ffa9852e23ade68274 DOL SHA1: 26116613f624061ba99c8d1a299aaa6efa85670d No merge performed or requested by this author. <!-- Macroscope's pull request summary starts here --> <!-- Macroscope will only edit the content between these invisible markers, and the markers themselves will not be visible in the GitHub rendered markdown. --> <!-- If you delete either of the start / end markers from your PR's description, Macroscope will append its summary at the bottom of the description. --> > [!NOTE] > ### Preserve USB disk receiver in `FAAttach` by replacing request wrapper with `FADrvTbl` array > - Removes the `FA_ATTACH_REQUEST` wrapper type. `FAAttach` now takes a null-terminated two-entry `FADrvTbl` pointer array instead of a request object with a driver-table pointer and count (see [FAAttach.c](https://github.com/coah80/wii-ipl/pull/1029/files#diff-ffc7e55c72f2148ce926313ca12f383252e07b3f54544345e3e856e04732e192)). > - Status access now uses the first array entry, and the MSC media-insertion call passes the opened `FADisk`. > - Updates `pfd_mscdrv_is_media_insert` and `uhf_msc_is_media_insert` to accept an `FADisk` pointer and forward it to the lower-level query (see [msc_drv.c](https://github.com/coah80/wii-ipl/pull/1029/files#diff-d0b3121c8c43e9b9d92da1dbf2c8a07f085bdc84a484efffb4e57ab9ef57f4df)). > - Risk: all callers of `FAAttach` and the MSC media-insertion declarations must use the new `FADrvTbl` array and `FADisk` pointer signatures. > > <!-- Macroscope's review summary starts here --> > > <sup><a href="https://app.macroscope.com">Macroscope</a> summarized ff555eb.</sup> > <!-- Macroscope's review summary ends here --> > <!-- Macroscope's pull request summary ends here -->
coah80 commented 2026-10-03 03:14:02 +00:00 (Migrated from github.com)

Reviewed and merged: rebased on main, full build ok, DOL sha1 26116613f624061ba99c8d1a299aaa6efa85670d, 0 regressions, 0 forbidden patterns.

Reviewed and merged: rebased on main, full build ok, DOL sha1 26116613f624061ba99c8d1a299aaa6efa85670d, 0 regressions, 0 forbidden patterns.
Sign in to join this conversation.