diff options
| author | 2019-07-07 09:42:54 -0700 | |
|---|---|---|
| committer | 2019-07-07 11:45:53 -0700 | |
| commit | 13a8fde3ad2a4a37cf1bb8dcb367b4c8fc8b4d9b (patch) | |
| tree | 5baf26505ec000e221c1119ba4dd2d0bca93de0e /src/core/hle/kernel/process.cpp | |
| parent | Merge pull request #2674 from lioncash/reporter (diff) | |
| download | yuzu-13a8fde3ad2a4a37cf1bb8dcb367b4c8fc8b4d9b.tar.gz yuzu-13a8fde3ad2a4a37cf1bb8dcb367b4c8fc8b4d9b.tar.xz yuzu-13a8fde3ad2a4a37cf1bb8dcb367b4c8fc8b4d9b.zip | |
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.
Diffstat (limited to 'src/core/hle/kernel/process.cpp')
| -rw-r--r-- | src/core/hle/kernel/process.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/core/hle/kernel/process.cpp b/src/core/hle/kernel/process.cpp index f45ef05f6..51245cbb4 100644 --- a/src/core/hle/kernel/process.cpp +++ b/src/core/hle/kernel/process.cpp | |||
| @@ -172,6 +172,7 @@ ResultCode Process::LoadFromMetadata(const FileSys::ProgramMetadata& metadata) { | |||
| 172 | program_id = metadata.GetTitleID(); | 172 | program_id = metadata.GetTitleID(); |
| 173 | ideal_core = metadata.GetMainThreadCore(); | 173 | ideal_core = metadata.GetMainThreadCore(); |
| 174 | is_64bit_process = metadata.Is64BitProgram(); | 174 | is_64bit_process = metadata.Is64BitProgram(); |
| 175 | system_resource_size = metadata.GetSystemResourceSize(); | ||
| 175 | 176 | ||
| 176 | vm_manager.Reset(metadata.GetAddressSpaceType()); | 177 | vm_manager.Reset(metadata.GetAddressSpaceType()); |
| 177 | 178 | ||