shadPS4/src/core/libraries
Stephen Miller afcf3a12a3
Some checks are pending
Build and Release / macos-sdl (push) Blocked by required conditions
Build and Release / macos-qt (push) Blocked by required conditions
Build and Release / reuse (push) Waiting to run
Build and Release / clang-format (push) Waiting to run
Build and Release / get-info (push) Waiting to run
Build and Release / windows-sdl (push) Blocked by required conditions
Build and Release / windows-qt (push) Blocked by required conditions
Build and Release / linux-sdl (push) Blocked by required conditions
Build and Release / linux-qt (push) Blocked by required conditions
Build and Release / linux-sdl-gcc (push) Blocked by required conditions
Build and Release / linux-qt-gcc (push) Blocked by required conditions
Build and Release / pre-release (push) Blocked by required conditions
Core: Pooled Memory Fixes (#2895)
* Update sceKernelMemoryPoolExpand

Hardware tests show that this function is basically the same as sceKernelAllocateDirectMemory, with some minor differences.
Update the memory searching code to match my updated AllocateDirectMemory code, with appropriate error conditions.

* Update MemoryPoolReserve

Only difference between real hw and our code is behavior with addr = 0.

* Don't coalesce PoolReserved areas.

Real hardware doesn't coalesce them.

* Update PoolCommit

Plenty of edge case behaviors to handle here.
Addresses are treated as fixed, EINVAL is returned for bad mappings, name should be preserved from PoolReserving, committed areas should coalesce, reserved areas get their phys_base updated

* Formatting

* Adjust fixed PoolReserve path

Hardware tests suggest this will overwrite all VMAs in the range. Run UnmapMemoryImpl on the full area, then reserve. Same logic applies to normal reservations too.

Also adjusts logic of the non-fixed path to more closely align with hardware observations.

* Remove phys_base modifications

This can be handled later. Doing the logic properly would likely take work in MergeAdjacent, and would probably need to be applied to normal dmem mappings too.

* Use VMAHandle.Contains()

Why do extra math when we have a function specifically for this?

* Update memory.cpp

* Remove unnecessary code

Since I've removed those two asserts, these two lines of code effectively do nothing.

* Clang

* Fix names

* Fix PoolDecommit

Should fix the address space regressions in UE titles on Windows.

* Fix error log

Should make the cause of this clearer?

* Clang

* Oops

* Remove coalesce on PoolCommit

Windows makes this more difficult.

* Track pool budgets

If you try to commit more pooled memory than is allocated, PoolCommit returns ENOMEM.
Also fixes error conditions for PoolDecommit, that should return EINVAL if given an address that isn't part of the pool.

Note: Seems like the pool budget can't hit zero? I used a <= comparison based on hardware tests, otherwise we're able to make more mappings than real hardware can.
2025-05-11 02:59:14 -07:00
..
ajm Avoid processing job buffers before codec initialization (#2507) 2025-02-23 06:47:44 +03:00
app_content change sizeof to TmpMount.size (#2523) 2025-02-24 12:44:22 +02:00
audio libraries: Initial Audio3d implementation. (#2776) 2025-04-13 23:46:10 -07:00
audio3d libraries: Initial Audio3d implementation. (#2776) 2025-04-13 23:46:10 -07:00
avplayer fix: fix #1457 again by moving av_err2str to a common header (#1688) 2024-12-08 00:52:03 +02:00
disc_map HLE discmap (#2686) 2025-03-25 23:54:32 +02:00
fiber libraries/fiber: print fiber ctx size on stack overflow 2025-01-24 19:37:34 +01:00
game_live_streaming Network libs fixes , stubs and more (#1324) 2024-10-11 10:37:36 +03:00
gnmdriver gnm: Implement sceGnmDrawIndexIndirectMulti (#2889) 2025-05-09 10:04:37 -07:00
hmd libSceHmd Stubs (#2355) 2025-02-05 17:24:53 +02:00
ime Update ime_dialog.h (#2853) 2025-04-27 20:57:20 +03:00
jpeg Support for Vulkan 1.4 (#1665) 2024-12-07 19:41:41 +02:00
kernel Core: Pooled Memory Fixes (#2895) 2025-05-11 02:59:14 -07:00
libc_internal Remove deprecated include (#2893) 2025-05-09 08:33:32 -07:00
libpng hot-fix: debug build fixed 2024-12-01 15:46:08 +01:00
mouse dummy sceMouse module and change sceMouseRead to debug to reduce spam (#2074) 2025-01-06 18:45:53 +02:00
move libraries: Reduce some controller log spam. (#2777) 2025-04-13 18:12:02 +03:00
network [Libs] sceNet (#2815) 2025-04-30 17:58:39 +03:00
ngs2 Fix libSceNgs2 HLE regressions (#2732) 2025-04-01 08:57:47 +03:00
np_auth NpAuth library stub (#2808) 2025-04-18 23:42:17 +03:00
np_common Implement sceNpCmp functions (#2114) 2025-01-11 17:58:07 +01:00
np_manager Additional libSceNpManager functions and cleanup (#2195) 2025-01-19 19:12:42 -08:00
np_party stubbed webbrowserdialog,npparty (#2234) 2025-01-24 19:22:06 +02:00
np_score Reorganization of includes (Part 2) 2024-08-30 15:48:21 +02:00
np_trophy load trophy from .wav (#2603) 2025-03-06 16:20:55 +02:00
np_web_api Add libSceNpWebApi (#2150) 2025-01-15 13:19:41 +02:00
pad libraries: Reduce some controller log spam. (#2777) 2025-04-13 18:12:02 +03:00
playgo video_core: Various small improvements and bug fixes (#2525) 2025-02-24 14:31:12 +02:00
random core: Library cleanup (#1631) 2024-11-30 22:37:36 +02:00
razor_cpu libraries: Add libSceRazorCpu HLE skeleton. (#1624) 2024-11-30 11:30:22 +02:00
remote_play Network libs fixes , stubs and more (#1324) 2024-10-11 10:37:36 +03:00
rtc core: Library cleanup (#1631) 2024-11-30 22:37:36 +02:00
save_data Savefixes VIII (#2851) 2025-05-03 12:51:10 -03:00
screenshot Reorganization of includes (Part 2) 2024-08-30 15:48:21 +02:00
share_play Network libs fixes , stubs and more (#1324) 2024-10-11 10:37:36 +03:00
signin_dialog [Libs] Stubs sceSigninDialog (#2890) 2025-05-09 11:08:22 +03:00
system Sysmodules (#2826) 2025-04-24 14:46:22 -07:00
ulobjmgr libraries: Proper ulobjmgr stubs (#2740) 2025-04-02 02:41:40 +02:00
usbd usbd: Implement libusb passthrough (#2271) 2025-03-31 18:55:21 +03:00
videodec log error for videodec ,videodec2 (#2900) 2025-05-10 23:29:23 +03:00
videoout VideoOut event cleanup (#2849) 2025-04-27 09:04:17 +03:00
web_browser_dialog stubbed webbrowserdialog,npparty (#2234) 2025-01-24 19:22:06 +02:00
zlib libraries: Implement libSceZlib. (#2256) 2025-01-28 18:48:19 +02:00
error_codes.h core: Library cleanup (#1631) 2024-11-30 22:37:36 +02:00
libs.cpp [Libs] Stubs sceSigninDialog (#2890) 2025-05-09 11:08:22 +03:00
libs.h kernel: Rewrite pthread emulation (#1440) 2024-11-21 22:59:38 +02:00