arm_dynarmic: Implement IsReadOnlyMemory

This commit is contained in:
MerryMage 2017-08-18 08:33:53 +01:00
parent 21204ba488
commit 66805baa51

View File

@ -11,6 +11,8 @@
#include "core/arm/dyncom/arm_dyncom_interpreter.h" #include "core/arm/dyncom/arm_dyncom_interpreter.h"
#include "core/core.h" #include "core/core.h"
#include "core/core_timing.h" #include "core/core_timing.h"
#include "core/hle/kernel/process.h"
#include "core/hle/kernel/vm_manager.h"
#include "core/hle/svc.h" #include "core/hle/svc.h"
#include "core/memory.h" #include "core/memory.h"
@ -36,8 +38,12 @@ static void InterpreterFallback(u32 pc, Dynarmic::Jit* jit, void* user_arg) {
} }
static bool IsReadOnlyMemory(u32 vaddr) { static bool IsReadOnlyMemory(u32 vaddr) {
// TODO(bunnei): ImplementMe auto it = Kernel::g_current_process->vm_manager.FindVMA(vaddr);
return false; if (it == Kernel::g_current_process->vm_manager.vma_map.end())
return false;
if (static_cast<int>(it->second.permissions) & static_cast<int>(Kernel::VMAPermission::Write))
return false;
return it->second.meminfo_state == Kernel::MemoryState::Code;
} }
static Dynarmic::UserCallbacks GetUserCallbacks( static Dynarmic::UserCallbacks GetUserCallbacks(