feat(libkernel): implement sigaltstack #2107
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2107"
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 LeandroLP23 on 2026-10-09T08:41:29Z.
What
PICO-8 for PS5 (PPSA99808 v0.1.2, RafaelNGP/pico8-ps5, GPL-3.0) stops at start-up on this import once its earlier stops resolve (chain in #1578):
sHziAegVp74issigaltstack(tools/nid_names.py). It follows FreeBSD'skern_sigaltstackwith the amd64stack_t(ss_sp,ss_size,ss_flagsat 16, 24 bytes):SS_DISABLE, null and 0);SS_DISABLEgiveEINVAL, a size belowMINSIGSTKSZ(2048) givesENOMEM; on error it returns -1 witherrnoset and writes nothing;SS_DISABLEkeeps the recorded pointer and size and only marks the stack disabled, and the old stack is reported as it was before the call.Handlers never run on the alternate stack here, so
SS_ONSTACKandEPERMare never reported; recorded in TechnicalDebt.Tested
Windows 11, MinGW-w64 GCC 15.2.0, Release,
maind70b8998:ZSnX-xZBGCgfromlibSceLibcInternal.prx(stpcpy, #1812).guest_sigaltstacktest: the initial state, the three error cases with the old stack untouched, installing at exactly 2048 bytes, replacing, a second thread seeing its own disabled stack, and disabling. Removing the size check makes it fail.tools/check_conventions.pypasses.Fork CI on this head rebased onto
maind70b8998(with the build workflow from before0ab2a04d, since the new one needs an upstream pull request number): https://github.com/LeandroLP23/AnyPS5/actions/runs/37921144213, all jobs pass (Windows 508/508, Linux 517/517).Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-09T08:56:19Z.
Progress report (
2e375a5→c54143d)📈 System libraries: 85.23% (+0.01%, +1 implemented functions)
✅ 1 implemented
sigaltstack_nid_postfixImported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-09T21:55:59Z.
Checked against FreeBSD
kern_sigaltstack(flag check before size check, old stack reported withSS_DISABLEkeeping the recorded pointer/size, nothing written on error) and the amd64stack_tlayout; built on currentmain, full ctest green,guest_sigaltstackpasses and does not link without the change. TechnicalDebt entry coversSS_ONSTACK/EPERM. Merging.