fix(libkernel): accept flag 0x8000 in sceKernelMapFlexibleMemory #4859
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/4859"
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 EagleBearerYS on 2026-10-13T00:27:45Z.
What
Animal Well (PPSA22520, content 01.000.011) bundles an SDK 9.04
libc.prxwhose heap maps every arena withsceKernelMapFlexibleMemory(&addr, len, 3, 0x8000)(both of the module's calls to that import pass 0x8000). Onmainthis throws inMapPlacedbefore the first frame:#957 accepts the same flag in
sceKernelMapNamedFlexibleMemoryInternal, where an older SDK 9 libc passes it. This libc imports no Internal NID and calls the public function instead (NIDIWIBBdTHit4).sceKernelMapFlexibleMemorynow ignores 0x8000, as the Internal variant does. Other unknown flags still throw.GUEST_MAP_UNKNOWN_8000) and sharpemu accept it in the named flexible map without reading it.sceKernelMapFlexibleMemory's.Tested
main43e3a70f8:guest_memory(newCheckFlexibleMappingIgnoresFlag8000). It maps with 0x8000 and checks the flexible memory accounting, maps again at the same address with 0x8090, and checks that 0x20000 still throws and leaves the output null.main'sExport.cpp: fails withUnsupported memory mapping flags 0x8000.main43e3a70f8): withmain'sExport.cpp,guest_memoryaborts with the same message; with the change, 20/20 pass.mainthe run ends at 7.7 s with the log line above. With the change (on a test build that also carried #4693's crash reporter, which doesn't touch this path) it reaches the title screen, starts a new game and plays the first rooms; a 180 s run ended at the time limit with no error lines.python3 tools/check_conventions.py --base origin/main: passed.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)