diff options
| author | hrydgard <hrydgard@gmail.com> | 2010-02-14 22:37:46 +0000 |
|---|---|---|
| committer | hrydgard <hrydgard@gmail.com> | 2010-02-14 22:37:46 +0000 |
| commit | b245c398a36c07575fcbce4f2cd87640aed8a0a9 (patch) | |
| tree | 7a8ac6ee7d9f9f274a3d999c9a82d7fb563f506f /Source | |
| parent | 14bb1b5f01b20de9c802b5d03de5490f45e72fd1 (diff) | |
keep a few separate thunkmanagers so they don't all share the same register backup area. seems to fix the single-core-paired-single-x64 issue in mario kart wii, please test the other games that were problematic.
this is probably not the best way to fix it but it'll do for now.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5062 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source')
| -rw-r--r-- | Source/Core/Common/Src/Thunk.cpp | 2 | ||||
| -rw-r--r-- | Source/Core/Common/Src/Thunk.h | 14 | ||||
| -rw-r--r-- | Source/Core/Core/Src/HW/HW.cpp | 2 | ||||
| -rw-r--r-- | Source/Core/Core/Src/PowerPC/Jit64IL/IR_X86.cpp | 2 | ||||
| -rw-r--r-- | Source/Core/Core/Src/PowerPC/JitCommon/JitAsmCommon.h | 4 | ||||
| -rw-r--r-- | Source/Core/Core/Src/PowerPC/JitCommon/JitBackpatch.h | 3 | ||||
| -rw-r--r-- | Source/Core/Core/Src/PowerPC/JitCommon/Jit_Util.h | 3 |
7 files changed, 21 insertions, 9 deletions
diff --git a/Source/Core/Common/Src/Thunk.cpp b/Source/Core/Common/Src/Thunk.cpp index aad55cb3c4..1792df3e77 100644 --- a/Source/Core/Common/Src/Thunk.cpp +++ b/Source/Core/Common/Src/Thunk.cpp @@ -23,8 +23,6 @@ #include "ABI.h" #include "Thunk.h" -ThunkManager thunks; - #define THUNK_ARENA_SIZE 1024*1024*1 namespace diff --git a/Source/Core/Common/Src/Thunk.h b/Source/Core/Common/Src/Thunk.h index 44cfc0c4cb..ac40babe4c 100644 --- a/Source/Core/Common/Src/Thunk.h +++ b/Source/Core/Common/Src/Thunk.h @@ -43,13 +43,17 @@ class ThunkManager : public Gen::XCodeBlock const u8 *load_regs; public: + ThunkManager() { + Init(); + } + ~ThunkManager() { + Shutdown(); + } + void *ProtectFunction(void *function, int num_params); +private: void Init(); - void Reset(); void Shutdown(); - - void *ProtectFunction(void *function, int num_params); + void Reset(); }; -extern ThunkManager thunks; - #endif // _THUNK_H_ diff --git a/Source/Core/Core/Src/HW/HW.cpp b/Source/Core/Core/Src/HW/HW.cpp index f049b61d31..70f6ae21fd 100644 --- a/Source/Core/Core/Src/HW/HW.cpp +++ b/Source/Core/Core/Src/HW/HW.cpp @@ -45,7 +45,6 @@ namespace HW { CoreTiming::Init(); - thunks.Init(); // not really hw, but this way we know it's inited early :P State_Init(); // Init the whole Hardware @@ -85,7 +84,6 @@ namespace HW } State_Shutdown(); - thunks.Shutdown(); CoreTiming::Shutdown(); } diff --git a/Source/Core/Core/Src/PowerPC/Jit64IL/IR_X86.cpp b/Source/Core/Core/Src/PowerPC/Jit64IL/IR_X86.cpp index 4431ff361e..73f34abd77 100644 --- a/Source/Core/Core/Src/PowerPC/Jit64IL/IR_X86.cpp +++ b/Source/Core/Core/Src/PowerPC/Jit64IL/IR_X86.cpp @@ -48,6 +48,8 @@ The register allocation is just a simple forward greedy allocator. #include "../../ConfigManager.h" #include "x64Emitter.h" +static ThunkManager thunks; + using namespace IREmitter; using namespace Gen; diff --git a/Source/Core/Core/Src/PowerPC/JitCommon/JitAsmCommon.h b/Source/Core/Core/Src/PowerPC/JitCommon/JitAsmCommon.h index 4943f43ed1..38646b05bd 100644 --- a/Source/Core/Core/Src/PowerPC/JitCommon/JitAsmCommon.h +++ b/Source/Core/Core/Src/PowerPC/JitCommon/JitAsmCommon.h @@ -19,6 +19,7 @@ #define _JITASMCOMMON_H
#include "../JitCommon/Jit_Util.h"
+#include "Thunk.h"
class CommonAsmRoutines : public EmuCodeBlock {
protected:
@@ -69,6 +70,9 @@ public: // In: ECX: Address to write to.
// In: XMM0: Bottom 32-bit slot holds the float to be written.
const u8 GC_ALIGNED16(*singleStoreQuantized[8]);
+
+private:
+ ThunkManager thunks;
};
#endif
diff --git a/Source/Core/Core/Src/PowerPC/JitCommon/JitBackpatch.h b/Source/Core/Core/Src/PowerPC/JitCommon/JitBackpatch.h index 9fca638d59..a99b07d74c 100644 --- a/Source/Core/Core/Src/PowerPC/JitCommon/JitBackpatch.h +++ b/Source/Core/Core/Src/PowerPC/JitCommon/JitBackpatch.h @@ -21,6 +21,7 @@ #include "Common.h"
#include "x64Emitter.h"
#include "x64Analyzer.h"
+#include "Thunk.h"
// Declarations and definitions
// ----------
@@ -53,6 +54,8 @@ public: const u8 *GetReadTrampoline(const InstructionInfo &info);
const u8 *GetWriteTrampoline(const InstructionInfo &info);
+private:
+ ThunkManager thunks;
};
#endif
diff --git a/Source/Core/Core/Src/PowerPC/JitCommon/Jit_Util.h b/Source/Core/Core/Src/PowerPC/JitCommon/Jit_Util.h index dbc730df17..b9f41bd259 100644 --- a/Source/Core/Core/Src/PowerPC/JitCommon/Jit_Util.h +++ b/Source/Core/Core/Src/PowerPC/JitCommon/Jit_Util.h @@ -19,6 +19,7 @@ #define _JITUTIL_H
#include "x64Emitter.h"
+#include "Thunk.h"
// Like XCodeBlock but has some utilities for memory access.
class EmuCodeBlock : public Gen::XCodeBlock {
@@ -39,6 +40,8 @@ public: void ForceSinglePrecisionS(Gen::X64Reg xmm);
void ForceSinglePrecisionP(Gen::X64Reg xmm);
+protected:
+ ThunkManager thunks;
};
#endif // _JITUTIL_H
|
