mirror of
https://github.com/RPCS3/rpcs3.git
synced 2024-11-22 02:32:36 +01:00
Savestates: Fix SPU pause from access violation handler
This commit is contained in:
parent
2eabc77deb
commit
7c313703a2
@ -1260,6 +1260,36 @@ bool handle_access_violation(u32 addr, bool is_writing, ucontext_t* context) noe
|
||||
|
||||
const auto cpu = get_current_cpu_thread();
|
||||
|
||||
struct spu_unsavable
|
||||
{
|
||||
spu_thread* _spu;
|
||||
|
||||
spu_unsavable(cpu_thread* cpu) noexcept
|
||||
: _spu(cpu ? cpu->try_get<spu_thread>() : nullptr)
|
||||
{
|
||||
if (_spu)
|
||||
{
|
||||
if (_spu->unsavable)
|
||||
{
|
||||
_spu = nullptr;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Must not be saved inside access violation handler because it is unpredictable
|
||||
_spu->unsavable = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
~spu_unsavable() noexcept
|
||||
{
|
||||
if (_spu)
|
||||
{
|
||||
_spu->unsavable = false;
|
||||
}
|
||||
}
|
||||
} spu_protection{cpu};
|
||||
|
||||
if (addr < RAW_SPU_BASE_ADDR && vm::check_addr(addr) && rsx::g_access_violation_handler)
|
||||
{
|
||||
bool state_changed = false;
|
||||
|
Loading…
Reference in New Issue
Block a user