Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SPU DMA: Fix PUTLLUC (TSX) #8121

Merged
merged 1 commit into from Apr 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 4 additions & 1 deletion rpcs3/Emu/CPU/CPUThread.cpp
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
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