docs(debt): correct sceKernelCreateSema attributes and a broken libkernel anchor #16215
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/16215"
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 MarcZX10 on 2026-11-05T20:53:34Z.
What
docs/dev/debt/libkernel.md, "Silent stubs",sceKernelCreateSema: the entry said attributes 0x100 to 0x102 are accepted and ignored.core/libs/prx/libkernel/Semaphore/src/Semaphore.cppreturnsSCE_KERNEL_ERROR_EINVALwhen(attr & ~0x103u) != 0, so they are rejected and nothing is created. The console measurement is kept, labelled as the console's behaviour.docs/dev/debt/libkernel_sys.md, nanosleep entry: the linklibkernel.md#short-sleeps-ended-by-gpu-and-flip-completionspointed to a heading that does not exist. The bullet is under### Functionalinlibkernel.md, so the link now points tolibkernel.md#functional.Commits: one per statement corrected (2 commits, docs only).
Tested
python3 tools/check_conventions.py --base upstream/main(passed),git diff --check upstream/main(clean).Semaphore.cppat upstream/main, not run against a binary.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)Imported from boykopovar/AnyPS5. Originally posted by gabichuuuuu on 2026-11-08T21:55:37Z.
Review: COMMENTED
Docs check of head
22c9aa17faagainstmain0bae53facd: I compared what the entry says about the code with the code, and checked the links and counts. I can't check the console measurements themselves.The new
sceKernelCreateSemawording is the opposite of what the code does. The check isif ((attr & ~0x103u) != 0 || (attr & 3u) == 3u || ...) return SCE_KERNEL_ERROR_EINVAL;(Semaphore.cpp:30). For 0x100, 0x101 and 0x102,attr & ~0x103uis 0 andattr & 3uisn't 3, so they're accepted; only 0x103 is rejected. Bit 0x100 is then ignored, because onlyattr & 3uis used (lines 33 and 34). Somain's "accepted and ignored" is right, and "rejected here with EINVAL" isn't.The anchor fix is right:
#short-sleeps-ended-by-gpu-and-flip-completionsmatches no heading, because that entry is a list item.#functionalresolves to the section that contains it.Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-11-10T07:19:19Z.
Review: CHANGES_REQUESTED
docs/dev/debt/libkernel.md:5: the new wording is wrong.Semaphore.cpp:30rejectsattr & ~0x103uor(attr & 3u) == 3u, so 0x100, 0x101 and 0x102 pass the check and are accepted; only 0x103 returnsSCE_KERNEL_ERROR_EINVAL. Bit 0x100 is then ignored because onlyattr & 3uis used (lines 33-34). The existing "accepted and ignored" entry onmainis correct. Please drop thesceKernelCreateSemacommit (or, if you want to add something, say that only 0x103 is rejected).docs/dev/debt/libkernel_sys.md:421: the#functionalanchor is right; that commit is fine as is.