shadPS4/src/core/libraries/kernel
Stephen Miller 528a060709
Some checks are pending
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 / macos-sdl (push) Blocked by required conditions
Build and Release / macos-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: Memory code cleanup and further direct memory fixes (#3655)
* Remove mapped dmem type

Since physical addresses can be mapped multiple times, tracking mapped pages is not necessary.
This also allows me to significantly simplify the MapMemory physical address validation logic.

* Proper implementation for sceKernelMtypeprotect

I've rewritten SetDirectMemoryType to use virtual addresses instead of physical addresses, allowing it to be used in sceKernelMtypeprotect.

To accommodate this change, I've also moved address and size alignment out of MemoryManager::Protect

* Apply memory type in sceKernelMemoryPoolCommit

* Organization

Some potentially important missing mutexes, removed some unnecessary mutexes, moved some mutexes after early error returns, and updated copyright dates

* Iterator logic cleanup

Missing end check in ClampRangeSize, and adjusted VirtualQuery and DirectMemoryQuery.

* Clang

* Adjustments

* Properly account for behavior differences in MapDirectMemory2

Undid the changes to direct memory areas, added more robust logic for changing dma types, and fixed DirectMemoryQuery to return hardware-accurate direct memory information in cases where dmas split here, but not on real hardware.

I've also changed MapMemory's is_exec flag to a validate_dmem flag, used to handle alternate behavior in MapDirectMemory2. is_exec is now determined by the use of MemoryProt::CpuExec instead.

* Clang

* Add execute permissions to physical backing

Needed for executable mappings to work properly on Windows, fixes regression in RE2 with prior commit.

* Minor variable cleanup

* Update memory.h

* Prohibit direct memory mappings with exec protections

Did a quick hardware test to confirm, only seems to be prohibited for dmem mappings though.

* Update memory.cpp
2025-09-26 02:28:32 -07:00
..
sync kernel: Improvements to condvars. (#3592) 2025-09-13 08:41:26 -07:00
threads Fix Pthread memset warning and add comment. (#3625) 2025-09-19 02:17:30 -07:00
aio.cpp Core: Remove checks for symbol version_major and version_minor (#3540) 2025-09-08 19:30:03 -07:00
aio.h sceKernelAio* implementation (#2160) 2025-01-16 18:27:52 +02:00
debug.cpp Core: Remove checks for symbol version_major and version_minor (#3540) 2025-09-08 19:30:03 -07:00
debug.h Minor libkernel changes (#2721) 2025-03-30 01:27:33 +02:00
equeue.cpp equeue: Few fixes for sceKernelWaitEqueue (#3548) 2025-09-08 19:47:12 -07:00
equeue.h equeue: Few fixes for sceKernelWaitEqueue (#3548) 2025-09-08 19:47:12 -07:00
file_system.cpp Epolls are file descriptors (#3622) 2025-09-22 22:57:51 +03:00
file_system.h Filesystem: Abstract handling of directory files (#3455) 2025-08-25 23:41:24 +03:00
kernel.cpp Add missing ioctl export (#3579) 2025-09-12 00:44:02 -07:00
kernel.h Implement getargc and getargv (#3562) 2025-09-09 14:58:22 -07:00
memory.cpp Core: Memory code cleanup and further direct memory fixes (#3655) 2025-09-26 02:28:32 -07:00
memory.h Core: Memory code cleanup and further direct memory fixes (#3655) 2025-09-26 02:28:32 -07:00
orbis_error.h core: Library cleanup (#1631) 2024-11-30 22:37:36 +02:00
posix_error.h core: Library cleanup (#1631) 2024-11-30 22:37:36 +02:00
process.cpp Core: Remove checks for symbol version_major and version_minor (#3540) 2025-09-08 19:30:03 -07:00
process.h Libraries: Implement sceKernelIsInSandbox, update OrbisSysModule enum (#3546) 2025-09-07 13:11:15 -07:00
threads.cpp kernel: Rewrite pthread emulation (#1440) 2024-11-21 22:59:38 +02:00
threads.h kernel: Implement scePthreadGetaffinity (#2916) 2025-05-12 10:46:53 -07:00
time.cpp kernel: Improvements to condvars. (#3592) 2025-09-13 08:41:26 -07:00
time.h Make libSceRtc fully HLE (#3330) 2025-08-06 20:08:26 +03:00