shadPS4/src/core
Stephen Miller bb3f8af81a
Core: Protect fixes (#3029)
* Swap do-while to while

If we use a do-while loop, we waste time if `aligned_size = 0`.  This is also still accurate to FreeBSD behavior, where it returns success if `start == end` during mprotect.
This also effectively prevents the memory assert seen in updated versions of RESIDENT EVIL 2 (CUSA09193)

* Move prot validation outside loop

The prot variable shouldn't change during a mprotect call, so we can check the flags before protecting instead.
Also cleans up the code for prot validation.
This should improve performance, and is more accurate to FreeBSD code.

* Add logging for protect calls

This will help in debugging future problems
2025-06-03 09:29:25 +03:00
..
aerolib fix typo in LOG_INFO (#559) 2024-08-26 15:22:11 +03:00
devices fix: Add missing ctime includes. 2025-04-30 23:37:37 -07:00
devtools Devtools: Add Module Viewer (#2976) 2025-05-24 09:15:10 -03:00
file_format externals: Remove need for cryptopp build. (#2707) 2025-03-29 10:32:06 +02:00
file_sys Handle "-patch" as the suffix for game update folders (#2674) 2025-03-23 23:24:49 +02:00
libraries Core: Protect fixes (#3029) 2025-06-03 09:29:25 +03:00
loader Fix path bugs & wrap seeks in an if (#1154) 2024-09-30 12:42:59 +03:00
address_space.cpp address_space: Split macOS reserved memory region. (#2372) 2025-02-08 13:21:32 -08:00
address_space.h Core: Fix module load addresses (#2879) 2025-05-05 03:24:08 -07:00
cpu_patches.cpp Optimize games that hit unpatchable EXTRQ/INSERTQ (#2888) 2025-05-08 19:59:12 +03:00
cpu_patches.h cpu_patches: Remove CPU patches for macOS and bump minimum OS version to 15.4 (#2743) 2025-04-03 22:39:08 +03:00
debug_state.cpp Fix showing debug menu bar / Devtools (#2214) 2025-01-22 22:21:41 -03:00
debug_state.h FidelityFX FSR implementation (#2624) 2025-03-12 20:33:30 +02:00
linker.cpp Emulate libSceGnmDriver's init behavior (#3024) 2025-06-03 08:02:51 +03:00
linker.h Implement sceKernelGetModuleInfo, sceKernelGetModuleInfoInternal, and sceKernelGetModuleList (#2850) 2025-04-27 09:32:01 +03:00
memory.cpp Core: Protect fixes (#3029) 2025-06-03 09:29:25 +03:00
memory.h Core: More Memory Cleanup & Fixes (#2997) 2025-05-29 18:56:03 +03:00
module.cpp Core: Fix module load addresses (#2879) 2025-05-05 03:24:08 -07:00
module.h libkernel: improve module finding in sceKernelLoadStartModule (#2541) 2025-03-09 23:44:17 +02:00
platform.h Support for Vulkan 1.4 (#1665) 2024-12-07 19:41:41 +02:00
signals.cpp Bump to Clang 19 (#2434) 2025-02-18 15:55:13 +02:00
signals.h Patch extrq (#943) 2024-09-23 19:19:52 +03:00
thread.cpp exception: Fix raising exceptions on POSIX systems (#1868) 2024-12-25 00:21:32 +02:00
thread.h Switch remaining CRLF terminated files to LF 2024-12-24 13:56:31 +01:00
tls.cpp cpu_patches: Remove CPU patches for macOS and bump minimum OS version to 15.4 (#2743) 2025-04-03 22:39:08 +03:00
tls.h Lower stack size to clear from 13 to 12 KB (#2967) 2025-05-21 16:22:38 -03:00