feat(libkernel): implement sceKernelGetDirectMemoryType #808
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/808"
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 adriadam10 on 2026-10-06T05:44:49Z.
What
Implements
sceKernelGetDirectMemoryType(offset, *type, *start, *end)(BC+OG5m9+bw, not declared onmainuntil now) on top of the existing physical pool lookup (DirectMemoryFind, the same onesceKernelDirectMemoryQueryuses).MemoryManager::GetDirectMemoryType) and prosper (k_get_direct_memory_type) both work this way.SCE_KERNEL_ERROR_ENOENTand the outputs stay as they were. shadPS4 and prosper both return ENOENT here.SCE_KERNEL_ERROR_EINVAL. This comes from prosper (PS5 HLE). shadPS4 doesn't check for null.long offset, int*, long*, long*) from SharpProsperoKernelMemoryQuery.cs.Tested
Linux,
guest_memory_tests(newCheckGetDirectMemoryType): two adjacent blocks of different types (first byte, last byte, and the boundary that lands on the second block), each null output, a released offset (outputs unchanged), a negative offset, a partially released block, and releasing a range that spans both blocks. The test doesn't build onmainbecause the export is missing. Mutation checks: dropping the null checks, returning EACCES, using find-next, writing the wrong type, and writing the wrong end each make it fail. Release build (GCC) passes, and all 119guest_ctests 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)Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-06T05:48:15Z.
Progress report (
481c85e→6d2713c)📈 System libraries: 82.32% (+0.01%, +1 implemented functions)
✅ 1 implemented
sceKernelGetDirectMemoryType