From 86f89cce923b7feda15439e3c3bcf4c20efbcc9b Mon Sep 17 00:00:00 2001 From: Soren Jorvang Date: Wed, 26 May 2010 21:21:12 +0000 Subject: [PATCH] Move 64-bit specific variables into proper scope. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5502 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/Core/Src/PowerPC/JitCommon/JitBackpatch.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Source/Core/Core/Src/PowerPC/JitCommon/JitBackpatch.cpp b/Source/Core/Core/Src/PowerPC/JitCommon/JitBackpatch.cpp index 3b6519260c..0ca076d12a 100644 --- a/Source/Core/Core/Src/PowerPC/JitCommon/JitBackpatch.cpp +++ b/Source/Core/Core/Src/PowerPC/JitCommon/JitBackpatch.cpp @@ -73,10 +73,11 @@ const u8 *TrampolineCache::GetReadTrampoline(const InstructionInfo &info) if (GetSpaceLeft() < 1024) PanicAlert("Trampoline cache full"); - X64Reg addrReg = (X64Reg)info.scaledReg; - X64Reg dataReg = (X64Reg)info.regOperandReg; const u8 *trampoline = GetCodePtr(); #ifdef _M_X64 + X64Reg addrReg = (X64Reg)info.scaledReg; + X64Reg dataReg = (X64Reg)info.regOperandReg; + // It's a read. Easy. ABI_PushAllCallerSavedRegsAndAdjustStack(); if (addrReg != ABI_PARAM1) @@ -102,7 +103,6 @@ const u8 *TrampolineCache::GetWriteTrampoline(const InstructionInfo &info) if (GetSpaceLeft() < 1024) PanicAlert("Trampoline cache full"); - X64Reg addrReg = (X64Reg)info.scaledReg; X64Reg dataReg = (X64Reg)info.regOperandReg; if (dataReg != EAX) PanicAlert("Backpatch write - not through EAX"); @@ -110,6 +110,7 @@ const u8 *TrampolineCache::GetWriteTrampoline(const InstructionInfo &info) const u8 *trampoline = GetCodePtr(); #ifdef _M_X64 + X64Reg addrReg = (X64Reg)info.scaledReg; // It's a write. Yay. Remember that we don't have to be super efficient since it's "just" a // hardware access - we can take shortcuts. @@ -151,9 +152,9 @@ const u8 *TrampolineCache::GetWriteTrampoline(const InstructionInfo &info) // that many of them in a typical program/game. const u8 *JitBase::BackPatch(u8 *codePtr, int accessType, u32 emAddress, void *ctx_void) { +#ifdef _M_X64 CONTEXT *ctx = (CONTEXT *)ctx_void; -#ifdef _M_X64 if (!jit->IsInCodeSpace(codePtr)) return 0; // this will become a regular crash real soon after this