Skip to content

Commit

Permalink
KernelExplorer improved
Browse files Browse the repository at this point in the history
  • Loading branch information
Nekotekina committed Aug 24, 2015
1 parent e18db20 commit eb63558
Show file tree
Hide file tree
Showing 5 changed files with 161 additions and 109 deletions.
2 changes: 1 addition & 1 deletion rpcs3/Emu/CPU/CPUThread.h
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ class CPUThread : protected thread_t, public std::enable_shared_from_this<CPUThr
return "Unknown";
}

const char* ThreadStatusToString()
const char* ThreadStatusToString() const
{
// TODO

Expand Down
4 changes: 2 additions & 2 deletions rpcs3/Emu/Cell/SPUThread.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include "MFC.h"

struct lv2_event_queue_t;
struct spu_group_t;
struct lv2_spu_group_t;
struct lv2_int_tag_t;

// SPU Channels
Expand Down Expand Up @@ -581,7 +581,7 @@ class SPUThread : public CPUThread

std::array<spu_int_ctrl_t, 3> int_ctrl; // SPU Class 0, 1, 2 Interrupt Management

std::weak_ptr<spu_group_t> tg; // SPU Thread Group
std::weak_ptr<lv2_spu_group_t> tg; // SPU Thread Group

std::array<std::pair<u32, std::weak_ptr<lv2_event_queue_t>>, 32> spuq; // Event Queue Keys for SPU Thread
std::weak_ptr<lv2_event_queue_t> spup[64]; // SPU Ports
Expand Down
30 changes: 15 additions & 15 deletions rpcs3/Emu/SysCalls/lv2/sys_spu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ u32 spu_thread_initialize(u32 group_id, u32 spu_num, vm::ptr<sys_spu_image> img,

spu->custom_task = task;

const auto group = idm::get<spu_group_t>(group_id);
const auto group = idm::get<lv2_spu_group_t>(group_id);

spu->tg = group;
group->threads[spu_num] = spu;
Expand Down Expand Up @@ -140,7 +140,7 @@ s32 sys_spu_thread_initialize(vm::ptr<u32> thread, u32 group_id, u32 spu_num, vm

LV2_LOCK;

const auto group = idm::get<spu_group_t>(group_id);
const auto group = idm::get<lv2_spu_group_t>(group_id);

if (!group)
{
Expand Down Expand Up @@ -237,7 +237,7 @@ s32 sys_spu_thread_group_create(vm::ptr<u32> id, u32 num, s32 prio, vm::ptr<sys_
sys_spu.Todo("Unsupported SPU Thread Group type (0x%x)", attr->type);
}

*id = idm::make<spu_group_t>(std::string{ attr->name.get_ptr(), attr->nsize - 1 }, num, prio, attr->type, attr->ct);
*id = idm::make<lv2_spu_group_t>(std::string{ attr->name.get_ptr(), attr->nsize - 1 }, num, prio, attr->type, attr->ct);

return CELL_OK;
}
Expand All @@ -248,7 +248,7 @@ s32 sys_spu_thread_group_destroy(u32 id)

LV2_LOCK;

const auto group = idm::get<spu_group_t>(id);
const auto group = idm::get<lv2_spu_group_t>(id);

if (!group)
{
Expand All @@ -272,7 +272,7 @@ s32 sys_spu_thread_group_destroy(u32 id)
}

group->state = SPU_THREAD_GROUP_STATUS_NOT_INITIALIZED; // hack
idm::remove<spu_group_t>(id);
idm::remove<lv2_spu_group_t>(id);

return CELL_OK;
}
Expand All @@ -283,7 +283,7 @@ s32 sys_spu_thread_group_start(u32 id)

LV2_LOCK;

const auto group = idm::get<spu_group_t>(id);
const auto group = idm::get<lv2_spu_group_t>(id);

if (!group)
{
Expand Down Expand Up @@ -345,7 +345,7 @@ s32 sys_spu_thread_group_suspend(u32 id)

LV2_LOCK;

const auto group = idm::get<spu_group_t>(id);
const auto group = idm::get<lv2_spu_group_t>(id);

if (!group)
{
Expand Down Expand Up @@ -395,7 +395,7 @@ s32 sys_spu_thread_group_resume(u32 id)

LV2_LOCK;

const auto group = idm::get<spu_group_t>(id);
const auto group = idm::get<lv2_spu_group_t>(id);

if (!group)
{
Expand Down Expand Up @@ -438,7 +438,7 @@ s32 sys_spu_thread_group_yield(u32 id)

LV2_LOCK;

const auto group = idm::get<spu_group_t>(id);
const auto group = idm::get<lv2_spu_group_t>(id);

if (!group)
{
Expand All @@ -463,7 +463,7 @@ s32 sys_spu_thread_group_terminate(u32 id, s32 value)

// seems the id can be either SPU Thread Group or SPU Thread
const auto thread = idm::get<SPUThread>(id);
const auto group = thread ? thread->tg.lock() : idm::get<spu_group_t>(id);
const auto group = thread ? thread->tg.lock() : idm::get<lv2_spu_group_t>(id);

if (!group && !thread)
{
Expand Down Expand Up @@ -515,7 +515,7 @@ s32 sys_spu_thread_group_join(u32 id, vm::ptr<u32> cause, vm::ptr<u32> status)

LV2_LOCK;

const auto group = idm::get<spu_group_t>(id);
const auto group = idm::get<lv2_spu_group_t>(id);

if (!group)
{
Expand Down Expand Up @@ -794,7 +794,7 @@ s32 sys_spu_thread_group_connect_event(u32 id, u32 eq, u32 et)

LV2_LOCK;

const auto group = idm::get<spu_group_t>(id);
const auto group = idm::get<lv2_spu_group_t>(id);
const auto queue = idm::get<lv2_event_queue_t>(eq);

if (!group || !queue)
Expand Down Expand Up @@ -850,7 +850,7 @@ s32 sys_spu_thread_group_disconnect_event(u32 id, u32 et)

LV2_LOCK;

const auto group = idm::get<spu_group_t>(id);
const auto group = idm::get<lv2_spu_group_t>(id);

if (!group)
{
Expand Down Expand Up @@ -1038,7 +1038,7 @@ s32 sys_spu_thread_group_connect_event_all_threads(u32 id, u32 eq, u64 req, vm::

LV2_LOCK;

const auto group = idm::get<spu_group_t>(id);
const auto group = idm::get<lv2_spu_group_t>(id);
const auto queue = idm::get<lv2_event_queue_t>(eq);

if (!group || !queue)
Expand Down Expand Up @@ -1109,7 +1109,7 @@ s32 sys_spu_thread_group_disconnect_event_all_threads(u32 id, u8 spup)

LV2_LOCK;

const auto group = idm::get<spu_group_t>(id);
const auto group = idm::get<lv2_spu_group_t>(id);

if (!group)
{
Expand Down
4 changes: 2 additions & 2 deletions rpcs3/Emu/SysCalls/lv2/sys_spu.h
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ enum : u32

class SPUThread;

struct spu_group_t
struct lv2_spu_group_t
{
const std::string name;
const u32 num; // SPU Number
Expand All @@ -165,7 +165,7 @@ struct spu_group_t
std::weak_ptr<lv2_event_queue_t> ep_exception; // TODO: SYS_SPU_THREAD_GROUP_EVENT_EXCEPTION
std::weak_ptr<lv2_event_queue_t> ep_sysmodule; // TODO: SYS_SPU_THREAD_GROUP_EVENT_SYSTEM_MODULE

spu_group_t(std::string name, u32 num, s32 prio, s32 type, u32 ct)
lv2_spu_group_t(std::string name, u32 num, s32 prio, s32 type, u32 ct)
: name(name)
, num(num)
, prio(prio)
Expand Down
Loading

0 comments on commit eb63558

Please sign in to comment.