mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-06 23:11:25 +12:00
[SPU, TSX] Fix reservation corruption in PUTLLC
Change reservation locking logic.
This commit is contained in:
parent
3ad743ecaa
commit
49e96b39dd
2 changed files with 32 additions and 31 deletions
|
@ -1137,14 +1137,9 @@ extern bool ppu_stwcx(ppu_thread& ppu, u32 addr, u32 reg_value)
|
|||
|
||||
auto& res = vm::reservation_acquire(addr, sizeof(u32));
|
||||
|
||||
const auto [_, ok] = res.fetch_op([&](u64& reserv)
|
||||
{
|
||||
return (++reserv & -128) == ppu.rtime;
|
||||
});
|
||||
|
||||
ppu.raddr = 0;
|
||||
|
||||
if (ok)
|
||||
if (res == ppu.rtime && res.compare_and_swap_test(ppu.rtime, ppu.rtime | 1))
|
||||
{
|
||||
if (data.compare_and_swap_test(old_data, reg_value))
|
||||
{
|
||||
|
@ -1258,14 +1253,9 @@ extern bool ppu_stdcx(ppu_thread& ppu, u32 addr, u64 reg_value)
|
|||
|
||||
auto& res = vm::reservation_acquire(addr, sizeof(u64));
|
||||
|
||||
const auto [_, ok] = res.fetch_op([&](u64& reserv)
|
||||
{
|
||||
return (++reserv & -128) == ppu.rtime;
|
||||
});
|
||||
|
||||
ppu.raddr = 0;
|
||||
|
||||
if (ok)
|
||||
if (res == ppu.rtime && res.compare_and_swap_test(ppu.rtime, ppu.rtime | 1))
|
||||
{
|
||||
if (data.compare_and_swap_test(old_data, reg_value))
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue