From 97c9cb5882552b2cc5a404f49ffb864ab5e31b21 Mon Sep 17 00:00:00 2001 From: comex Date: Wed, 17 Sep 2014 21:10:43 -0400 Subject: [PATCH 1/3] Add missing push wrapper around UpdatePerformanceMonitor --- Source/Core/Core/PowerPC/Jit64/Jit.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Source/Core/Core/PowerPC/Jit64/Jit.cpp b/Source/Core/Core/PowerPC/Jit64/Jit.cpp index 92595f6acd..b774881bb8 100644 --- a/Source/Core/Core/PowerPC/Jit64/Jit.cpp +++ b/Source/Core/Core/PowerPC/Jit64/Jit.cpp @@ -330,7 +330,9 @@ bool Jit64::Cleanup() // SPEED HACK: MMCR0/MMCR1 should be checked at run-time, not at compile time. if (MMCR0.Hex || MMCR1.Hex) { + ABI_PushRegistersAndAdjustStack(0, 0); ABI_CallFunctionCCC((void *)&PowerPC::UpdatePerformanceMonitor, js.downcountAmount, jit->js.numLoadStoreInst, jit->js.numFloatingPointInst); + ABI_PopRegistersAndAdjustStack(0, 0); did_something = true; } From 6695b5acce8b89dbfb434ada33f97cdc5e61bc0c Mon Sep 17 00:00:00 2001 From: comex Date: Wed, 17 Sep 2014 22:30:20 -0400 Subject: [PATCH 2/3] Fix backwards #ifdef. --- Source/Core/Core/PowerPC/Jit64/Jit.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Core/Core/PowerPC/Jit64/Jit.cpp b/Source/Core/Core/PowerPC/Jit64/Jit.cpp index b774881bb8..30a5f7bb01 100644 --- a/Source/Core/Core/PowerPC/Jit64/Jit.cpp +++ b/Source/Core/Core/PowerPC/Jit64/Jit.cpp @@ -129,7 +129,7 @@ enum void Jit64::AllocStack() { -#if defined(_WIN32) +#ifndef _WIN32 m_stack = (u8*)AllocateMemoryPages(STACK_SIZE); ReadProtectMemory(m_stack, GUARD_SIZE); ReadProtectMemory(m_stack + GUARD_OFFSET, GUARD_SIZE); @@ -138,7 +138,7 @@ void Jit64::AllocStack() void Jit64::FreeStack() { -#if defined(_WIN32) +#ifndef _WIN32 if (m_stack) { FreeMemoryPages(m_stack, STACK_SIZE); From 217758b607ff270582af31a88c86052d0656444c Mon Sep 17 00:00:00 2001 From: comex Date: Wed, 17 Sep 2014 22:30:33 -0400 Subject: [PATCH 3/3] Correct inaccurate comment. --- Source/Core/Core/PowerPC/Jit64/Jit.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Source/Core/Core/PowerPC/Jit64/Jit.cpp b/Source/Core/Core/PowerPC/Jit64/Jit.cpp index 30a5f7bb01..f191f2efa5 100644 --- a/Source/Core/Core/PowerPC/Jit64/Jit.cpp +++ b/Source/Core/Core/PowerPC/Jit64/Jit.cpp @@ -116,8 +116,7 @@ using namespace PowerPC; // accessed, immediately turn into regular pages but cause a trap... but // putting them in the path of RSP just leads to something (in the kernel?) // thinking a regular stack extension is required. So this protection is not -// supported on Windows yet... We still use a separate stack for the sake of -// simplicity. +// supported on Windows yet... enum {