diff options
author | Lioncash <mathew1800@gmail.com> | 2019-03-21 16:39:55 +0100 |
---|---|---|
committer | Lioncash <mathew1800@gmail.com> | 2019-03-21 16:43:35 +0100 |
commit | 18918f5f2fba9ca1ad2f34730fa122562a6ae05a (patch) | |
tree | e6b0747bb8ae4879b367eb1cf338e0f70e417c10 /src/core | |
parent | kernel/vm_manager: Amend flag values for CodeMutable (diff) | |
download | yuzu-18918f5f2fba9ca1ad2f34730fa122562a6ae05a.tar yuzu-18918f5f2fba9ca1ad2f34730fa122562a6ae05a.tar.gz yuzu-18918f5f2fba9ca1ad2f34730fa122562a6ae05a.tar.bz2 yuzu-18918f5f2fba9ca1ad2f34730fa122562a6ae05a.tar.lz yuzu-18918f5f2fba9ca1ad2f34730fa122562a6ae05a.tar.xz yuzu-18918f5f2fba9ca1ad2f34730fa122562a6ae05a.tar.zst yuzu-18918f5f2fba9ca1ad2f34730fa122562a6ae05a.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/hle/kernel/process.cpp | 6 | ||||
-rw-r--r-- | src/core/hle/kernel/vm_manager.cpp | 20 | ||||
-rw-r--r-- | src/core/hle/kernel/vm_manager.h | 8 | ||||
-rw-r--r-- | src/core/hle/service/ldr/ldr.cpp | 8 |
4 files changed, 20 insertions, 22 deletions
diff --git a/src/core/hle/kernel/process.cpp b/src/core/hle/kernel/process.cpp index 15a16ae14..83cfea0d4 100644 --- a/src/core/hle/kernel/process.cpp +++ b/src/core/hle/kernel/process.cpp @@ -220,9 +220,9 @@ void Process::LoadModule(CodeSet module_, VAddr base_addr) { }; // Map CodeSet segments - MapSegment(module_.CodeSegment(), VMAPermission::ReadExecute, MemoryState::CodeStatic); - MapSegment(module_.RODataSegment(), VMAPermission::Read, MemoryState::CodeMutable); - MapSegment(module_.DataSegment(), VMAPermission::ReadWrite, MemoryState::CodeMutable); + MapSegment(module_.CodeSegment(), VMAPermission::ReadExecute, MemoryState::Code); + MapSegment(module_.RODataSegment(), VMAPermission::Read, MemoryState::CodeData); + MapSegment(module_.DataSegment(), VMAPermission::ReadWrite, MemoryState::CodeData); // Clear instruction cache in CPU JIT system.InvalidateCpuInstructionCaches(); diff --git a/src/core/hle/kernel/vm_manager.cpp b/src/core/hle/kernel/vm_manager.cpp index 3def3e52c..22bf55ce7 100644 --- a/src/core/hle/kernel/vm_manager.cpp +++ b/src/core/hle/kernel/vm_manager.cpp @@ -20,16 +20,16 @@ namespace Kernel { namespace { const char* GetMemoryStateName(MemoryState state) { static constexpr const char* names[] = { - "Unmapped", "Io", - "Normal", "CodeStatic", - "CodeMutable", "Heap", - "Shared", "Unknown1", - "ModuleCodeStatic", "ModuleCodeMutable", - "IpcBuffer0", "Stack", - "ThreadLocal", "TransferMemoryIsolated", - "TransferMemory", "ProcessMemory", - "Inaccessible", "IpcBuffer1", - "IpcBuffer3", "KernelStack", + "Unmapped", "Io", + "Normal", "Code", + "CodeData", "Heap", + "Shared", "Unknown1", + "ModuleCode", "ModuleCodeData", + "IpcBuffer0", "Stack", + "ThreadLocal", "TransferMemoryIsolated", + "TransferMemory", "ProcessMemory", + "Inaccessible", "IpcBuffer1", + "IpcBuffer3", "KernelStack", }; return names[ToSvcMemoryState(state)]; diff --git a/src/core/hle/kernel/vm_manager.h b/src/core/hle/kernel/vm_manager.h index a3f9a3cf6..5ef379fab 100644 --- a/src/core/hle/kernel/vm_manager.h +++ b/src/core/hle/kernel/vm_manager.h @@ -165,12 +165,12 @@ enum class MemoryState : u32 { Unmapped = 0x00, Io = 0x01 | FlagMapped, Normal = 0x02 | FlagMapped | FlagQueryPhysicalAddressAllowed, - CodeStatic = 0x03 | CodeFlags | FlagMapProcess, - CodeMutable = 0x04 | DataFlags | FlagMapProcess | FlagCodeMemory, + Code = 0x03 | CodeFlags | FlagMapProcess, + CodeData = 0x04 | DataFlags | FlagMapProcess | FlagCodeMemory, Heap = 0x05 | DataFlags | FlagCodeMemory, Shared = 0x06 | FlagMapped | FlagMemoryPoolAllocated, - ModuleCodeStatic = 0x08 | CodeFlags | FlagModule | FlagMapProcess, - ModuleCodeMutable = 0x09 | DataFlags | FlagModule | FlagMapProcess | FlagCodeMemory, + ModuleCode = 0x08 | CodeFlags | FlagModule | FlagMapProcess, + ModuleCodeData = 0x09 | DataFlags | FlagModule | FlagMapProcess | FlagCodeMemory, IpcBuffer0 = 0x0A | FlagMapped | FlagQueryPhysicalAddressAllowed | FlagMemoryPoolAllocated | IPCFlags | FlagSharedDevice | FlagSharedDeviceAligned, diff --git a/src/core/hle/service/ldr/ldr.cpp b/src/core/hle/service/ldr/ldr.cpp index 9df7ac50f..d65693fc7 100644 --- a/src/core/hle/service/ldr/ldr.cpp +++ b/src/core/hle/service/ldr/ldr.cpp @@ -319,15 +319,14 @@ public: } ASSERT(vm_manager - .MirrorMemory(*map_address, nro_addr, nro_size, - Kernel::MemoryState::ModuleCodeStatic) + .MirrorMemory(*map_address, nro_addr, nro_size, Kernel::MemoryState::ModuleCode) .IsSuccess()); ASSERT(vm_manager.UnmapRange(nro_addr, nro_size).IsSuccess()); if (bss_size > 0) { ASSERT(vm_manager .MirrorMemory(*map_address + nro_size, bss_addr, bss_size, - Kernel::MemoryState::ModuleCodeStatic) + Kernel::MemoryState::ModuleCode) .IsSuccess()); ASSERT(vm_manager.UnmapRange(bss_addr, bss_size).IsSuccess()); } @@ -388,8 +387,7 @@ public: const auto& nro_size = iter->second.size; ASSERT(vm_manager - .MirrorMemory(heap_addr, mapped_addr, nro_size, - Kernel::MemoryState::ModuleCodeStatic) + .MirrorMemory(heap_addr, mapped_addr, nro_size, Kernel::MemoryState::ModuleCode) .IsSuccess()); ASSERT(vm_manager.UnmapRange(mapped_addr, nro_size).IsSuccess()); |