Skip to content

Commit

Permalink
Fix sys_process_exit2 when SPUs are at av handler
Browse files Browse the repository at this point in the history
  • Loading branch information
elad335 committed Mar 13, 2019
1 parent 58a2f16 commit 4afdaf6
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
19 changes: 18 additions & 1 deletion Utilities/Thread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1394,7 +1394,24 @@ bool handle_access_violation(u32 addr, bool is_writing, x64_context* context)
return true;
}

vm::temporary_unlock(*cpu);
if (cpu->id_type() == 2)
{
LOG_FATAL(MEMORY, "Access violation %s location 0x%x", is_writing ? "writing" : "reading", addr);

// TODO:
// RawSPU: Send appropriate interrupt
// SPUThread: Send sys_spu exception event
cpu->state += cpu_flag::dbg_pause;
if (cpu->check_state())
{
static_cast<spu_thread*>(cpu)->cpu_stop();
throw cpu_flag::exit;
}
}
else
{
lv2_obj::sleep(*cpu);
}
}

LOG_FATAL(MEMORY, "Access violation %s location 0x%x", is_writing ? "writing" : "reading", addr);
Expand Down
2 changes: 1 addition & 1 deletion rpcs3/Emu/CPU/CPUThread.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "stdafx.h"
#include "stdafx.h"
#include "Emu/System.h"
#include "Emu/Memory/vm.h"
#include "CPUThread.h"
Expand Down

0 comments on commit 4afdaf6

Please sign in to comment.