1
0
mirror of https://github.com/RPCS3/rpcs3.git synced 2024-11-22 18:53:28 +01:00

RSX: fix rsx::nv406e::semaphore_release partially

Properly release reservation (non-TSX path).
At least update and notify reservation (TSX).
This commit is contained in:
Nekotekina 2020-10-15 20:43:08 +03:00
parent facde63460
commit 492ed27495

View File

@ -147,21 +147,33 @@ namespace rsx
const u32 addr = get_address(offset, ctxt, HERE);
atomic_t<u64>* res{};
bool upd = false;
// TODO: Check if possible to write on reservations
if (!g_use_rtm && rsx->label_addr >> 28 != addr >> 28) [[likely]]
if (rsx->label_addr >> 28 != addr >> 28)
{
res = &vm::reservation_lock(addr).first;
if (g_use_rtm)
{
upd = true;
}
else
{
res = &vm::reservation_lock(addr).first;
}
}
vm::_ref<RsxSemaphore>(addr).val = arg;
if (res)
{
res += 64;
res->fetch_add(64);
res->notify_all();
}
else if (upd)
{
// TODO: simply writing semaphore from RSX thread is wrong on TSX path
vm::reservation_update(addr);
}
vm::reservation_notifier(addr, 4).notify_all();
}
}