Skip to content

Commit 5fac750

Browse files
committed
Cdvdman: Check if we need to reschedule thread after processing command end.
1 parent bf7e270 commit 5fac750

File tree

3 files changed

+13
-7
lines changed

3 files changed

+13
-7
lines changed

Source/iop/IopBios.cpp

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1856,6 +1856,16 @@ void CIopBios::UnlinkThread(uint32 threadId)
18561856
}
18571857
}
18581858

1859+
void CIopBios::CheckReschedule()
1860+
{
1861+
if(m_rescheduleNeeded)
1862+
{
1863+
assert((m_cpu.m_State.nCOP0[CCOP_SCU::STATUS] & CMIPS::STATUS_EXL) == 0);
1864+
m_rescheduleNeeded = false;
1865+
Reschedule();
1866+
}
1867+
}
1868+
18591869
void CIopBios::Reschedule()
18601870
{
18611871
if((m_cpu.m_State.nCOP0[CCOP_SCU::STATUS] & CMIPS::STATUS_EXL) != 0)
@@ -3323,13 +3333,7 @@ void CIopBios::HandleException()
33233333
}
33243334
}
33253335

3326-
if(m_rescheduleNeeded)
3327-
{
3328-
assert((m_cpu.m_State.nCOP0[CCOP_SCU::STATUS] & CMIPS::STATUS_EXL) == 0);
3329-
m_rescheduleNeeded = false;
3330-
Reschedule();
3331-
}
3332-
3336+
CheckReschedule();
33333337
m_cpu.m_State.nHasException = 0;
33343338
}
33353339

Source/iop/IopBios.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@ class CIopBios : public Iop::CBiosBase
187187
void HandleInterrupt() override;
188188

189189
void Reschedule();
190+
void CheckReschedule();
190191

191192
void CountTicks(uint32) override;
192193
uint64 GetCurrentTime() const;

Source/iop/Iop_Cdvdman.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -426,6 +426,7 @@ void CCdvdman::CountTicks(uint32 ticks)
426426
break;
427427
}
428428
m_bios.ReleaseWaitCdSync();
429+
m_bios.CheckReschedule();
429430
m_status = CDVD_STATUS_PAUSED;
430431
m_pendingCommand = COMMAND_NONE;
431432
}

0 commit comments

Comments
 (0)