From 0da086e38950f5f0f95ca25b0d97097503213365 Mon Sep 17 00:00:00 2001 From: Ryan Houdek Date: Sun, 10 May 2015 20:02:25 -0500 Subject: [PATCH] Make sure the JitInterface's WriteProfileResults instruction pauses and resumes the CPU core. --- Source/Core/Core/PowerPC/JitInterface.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Source/Core/Core/PowerPC/JitInterface.cpp b/Source/Core/Core/PowerPC/JitInterface.cpp index 876812e0bb..98cf0d00ed 100644 --- a/Source/Core/Core/PowerPC/JitInterface.cpp +++ b/Source/Core/Core/PowerPC/JitInterface.cpp @@ -120,6 +120,10 @@ namespace JitInterface if (!jit) return; + PowerPC::CPUState old_state = PowerPC::GetState(); + if (old_state == PowerPC::CPUState::CPU_RUNNING) + PowerPC::Pause(); + std::vector stats; stats.reserve(jit->GetBlockCache()->GetNumBlocks()); u64 cost_sum = 0; @@ -161,6 +165,9 @@ namespace JitInterface (double)block->ticCounter*1000.0/(double)countsPerSec, block->codeSize); } } + + if (old_state == PowerPC::CPUState::CPU_RUNNING) + PowerPC::Start(); } bool HandleFault(uintptr_t access_address, SContext* ctx) {