rpcs3/rpcs3/Emu/Cell/PPCThread.cpp
Peter Tissen 21da317453 Logging system rework
* use one central unified log with channels/priorities ad-hoc listener registration and de-registration
* disable buffering by default
* add multi-threaded ringbuffer implementation
* use buffered listener for the gui (using the ringbuffer)
2014-06-26 17:34:28 +02:00

48 lines
999 B
C++

#include "stdafx.h"
#include "Utilities/Log.h"
#include "Emu/Memory/Memory.h"
#include "Emu/System.h"
#include "PPCThread.h"
PPCThread* GetCurrentPPCThread()
{
CPUThread* thread = GetCurrentCPUThread();
if(!thread || (thread->GetType() != CPU_THREAD_PPU && thread->GetType() != CPU_THREAD_SPU && thread->GetType() != CPU_THREAD_RAW_SPU))
{
throw std::string("GetCurrentPPCThread: bad thread");
}
return (PPCThread*)thread;
}
PPCThread::PPCThread(CPUThreadType type) : CPUThread(type)
{
memset(m_args, 0, sizeof(m_args));
}
PPCThread::~PPCThread()
{
}
void PPCThread::DoReset()
{
}
void PPCThread::InitStack()
{
if(m_stack_addr) return;
if(m_stack_size == 0) m_stack_size = 0x10000;
m_stack_addr = Memory.StackMem.AllocAlign(m_stack_size, 0x100);
m_stack_point = m_stack_addr + m_stack_size;
/*
m_stack_point += m_stack_size - 0x10;
m_stack_point &= -0x10;
Memory.Write64(m_stack_point, 0);
m_stack_point -= 0x60;
Memory.Write64(m_stack_point, m_stack_point + 0x60);
*/
}