IdManager improved

lv2_obj for kernel objects
Simple lookup (vector)
Another idm API refactoring
This commit is contained in:
Nekotekina 2017-01-29 19:50:18 +03:00
parent be8d8ded3f
commit b21fce4d6f
52 changed files with 812 additions and 765 deletions

View file

@ -14,7 +14,7 @@ logs::channel sys_timer("sys_timer", logs::level::notice);
extern u64 get_system_time();
void lv2_timer_t::on_task()
void lv2_timer::on_task()
{
//thread_lock lock(*this);
LV2_LOCK;
@ -57,12 +57,12 @@ void lv2_timer_t::on_task()
}
}
std::string lv2_timer_t::get_name() const
std::string lv2_timer::get_name() const
{
return fmt::format("Timer Thread[0x%x]", id);
}
void lv2_timer_t::on_stop()
void lv2_timer::on_stop()
{
// Signal thread using invalid state and join
state = -1;
@ -74,7 +74,7 @@ s32 sys_timer_create(vm::ptr<u32> timer_id)
{
sys_timer.warning("sys_timer_create(timer_id=*0x%x)", timer_id);
*timer_id = idm::make<lv2_timer_t>();
*timer_id = idm::make<lv2_obj, lv2_timer>();
return CELL_OK;
}
@ -85,7 +85,7 @@ s32 sys_timer_destroy(u32 timer_id)
LV2_LOCK;
const auto timer = idm::get<lv2_timer_t>(timer_id);
const auto timer = idm::get<lv2_obj, lv2_timer>(timer_id);
if (!timer)
{
@ -97,7 +97,7 @@ s32 sys_timer_destroy(u32 timer_id)
return CELL_EISCONN;
}
idm::remove<lv2_timer_t>(timer_id);
idm::remove<lv2_obj, lv2_timer>(timer_id);
return CELL_OK;
}
@ -108,7 +108,7 @@ s32 sys_timer_get_information(u32 timer_id, vm::ptr<sys_timer_information_t> inf
LV2_LOCK;
const auto timer = idm::get<lv2_timer_t>(timer_id);
const auto timer = idm::get<lv2_obj, lv2_timer>(timer_id);
if (!timer)
{
@ -131,7 +131,7 @@ s32 _sys_timer_start(u32 timer_id, u64 base_time, u64 period)
LV2_LOCK;
const auto timer = idm::get<lv2_timer_t>(timer_id);
const auto timer = idm::get<lv2_obj, lv2_timer>(timer_id);
if (!timer)
{
@ -182,7 +182,7 @@ s32 sys_timer_stop(u32 timer_id)
LV2_LOCK;
const auto timer = idm::get<lv2_timer_t>(timer_id);
const auto timer = idm::get<lv2_obj, lv2_timer>(timer_id);
if (!timer)
{
@ -200,8 +200,8 @@ s32 sys_timer_connect_event_queue(u32 timer_id, u32 queue_id, u64 name, u64 data
LV2_LOCK;
const auto timer = idm::get<lv2_timer_t>(timer_id);
const auto queue = idm::get<lv2_event_queue_t>(queue_id);
const auto timer = idm::get<lv2_obj, lv2_timer>(timer_id);
const auto queue = idm::get<lv2_obj, lv2_event_queue>(queue_id);
if (!timer || !queue)
{
@ -227,7 +227,7 @@ s32 sys_timer_disconnect_event_queue(u32 timer_id)
LV2_LOCK;
const auto timer = idm::get<lv2_timer_t>(timer_id);
const auto timer = idm::get<lv2_obj, lv2_timer>(timer_id);
if (!timer)
{