mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-03 21:41:26 +12:00
Savestates: Fix SPU pause from access violation handler
This commit is contained in:
parent
2eabc77deb
commit
7c313703a2
1 changed files with 30 additions and 0 deletions
|
@ -1260,6 +1260,36 @@ bool handle_access_violation(u32 addr, bool is_writing, ucontext_t* context) noe
|
||||||
|
|
||||||
const auto cpu = get_current_cpu_thread();
|
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)
|
if (addr < RAW_SPU_BASE_ADDR && vm::check_addr(addr) && rsx::g_access_violation_handler)
|
||||||
{
|
{
|
||||||
bool state_changed = false;
|
bool state_changed = false;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue