Skip to content

Commit

Permalink
SPU/event queue: Implement protocol for SPU queue
Browse files Browse the repository at this point in the history
  • Loading branch information
elad335 authored and Nekotekina committed Aug 13, 2021
1 parent f1f93b8 commit 063df64
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 4 deletions.
10 changes: 10 additions & 0 deletions rpcs3/Emu/Cell/SPUThread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4835,6 +4835,16 @@ spu_thread::thread_name_t::operator std::string() const
return full_name;
}

spu_thread::priority_t::operator s32() const
{
if (_this->get_type() != spu_type::threaded || !_this->group->has_scheduler_context)
{
return s32{smax};
}

return _this->group->prio;
}

template <>
void fmt_class_string<spu_channel>::format(std::string& out, u64 arg)
{
Expand Down
8 changes: 8 additions & 0 deletions rpcs3/Emu/Cell/SPUThread.h
Original file line number Diff line number Diff line change
Expand Up @@ -857,6 +857,14 @@ class spu_thread : public cpu_thread

operator std::string() const;
} thread_name{ this };

// For lv2_obj::schedule<spu_thread>
const struct priority_t
{
const spu_thread* _this;

operator s32() const;
} prio{ this };
};

class spu_function_logger
Expand Down
5 changes: 1 addition & 4 deletions rpcs3/Emu/Cell/lv2/sys_event.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,7 @@ CellError lv2_event_queue::send(lv2_event event)
else
{
// Store event in In_MBox
auto& spu = static_cast<spu_thread&>(*sq.front());

// TODO: use protocol?
sq.pop_front();
auto& spu = static_cast<spu_thread&>(*schedule<spu_thread>(sq, protocol));

const u32 data1 = static_cast<u32>(std::get<1>(event));
const u32 data2 = static_cast<u32>(std::get<2>(event));
Expand Down

0 comments on commit 063df64

Please sign in to comment.