PPU: Notify SPUs while waiting for its own state
This commit is contained in:
@@ -2297,6 +2297,27 @@ void ppu_thread::cpu_on_stop()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ppu_thread::cpu_wait(bs_t<cpu_flag> old)
|
||||||
|
{
|
||||||
|
// Meanwhile while waiting, notify SPU waiters
|
||||||
|
if (u32 addr = res_notify)
|
||||||
|
{
|
||||||
|
res_notify = 0;
|
||||||
|
|
||||||
|
if (res_notify_time == vm::reservation_notifier_count_index(addr).second)
|
||||||
|
{
|
||||||
|
vm::reservation_notifier_notify(addr);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (old != state)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
state.wait(old);
|
||||||
|
}
|
||||||
|
|
||||||
void ppu_thread::exec_task()
|
void ppu_thread::exec_task()
|
||||||
{
|
{
|
||||||
if (g_cfg.core.ppu_decoder != ppu_decoder_type::_static)
|
if (g_cfg.core.ppu_decoder != ppu_decoder_type::_static)
|
||||||
|
|||||||
@@ -150,6 +150,7 @@ public:
|
|||||||
virtual void cpu_task() override final;
|
virtual void cpu_task() override final;
|
||||||
virtual void cpu_sleep() override;
|
virtual void cpu_sleep() override;
|
||||||
virtual void cpu_on_stop() override;
|
virtual void cpu_on_stop() override;
|
||||||
|
virtual void cpu_wait(bs_t<cpu_flag> old) override;
|
||||||
virtual ~ppu_thread() override;
|
virtual ~ppu_thread() override;
|
||||||
|
|
||||||
SAVESTATE_INIT_POS(3);
|
SAVESTATE_INIT_POS(3);
|
||||||
|
|||||||
@@ -387,6 +387,9 @@ namespace vm
|
|||||||
ok = false;
|
ok = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Do some CPU work
|
||||||
|
cpu.cpu_wait(+cpu_flag::exit);
|
||||||
|
|
||||||
if (!ok || cpu.state & cpu_flag::memory)
|
if (!ok || cpu.state & cpu_flag::memory)
|
||||||
{
|
{
|
||||||
for (u64 i = 0;; i++)
|
for (u64 i = 0;; i++)
|
||||||
|
|||||||
Reference in New Issue
Block a user