There was an error fetching the commit references. Please try again later.
Implement MapPhysicalMemory/UnmapPhysicalMemory
This implements svcMapPhysicalMemory/svcUnmapPhysicalMemory for Yuzu, which can be used to map memory at a desired address by games since 3.0.0. It also properly parses SystemResourceSize from NPDM, and makes information available via svcGetInfo. This is needed for games like Super Smash Bros. and Diablo 3 -- this PR's implementation does not run into the "ASCII reads" issue mentioned in the comments of #2626, which was caused by the following bugs in Yuzu's memory management that this PR also addresses: * Yuzu's memory coalescing does not properly merge blocks. This results in a polluted address space/svcQueryMemory results that would be impossible to replicate on hardware, which can lead to game code making the wrong assumptions about memory layout. * This implements better merging for AllocatedMemoryBlocks. * Yuzu's implementation of svcMirrorMemory unprotected the entire virtual memory range containing the range being mirrored. This could lead to games attempting to map data at that unprotected range/attempting to access that range after yuzu improperly unmapped it. * This PR fixes it by simply calling ReprotectRange instead of Reprotect.
Showing
- src/core/file_sys/program_metadata.cpp 4 additions, 0 deletionssrc/core/file_sys/program_metadata.cpp
- src/core/file_sys/program_metadata.h 3 additions, 1 deletionsrc/core/file_sys/program_metadata.h
- src/core/hle/kernel/process.cpp 1 addition, 0 deletionssrc/core/hle/kernel/process.cpp
- src/core/hle/kernel/process.h 8 additions, 3 deletionssrc/core/hle/kernel/process.h
- src/core/hle/kernel/svc.cpp 102 additions, 8 deletionssrc/core/hle/kernel/svc.cpp
- src/core/hle/kernel/svc_wrap.h 5 additions, 0 deletionssrc/core/hle/kernel/svc_wrap.h
- src/core/hle/kernel/vm_manager.cpp 312 additions, 8 deletionssrc/core/hle/kernel/vm_manager.cpp
- src/core/hle/kernel/vm_manager.h 40 additions, 1 deletionsrc/core/hle/kernel/vm_manager.h
Loading
Please register or sign in to comment