feat(libkernel): implement sceKernelMapNamedFlexibleMemoryInternal #355
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/355"
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 DotDebian on 2026-10-02T12:09:06Z.
What
sceKernelMapNamedFlexibleMemoryInternal(NID4h6F1LLbTiw) was not exported by libkernel. This PR adds it incore/libs/prx/libkernel/DirectMemory/Export.cppas a forward tosceKernelMapNamedFlexibleMemory: the mapping counts against the flexible budget, gets the range name and is released bysceKernelMunmap.Why the same signature and contract. The
libc.prxbundled with an SDK 9 title (Astro Bot) calls this function at three sites as(&addr, len, 3, 0x8000, name)withaddra zeroed local, then testseaxand reads the address back from the local. An olderlibc.prx(Dreaming Sarah) has the same three sites with identical result handling, callingsceKernelMapNamedFlexibleMemory(&addr, len, 3, 0, name). So the function is a drop-in successor of the public one.Flag
0x8000still throws. Every call site I found passes0x8000. I could not find what it means: it is in no public mmap flag list I checked (fpPS4rtl/mmap.pas, the Mira FreeBSD headers). This PR does not touchSupportedFlagsinDirectMemory.cpp, so the call still throwsUnsupported memory mapping flags 0x8000, as it would throughsceKernelMapNamedFlexibleMemory. The flag is listed under "Unknown function info" indocs/dev/TechnicalDebt.md.The practical effect is therefore limited: titles that bundle the SDK 9 libc resolve the import, and the next failure names the flag instead of the missing symbol. What "Internal" changes beyond the public function, if anything, is not established either; the equivalence rests on the call-site comparison above.
Tested
Windows 11, MinGW-w64 GCC 15.2.0, Release build with
-DBUILD_TESTING=ON. No title or homebrew was run with this branch. Linux was not built or run locally; the change has no platform-specific code, so CI is the first Linux run of it.New check
CheckInternalNamedFlexibleMappingin the existing ctestguest_memory(core/libs/tests/GuestMemory.cpp):sceKernelVirtualQueryreports the name passed in;sceKernelAvailableFlexibleMemorySizedrops bylenand returns to its previous value aftersceKernelMunmap;0x8000throws, leaves the address null and leaves the available flexible size unchanged.objdump -pon the builtlibkernel.prxlistssceKernelMapNamedFlexibleMemoryInternalin the export table. Full suite: 107/107 tests pass.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)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-02T13:43:02Z.
Progress report (
e1654a9→74fcea2)📈 System libraries: 80.77% (+0.01%, +1 implemented functions)
✅ 1 implemented
sceKernelMapNamedFlexibleMemoryInternal