diff options
author | Arisotura <thetotalworm@gmail.com> | 2020-12-04 18:28:15 +0100 |
---|---|---|
committer | Arisotura <thetotalworm@gmail.com> | 2020-12-04 18:28:15 +0100 |
commit | 129018a6626cbec915ef73484c51c9d07af8e8b9 (patch) | |
tree | 8e5712bd241319731f7b6ade3363cefe845e3a5e /src/ARMJIT_x64/ARMJIT_Compiler.cpp | |
parent | 6aad429383015a0ac135b081931ae9c5876a7ad0 (diff) | |
parent | 42e083960e52cce31589714dcc7fab8e173efb81 (diff) |
Merge remote-tracking branch 'remotes/origin/master' into dsi_camera
Diffstat (limited to 'src/ARMJIT_x64/ARMJIT_Compiler.cpp')
-rw-r--r-- | src/ARMJIT_x64/ARMJIT_Compiler.cpp | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/src/ARMJIT_x64/ARMJIT_Compiler.cpp b/src/ARMJIT_x64/ARMJIT_Compiler.cpp index c6419c9..cc4ad80 100644 --- a/src/ARMJIT_x64/ARMJIT_Compiler.cpp +++ b/src/ARMJIT_x64/ARMJIT_Compiler.cpp @@ -101,6 +101,11 @@ void Compiler::A_Comp_MRS() MOV(32, rd, R(RCPSR)); } +void UpdateModeTrampoline(ARM* arm, u32 oldmode, u32 newmode) +{ + arm->UpdateMode(oldmode, newmode); +} + void Compiler::A_Comp_MSR() { Comp_AddCycles_C(); @@ -185,7 +190,7 @@ void Compiler::A_Comp_MSR() MOV(32, R(ABI_PARAM3), R(RCPSR)); MOV(32, R(ABI_PARAM2), R(RSCRATCH3)); MOV(64, R(ABI_PARAM1), R(RCPU)); - CALL((void*)&ARM::UpdateMode); + CALL((void*)&UpdateModeTrampoline); PopRegs(true); } @@ -216,6 +221,8 @@ Compiler::Compiler() #ifdef _WIN32 DWORD dummy; VirtualProtect(pageAligned, alignedSize, PAGE_EXECUTE_READWRITE, &dummy); + #elif defined(__APPLE__) + pageAligned = (u8*)mmap(NULL, 1024*1024*32, PROT_READ | PROT_WRITE | PROT_EXEC, MAP_PRIVATE | MAP_ANONYMOUS ,-1, 0); #else mprotect(pageAligned, alignedSize, PROT_EXEC | PROT_READ | PROT_WRITE); #endif @@ -340,7 +347,7 @@ Compiler::Compiler() ABI_PushRegistersAndAdjustStack(CallerSavedPushRegs, 8); if (consoleType == 0) { - switch ((8 << size) | num) + switch ((8 << size) | num) { case 32: ABI_CallFunction(SlowWrite9<u32, 0>); break; case 33: ABI_CallFunction(SlowWrite7<u32, 0>); break; @@ -352,7 +359,7 @@ Compiler::Compiler() } else { - switch ((8 << size) | num) + switch ((8 << size) | num) { case 32: ABI_CallFunction(SlowWrite9<u32, 1>); break; case 33: ABI_CallFunction(SlowWrite7<u32, 1>); break; @@ -375,7 +382,7 @@ Compiler::Compiler() ABI_PushRegistersAndAdjustStack(CallerSavedPushRegs, 8); if (consoleType == 0) { - switch ((8 << size) | num) + switch ((8 << size) | num) { case 32: ABI_CallFunction(SlowRead9<u32, 0>); break; case 33: ABI_CallFunction(SlowRead7<u32, 0>); break; @@ -387,7 +394,7 @@ Compiler::Compiler() } else { - switch ((8 << size) | num) + switch ((8 << size) | num) { case 32: ABI_CallFunction(SlowRead9<u32, 1>); break; case 33: ABI_CallFunction(SlowRead7<u32, 1>); break; @@ -612,9 +619,9 @@ void Compiler::Reset() LoadStorePatches.clear(); } -bool Compiler::IsJITFault(u64 addr) +bool Compiler::IsJITFault(u8* addr) { - return addr >= (u64)CodeMemory && addr < (u64)CodeMemory + sizeof(CodeMemory); + return (u64)addr >= (u64)ResetStart && (u64)addr < (u64)ResetStart + CodeMemSize; } void Compiler::Comp_SpecialBranchBehaviour(bool taken) @@ -896,5 +903,4 @@ void Compiler::Comp_AddCycles_CD() else ConstantCycles += cycles; } - -}
\ No newline at end of file +} |