mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-03 13:31:27 +12:00
sys_spu: Fix SPU Thread Id
* Removed wrong code in sys_spu_thread_group_terminate. * SPU Thread ID is accurate, including 5th thread id "rule". * Fixed possible use-after-free access of spu_thread::group member. * RawSPU ID management simplified.
This commit is contained in:
parent
e050dcbc52
commit
5631382623
7 changed files with 122 additions and 120 deletions
|
@ -1319,14 +1319,15 @@ bool handle_access_violation(u32 addr, bool is_writing, x64_context* context)
|
|||
{
|
||||
data2 = (SYS_MEMORY_PAGE_FAULT_TYPE_PPU_THREAD << 32) | cpu->id;
|
||||
}
|
||||
else if (static_cast<spu_thread*>(cpu)->group)
|
||||
{
|
||||
data2 = (SYS_MEMORY_PAGE_FAULT_TYPE_SPU_THREAD << 32) | cpu->id;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Index is the correct ID in RawSPU
|
||||
data2 = (SYS_MEMORY_PAGE_FAULT_TYPE_RAW_SPU << 32) | static_cast<spu_thread*>(cpu)->index;
|
||||
const auto& spu = static_cast<spu_thread&>(*cpu);
|
||||
|
||||
const u64 type = spu.offset < RAW_SPU_BASE_ADDR ?
|
||||
SYS_MEMORY_PAGE_FAULT_TYPE_SPU_THREAD :
|
||||
SYS_MEMORY_PAGE_FAULT_TYPE_RAW_SPU;
|
||||
|
||||
data2 = (type << 32) | spu.lv2_id;
|
||||
}
|
||||
|
||||
u64 data3;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue