From f1ef51abc89f181bf519400ee1e07dddefd7cbec Mon Sep 17 00:00:00 2001 From: James Dunne Date: Thu, 14 Mar 2013 01:08:26 -0500 Subject: [PATCH] Removing `Core::IsGPUThread()` and `Core::IsCPUThread()` calls in favor of simple `bool isCPUThread` parameter value. --- .../Core/VideoCommon/Src/CommandProcessor.cpp | 18 ++++++++++-------- Source/Core/VideoCommon/Src/CommandProcessor.h | 2 +- Source/Core/VideoCommon/Src/memcpy_amd.cpp | 4 ++-- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/Source/Core/VideoCommon/Src/CommandProcessor.cpp b/Source/Core/VideoCommon/Src/CommandProcessor.cpp index eb03730fc3..21bfaa5f7e 100644 --- a/Source/Core/VideoCommon/Src/CommandProcessor.cpp +++ b/Source/Core/VideoCommon/Src/CommandProcessor.cpp @@ -468,7 +468,7 @@ void STACKALIGN GatherPipeBursted() } if (IsOnThread()) - SetCpStatus(); + SetCpStatus(true); // update the fifo-pointer if (fifo.CPWritePointer >= fifo.CPEnd) @@ -518,14 +518,14 @@ void AbortFrame() } -void SetCpStatus() +void SetCpStatus(bool isCPUThread) { // overflow & underflow check fifo.bFF_HiWatermark = (fifo.CPReadWriteDistance > fifo.CPHiWatermark); fifo.bFF_LoWatermark = (fifo.CPReadWriteDistance < fifo.CPLoWatermark); - + // breakpoint - if (Core::IsGPUThread()) + if (!isCPUThread) { if (fifo.bFF_BPEnable) { @@ -556,7 +556,7 @@ void SetCpStatus() bool bpInt = fifo.bFF_Breakpoint && fifo.bFF_BPInt; bool ovfInt = fifo.bFF_HiWatermark && fifo.bFF_HiWatermarkInt; bool undfInt = fifo.bFF_LoWatermark && fifo.bFF_LoWatermarkInt; - + bool interrupt = (bpInt || ovfInt || undfInt) && m_CPCtrlReg.GPReadEnable; isHiWatermarkActive = ovfInt && m_CPCtrlReg.GPReadEnable; @@ -567,15 +567,17 @@ void SetCpStatus() u64 userdata = interrupt?1:0; if (IsOnThread()) { - if(!interrupt || bpInt || undfInt || ovfInt) + if (!interrupt || bpInt || undfInt || ovfInt) { - if (Core::IsGPUThread()) + if (!isCPUThread) { + // GPU thread: interruptWaiting = true; CommandProcessor::UpdateInterruptsFromVideoBackend(userdata); } - else if (Core::IsCPUThread()) + else { + // CPU thread: interruptSet = interrupt; INFO_LOG(COMMANDPROCESSOR,"Interrupt set"); ProcessorInterface::SetInterrupt(INT_CAUSE_CP, interrupt); diff --git a/Source/Core/VideoCommon/Src/CommandProcessor.h b/Source/Core/VideoCommon/Src/CommandProcessor.h index 6190c48e14..5aa49ac3e8 100644 --- a/Source/Core/VideoCommon/Src/CommandProcessor.h +++ b/Source/Core/VideoCommon/Src/CommandProcessor.h @@ -155,7 +155,7 @@ void Write16(const u16 _Data, const u32 _Address); void Read32(u32& _rReturnValue, const u32 _Address); void Write32(const u32 _Data, const u32 _Address); -void SetCpStatus(); +void SetCpStatus(bool isCPUThread = false); void GatherPipeBursted(); void UpdateInterrupts(u64 userdata); void UpdateInterruptsFromVideoBackend(u64 userdata); diff --git a/Source/Core/VideoCommon/Src/memcpy_amd.cpp b/Source/Core/VideoCommon/Src/memcpy_amd.cpp index 4bc3012e81..bd393560d4 100644 --- a/Source/Core/VideoCommon/Src/memcpy_amd.cpp +++ b/Source/Core/VideoCommon/Src/memcpy_amd.cpp @@ -465,8 +465,8 @@ End: void * memcpy_amd(void *dest, const void *src, size_t n) { -memcpy(dest, src, n); -return dest; + memcpy(dest, src, n); + return dest; }