feat(libkernel): export sceKernelMmap #4710
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/4710"
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 babyhuey on 2026-10-12T19:37:31Z.
What
Exports
sceKernelMmap(PGhQHd-dzv8) in libkernel, next tosceKernelMunmap. It is the SCE-error form ofmmap: it calls the existingmmap_nid_postfix, returns the SCE error forerrnowhen that fails, and otherwise stores the mapping in*resand returns 0. This is the same shape as shadPS4'ssceKernelMmap, with the(addr, len, prot, flags, fd, offset, res)signature. Flags, protections and descriptors are whatevermmapalready supports, so nothing new is accepted or refused.Where a title reaches it
Nuvio Max'd (PPSA99288, catalog build) relinks with
--trap-sdk-syscall-stubs(#3804). Until recently its relink failed; onmain682ef0c1it relinks, and it stops at load:app.elf: symbol lookup error: app.elf: undefined symbol: PGhQHd-dzv8FAIL: unresolved ELF import PGhQHd-dzv8 from libkernel.prxWith this PR every import resolves:
sceVideoOutOpen, which is as far as a headless run gets (gdb:VideoOutDriver::VideoOutDriverrethrows under the offscreen SDL driver). A breakpoint onsceKernelMmapshows the title doesn't call it before then; it needs the export to load.[nuvio] app: Nuvio Max'd 0.5.15 (native experimental)and its curl and display set-up, then stops atpoll: descriptor 4 is not a socket, the stop #3649 fixes.Tested
On the PR head
db3726a8, Linux (Ubuntu 24.04, GCC 13) and Windows 11 (MinGW-w64 GCC 15.2 from WinLibs), Release:guest_memorypasses 5/5 (--repeat until-fail:5) on both. The new check maps an anonymous page throughsceKernelMmap, writes and reads it, unmaps it, and checks that a zero length returnsSCE_KERNEL_ERROR_EINVALwithout touching*res.DirectMemory/Export.cpporGuestMemory.cpp.check_conventions.pypasses.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-12T19:38:57Z.
Progress report (
2f4cc89→db3726a)📈 System libraries: 86.37% (+0.01%, +1 implemented functions)
✅ 1 implemented
sceKernelMmapImported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-12T20:55:41Z.
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
main)core/libs/prx/libkernel/DirectMemory/Export.cppL33Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-12T21:15:45Z.
Checked build and ctest (141/141) on the PR merged onto main;
guest_memorypasses, and its newCheckSceKernelMmapdoes not link without the export. The wrapper matchesmmap_nid_postfix+ errno → SCE error (EINVAL on zero length leaves*resuntouched), same shape as shadPS4'ssceKernelMmap. Merging.