mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-06 15:01:28 +12:00
Fixed TLS for PPU threads
This commit is contained in:
parent
2be045593a
commit
4ea1b8cffc
4 changed files with 72 additions and 3 deletions
|
@ -15,6 +15,9 @@
|
|||
|
||||
u64 rotate_mask[64][64];
|
||||
|
||||
extern u32 ppu_get_tls(u32 thread);
|
||||
extern void ppu_free_tls(u32 thread);
|
||||
|
||||
PPUThread& GetCurrentPPUThread()
|
||||
{
|
||||
PPCThread* thread = GetCurrentPPCThread();
|
||||
|
@ -32,6 +35,7 @@ PPUThread::PPUThread() : PPCThread(CPU_THREAD_PPU)
|
|||
|
||||
PPUThread::~PPUThread()
|
||||
{
|
||||
ppu_free_tls(GetId());
|
||||
}
|
||||
|
||||
void PPUThread::DoReset()
|
||||
|
@ -92,7 +96,7 @@ void PPUThread::InitRegs()
|
|||
GPR[2] = rtoc;
|
||||
//GPR[11] = entry;
|
||||
//GPR[12] = Emu.GetMallocPageSize();
|
||||
GPR[13] = Memory.PRXMem.GetStartAddr() + 0x7060;
|
||||
GPR[13] = ppu_get_tls(GetId()) + 0x7000; // 0x7000 is usually subtracted from r13 to access first TLS element (details are not clear)
|
||||
|
||||
LR = Emu.GetCPUThreadExit();
|
||||
CTR = PC;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue