Fix vm::reservation_update

This commit is contained in:
Eladash 2020-08-15 07:56:34 +03:00 committed by Ivan
parent acee590733
commit ee953f7953
2 changed files with 29 additions and 2 deletions

View file

@ -79,6 +79,28 @@ namespace vm
// Memory pages
std::array<memory_page, 0x100000000 / 4096> g_pages{};
void reservation_update(u32 addr, u32 size, bool lsb)
{
u64 old = UINT64_MAX;
const auto cpu = get_current_cpu_thread();
while (true)
{
const auto [ok, rtime] = try_reservation_update(addr, size, lsb);
if (ok || old / 128 < rtime / 128)
{
return;
}
old = rtime;
if (cpu && cpu->test_stopped())
{
return;
}
}
}
static void _register_lock(cpu_thread* _cpu)
{
for (u32 i = 0, max = g_cfg.core.ppu_threads;;)