AnyPS5/core/libs/prx/libkernel/DirectMemory
Jan Šlégl e753080391 fix(libkernel): count guest module segments against the flexible memory budget
sceKernelAvailableFlexibleMemorySize and the flexible maps counted only
explicit flexible mappings, so the full 448 MiB was reported while the
title's executable and modules were loaded. A title that derives its code
and data size from the budget minus the available size got an unsigned
underflow.

The segments of the main executable and of every .guest.prx module that
the title's ELF gives permissions now count, rounded to 16 KiB pages, as
shadPS4 maps every non-system module segment as flexible memory. The
relinker's own blocks and the host system libraries do not count. The
charge ends when a module is unloaded.

Refs #2883

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Fnrk5Dazjb2tLooVSpdRQq
2026-10-11 17:48:05 +02:00
..
DirectMemory.cpp fix(libkernel): keep stack protection inside the stack and never throw while restoring it 2026-10-11 02:28:03 -05:00
DirectMemory.hpp fix(libkernel): report the largest free direct memory block from sceKernelAvailableDirectMemorySize 2026-10-11 00:58:28 +02:00
Export.cpp fix(libkernel): count guest module segments against the flexible memory budget 2026-10-11 17:48:05 +02:00
MemoryPool.cpp fix(libkernel): report the largest free direct memory block from sceKernelAvailableDirectMemorySize 2026-10-11 00:58:28 +02:00
MemoryPool.hpp fix(libkernel): correct the MemoryPool.hpp include guard 2026-10-06 14:57:51 +02:00
MemoryPoolExport.cpp fix(libkernel): honour MAP_FIXED in sceKernelReserveVirtualRange and sceKernelMemoryPoolReserve 2026-10-01 00:00:22 +02:00
PosixMemory.cpp fix(libkernel): answer munlock from the guest mapping state on Linux 2026-10-10 22:56:07 +13:00