feat(libSceSystemService): call libSceUsbStorage from the USB storage aliases #11051

Merged
simnJS merged 1 commit from upstream-pr/11051 into main 2026-10-28 07:06:40 +00:00
simnJS commented 2026-10-25 15:24:03 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by simnJS on 2026-10-25T15:24:03Z.


What

  • The sceSystemServiceUsbStorage* exports are direct jumps into the USB storage module (the "USB storage aliases" entry of docs/dev/debt/libSceSystemService.md). 16 of the 17 now call the matching libSceUsbStorage export instead of throwing. libSceSystemService links libSceUsbStorage, and loadexec_arguments stages it with the other libraries.
  • sceSystemServiceUsbStorageRequestMapWSB keeps the marker. Its declaration takes RequestMap's 64-bit volume size and mount-id output, while libSceUsbStorage declares shadPS4's 32-bit fourth argument and status output, and which one the module uses is unconfirmed. The debt entry records it.
  • Rebased onto main now that #11046 is merged, so the diff is this PR's single commit. The test turns on APS5_USB_STORAGE_PASSTHROUGH, which #11046 made opt-in, before its device case.

Tested

  • Windows 11 Pro 26200, WinLibs GCC 15.2.0 r7, Release, on this head:
    • guest_system_service_usb_storage and guest_usb_storage pass, 5 runs in a row.
    • Without a device, the aliases answer like their libSceUsbStorage exports: nothing is listed, described, mapped or scanned, and the callback aliases register, unregister and refuse null arguments.
    • With an injected volume and APS5_USB_STORAGE_PASSTHROUGH set, the aliases list, describe, map, unmap and scan it, and share the service state with the direct exports. With the switch unset, that case fails with the alias initialized the USB storage service.
    • The 9 guest_system_service* and loadexec_arguments tests pass, including loadexec_arguments with the new dependency staged.
    • tools/check_conventions.py --base origin/main passes.
  • Linux (Ubuntu 24.04, GCC 13.3, BUILD_TESTING=ON), on an earlier head before the rebase: the new test and the 20 tests matching system_service|system_exit|loadexec_arguments|usb_storage passed. Not rerun on this head.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: #11046 (merged)
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5006019783 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11051). Originally posted by [simnJS](https://github.com/simnJS) on 2026-10-25T15:24:03Z. --- ### What - The `sceSystemServiceUsbStorage*` exports are direct jumps into the USB storage module (the "USB storage aliases" entry of `docs/dev/debt/libSceSystemService.md`). 16 of the 17 now call the matching `libSceUsbStorage` export instead of throwing. libSceSystemService links libSceUsbStorage, and `loadexec_arguments` stages it with the other libraries. - `sceSystemServiceUsbStorageRequestMapWSB` keeps the marker. Its declaration takes `RequestMap`'s 64-bit volume size and mount-id output, while libSceUsbStorage declares shadPS4's 32-bit fourth argument and status output, and which one the module uses is unconfirmed. The debt entry records it. - Rebased onto `main` now that #11046 is merged, so the diff is this PR's single commit. The test turns on `APS5_USB_STORAGE_PASSTHROUGH`, which #11046 made opt-in, before its device case. ### Tested <!-- OS, title or homebrew, what was checked. "Not tested" is a valid answer. A performance change: the summary lines of main and of this PR from the same machine and scene, with the traces attached, captured as the Performance report issue form describes. --> - Windows 11 Pro 26200, WinLibs GCC 15.2.0 r7, Release, on this head: - `guest_system_service_usb_storage` and `guest_usb_storage` pass, 5 runs in a row. - Without a device, the aliases answer like their libSceUsbStorage exports: nothing is listed, described, mapped or scanned, and the callback aliases register, unregister and refuse null arguments. - With an injected volume and `APS5_USB_STORAGE_PASSTHROUGH` set, the aliases list, describe, map, unmap and scan it, and share the service state with the direct exports. With the switch unset, that case fails with `the alias initialized the USB storage service`. - The 9 `guest_system_service*` and `loadexec_arguments` tests pass, including `loadexec_arguments` with the new dependency staged. - `tools/check_conventions.py --base origin/main` passes. - Linux (Ubuntu 24.04, GCC 13.3, `BUILD_TESTING=ON`), on an earlier head before the rebase: the new test and the 20 tests matching `system_service|system_exit|loadexec_arguments|usb_storage` passed. Not rerun on this head. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: #11046 (merged) - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes
MarcZX10 commented 2026-10-25 15:47:20 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-25T15:47:20Z.

Review: DISMISSED


I checked the newly reported overlap against exact current heads: #11051 1d38eee83a2342e5aa49cb0aa0f6ec16a59c604f and #9977 502e157fa01fda35aad971738468300fcac9043f. A three-way merge has a content conflict only in core/libs/tests/GuestSystemService.cpp, in the extern-declaration block: #9977 adds the ShellCoreUtilActivate declarations while this PR's stack removes/replaces that block. PendingExports.cpp and docs/dev/debt/libSceSystemService.md merge cleanly, and I found no same-export overlap between the USB-storage aliases and #9977's activation behavior.

The test-file conflict looks mechanically resolvable by preserving both sets of declarations, but CONTRIBUTING.md requires authors to agree on the order when the overlap workflow finds shared lines and to record it with Depends on. Please coordinate with #9977's author, record whichever order you agree on, and refresh/rebase the combined result. I have not approved this PR pending that repository-required composition check.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5643960460 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11051#pullrequestreview-5643960460). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-25T15:47:20Z. **Review:** DISMISSED --- I checked the newly reported overlap against exact current heads: #11051 1d38eee83a2342e5aa49cb0aa0f6ec16a59c604f and #9977 502e157fa01fda35aad971738468300fcac9043f. A three-way merge has a content conflict only in core/libs/tests/GuestSystemService.cpp, in the extern-declaration block: #9977 adds the ShellCoreUtilActivate declarations while this PR's stack removes/replaces that block. PendingExports.cpp and docs/dev/debt/libSceSystemService.md merge cleanly, and I found no same-export overlap between the USB-storage aliases and #9977's activation behavior. The test-file conflict looks mechanically resolvable by preserving both sets of declarations, but CONTRIBUTING.md requires authors to agree on the order when the overlap workflow finds shared lines and to record it with Depends on. Please coordinate with #9977's author, record whichever order you agree on, and refresh/rebase the combined result. I have not approved this PR pending that repository-required composition check.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!11051
No description provided.