Skip to content

Commit

Permalink
SPU DMA: Fix PUTLLUC (TSX)
Browse files Browse the repository at this point in the history
Prevent edge case of missing store.
  • Loading branch information
Nekotekina committed Apr 29, 2020
1 parent f4f0fb8 commit 19acf26
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
5 changes: 4 additions & 1 deletion rpcs3/Emu/CPU/CPUThread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -645,7 +645,10 @@ cpu_thread::suspend_all::suspend_all(cpu_thread* _this) noexcept

for_all_cpu([](cpu_thread* cpu)
{
cpu->state += cpu_flag::pause;
if (!(cpu->state & cpu_flag::pause))
{
cpu->state += cpu_flag::pause;
}
});

busy_wait(500);
Expand Down
17 changes: 17 additions & 0 deletions rpcs3/Emu/Cell/SPUThread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1600,6 +1600,23 @@ void spu_thread::do_putlluc(const spu_mfc_cmd& args)
vm::reservation_acquire(addr, 128) += 64;
}
}
else if (result == 0)
{
cpu_thread::suspend_all cpu_lock(this);

while (vm::reservation_acquire(addr, 128).bts(6))
{
busy_wait(100);
}

while (vm::reservation_acquire(addr, 128) & 63)
{
busy_wait(100);
}

mov_rdata(vm::_ref<decltype(rdata)>(addr), to_write);
vm::reservation_acquire(addr, 128) += 64;
}
}
else
{
Expand Down

0 comments on commit 19acf26

Please sign in to comment.