Removing `Core::IsGPUThread()` and `Core::IsCPUThread()` calls in favor of simple `bool isCPUThread` parameter value.

This commit is contained in:
James Dunne 2013-03-14 01:08:26 -05:00
parent 4137fc0023
commit f1ef51abc8
3 changed files with 13 additions and 11 deletions

View File

@ -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);

View File

@ -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);

View File

@ -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;
}