2013-07-12 14:42:17 +02:00
|
|
|
#pragma once
|
2015-08-02 04:15:49 +02:00
|
|
|
|
2013-07-12 14:42:17 +02:00
|
|
|
#include "SPUThread.h"
|
|
|
|
|
|
2015-07-01 00:25:52 +02:00
|
|
|
class RawSPUThread final : public SPUThread
|
2013-07-12 14:42:17 +02:00
|
|
|
{
|
2016-04-14 01:09:41 +02:00
|
|
|
void cpu_task() override;
|
|
|
|
|
|
2013-07-12 14:42:17 +02:00
|
|
|
public:
|
2016-04-14 01:09:41 +02:00
|
|
|
/* IdManager setups */
|
|
|
|
|
|
|
|
|
|
using id_base = RawSPUThread;
|
|
|
|
|
|
|
|
|
|
static constexpr u32 id_min = 0;
|
|
|
|
|
static constexpr u32 id_max = 4;
|
|
|
|
|
|
|
|
|
|
void on_init() override
|
|
|
|
|
{
|
|
|
|
|
if (!offset)
|
|
|
|
|
{
|
|
|
|
|
// Install correct SPU index and LS address
|
|
|
|
|
const_cast<u32&>(index) = id;
|
|
|
|
|
const_cast<u32&>(offset) = vm::falloc(RAW_SPU_BASE_ADDR + RAW_SPU_OFFSET * index, 0x40000);
|
|
|
|
|
ASSERT(offset);
|
|
|
|
|
|
|
|
|
|
SPUThread::on_init();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
RawSPUThread(const std::string& name)
|
|
|
|
|
: SPUThread(name)
|
|
|
|
|
{
|
|
|
|
|
}
|
2013-07-12 14:42:17 +02:00
|
|
|
|
2015-07-19 13:36:32 +02:00
|
|
|
bool read_reg(const u32 addr, u32& value);
|
|
|
|
|
bool write_reg(const u32 addr, const u32 value);
|
2013-07-12 14:42:17 +02:00
|
|
|
};
|