mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-04 05:51:27 +12:00
sys_interrupt: Save ID of self tag/handler
This commit is contained in:
parent
363cc60c82
commit
1e1880893a
3 changed files with 20 additions and 20 deletions
|
@ -9,6 +9,19 @@
|
||||||
|
|
||||||
LOG_CHANNEL(sys_interrupt);
|
LOG_CHANNEL(sys_interrupt);
|
||||||
|
|
||||||
|
lv2_int_tag::lv2_int_tag() noexcept
|
||||||
|
: id(idm::last_id())
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
lv2_int_serv::lv2_int_serv(const std::shared_ptr<named_thread<ppu_thread>>& thread, u64 arg1, u64 arg2) noexcept
|
||||||
|
: id(idm::last_id())
|
||||||
|
, thread(thread)
|
||||||
|
, arg1(arg1)
|
||||||
|
, arg2(arg2)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
void lv2_int_serv::exec() const
|
void lv2_int_serv::exec() const
|
||||||
{
|
{
|
||||||
thread->cmd_list
|
thread->cmd_list
|
||||||
|
|
|
@ -10,23 +10,22 @@ struct lv2_int_tag final : lv2_obj
|
||||||
{
|
{
|
||||||
static const u32 id_base = 0x0a000000;
|
static const u32 id_base = 0x0a000000;
|
||||||
|
|
||||||
|
const u32 id;
|
||||||
std::weak_ptr<struct lv2_int_serv> handler;
|
std::weak_ptr<struct lv2_int_serv> handler;
|
||||||
|
|
||||||
|
lv2_int_tag() noexcept;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct lv2_int_serv final : lv2_obj
|
struct lv2_int_serv final : lv2_obj
|
||||||
{
|
{
|
||||||
static const u32 id_base = 0x0b000000;
|
static const u32 id_base = 0x0b000000;
|
||||||
|
|
||||||
|
const u32 id;
|
||||||
const std::shared_ptr<named_thread<ppu_thread>> thread;
|
const std::shared_ptr<named_thread<ppu_thread>> thread;
|
||||||
const u64 arg1;
|
const u64 arg1;
|
||||||
const u64 arg2;
|
const u64 arg2;
|
||||||
|
|
||||||
lv2_int_serv(const std::shared_ptr<named_thread<ppu_thread>>& thread, u64 arg1, u64 arg2)
|
lv2_int_serv(const std::shared_ptr<named_thread<ppu_thread>>& thread, u64 arg1, u64 arg2) noexcept;
|
||||||
: thread(thread)
|
|
||||||
, arg1(arg1)
|
|
||||||
, arg2(arg2)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void exec() const;
|
void exec() const;
|
||||||
void join() const;
|
void join() const;
|
||||||
|
|
|
@ -1948,25 +1948,13 @@ error_code raw_spu_destroy(ppu_thread& ppu, u32 id)
|
||||||
// SLEEP
|
// SLEEP
|
||||||
lv2_obj::sleep(ppu);
|
lv2_obj::sleep(ppu);
|
||||||
handler->join();
|
handler->join();
|
||||||
to_remove.emplace_back(std::move(handler), 0);
|
to_remove.emplace_back(std::move(handler), +handler->id);
|
||||||
}
|
}
|
||||||
|
|
||||||
to_remove.emplace_back(std::move(tag), 0);
|
to_remove.emplace_back(std::move(tag), +tag->id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Scan all kernel objects to determine IDs
|
|
||||||
idm::select<lv2_obj>([&](u32 id, lv2_obj& obj)
|
|
||||||
{
|
|
||||||
for (auto& pair : to_remove)
|
|
||||||
{
|
|
||||||
if (pair.first.get() == std::addressof(obj))
|
|
||||||
{
|
|
||||||
pair.second = id;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// Remove IDs
|
// Remove IDs
|
||||||
for (auto&& pair : to_remove)
|
for (auto&& pair : to_remove)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue