fix(libSceAgc): use firmware semaphore memory results #8318
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/8318"
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 hypermoist on 2026-10-20T09:57:55Z.
What
Replaces the guessed semaphore memory behaviour with the firmware's. The evidence is the decrypted
libSceAgc.sprx. Upstream threw "the console's error is unknown" on every rejected call; each of those now returns the firmware's code.sceAgcSetAmmSemaphoreMemory(OQTgEXyihvA). Checks run in this order:cmp qword ptr [0x4a098], 0): returns0x8a6c0048;shl rax, 0x32on the size), then memory not 16 KiB aligned: returns0x8a6c0002.It then stores memory and size and calls
memset(memory, 0, size), clearing the whole region. That settles the OpenAGC-versus-sharpemu disagreement in the debt entry, so the "labels hold data past 8 bytes" throw is gone. There is no null check:(nullptr, 0)passes, leaves the size at 0 and so registers nothing.sceAgcSetSemaphoreMemory(v3G+IipShZs, previously a throwing stub). Same body and the same two globals, so either call blocks the other. One extra check sits between the two alignment checks: a size above0x40000000returns0x8a6c000b.sceAgcGetSemaphoreLabel(hFQ9pUxoLQ4).0x8a6c0049;index * 32 + 32 > size: returns0x8a6c000b;memory + index * 32. There is no null check on the output.Debt entry. Rewritten to list what is still not done. The firmware runs libkernel
qSleeVC6lwI(ioctl0xc018ac15with{memory, size, 1}) andsceAgcDriverPassInfoDownward({7: memory, 8: size, 0xb: 0|1}), and both results are defined by the kernel and driver.Tested
Linux (CachyOS, GCC, Release).
agc_semaphore_testswas updated to the firmware results and passes. It checks: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
https://claude.ai/code/session_01RbLgECLQ2bpDM7oe2urGZK
Imported from boykopovar/AnyPS5. Originally posted by hypermoist on 2026-10-22T12:52:24Z.
Overlap note: #9166 rewrites the
sceAgcDcbSetWorkloadsActiveentry indocs/dev/debt/libSceAgc.md(line 45). This PR rewrites thesceAgcSetAmmSemaphoreMemoryentry right above it (line 44), and #8302's documentation commit, which this branch carries, adds the workload packet entry below it. The code doesn't overlap. Whichever is merged second mergesmainand keeps all three entries. If #9166 lands first, I'll do that here and fold its workload wording into #8302's entry, so the file doesn't end up with two entries for the same calls.🤖 Generated with Claude Code