feat(libSceFiber): attach contexts on run and switch, internal option initialize #9072
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/9072"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by rocklouis055 on 2026-10-21T11:41:57Z.
What
Implements
_sceFiberAttachContextAndRun,_sceFiberAttachContextAndSwitchand_sceFiberInitializeWithInternalOptionImpl, completing libSceFiber.addr_contextnull,size_context0). The attach exports give such a fiber its context when it is first run or switched to; with a null context and size 0 they behave assceFiberRunandsceFiberSwitch, which now share their implementation. Attaching to a fiber that already has a context, or is not idle, returnsSCE_FIBER_ERROR_INVALID; the idle check and the attach happen under the state claim, so concurrent attaches cannot both succeed._sceFiberInitializeWithInternalOptionImplaccepts0x1(no ulobjmgr, no effect),0x10(per-fiber context size check) and0x100(start with MXCSR0x9fc0and x87 control word0x037f); other bits throw.docs/dev/debt/libSceFiber.md.Overlap: #7149 changes the Windows host stack allocation and the Fiber stacks debt entry, and #6044 moves
core/libs/tests/Fiber.cpp; neither implements these functions.Tested
Linux (Ubuntu 26.04, GCC, Release):
ctest -R '^fiber$'passes, with new cases for the attach error codes, attach and run on 64 KiB and 4 KiB contexts, attach and switch, resume after attach, the permission checks, and each internal option flag. Windows not tested.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-21T12:02:41Z.
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
core/libs/tests/Fiber.cppcore/libs/prx/libSceFiber/Export.cppdocs/dev/debt/libSceFiber.mdImported from boykopovar/AnyPS5. Originally posted by ycbuzi on 2026-10-21T17:51:06Z.
Windows run of
43d4eebe51merged ontomain745b394629(90515ad990, clean), the platform the description lists as not tested. Windows 11 Home 10.0.26200, MinGW-w64 GCC 15.2.0 (ucrt-posix-seh r7), Release,BUILD_TESTING=ON.Built
libSceFiberandfiber_testswith no errors or warnings.ctest --repeat until-fail:2onfiber: passes on both repeats. Not run: a title.Imported from boykopovar/AnyPS5. Originally posted by rocklouis055 on 2026-10-21T19:47:58Z.
@ycbuzi thanks for the Windows run, that was the platform I couldn't test.