std::shared_ptr in IdManager

This commit is contained in:
Nekotekina 2014-12-24 02:38:13 +03:00
parent b2de24db73
commit d8239a39c9
47 changed files with 654 additions and 622 deletions

View file

@ -13,7 +13,8 @@ s32 sys_timer_create(vm::ptr<u32> timer_id)
{
sys_timer.Warning("sys_timer_create(timer_id_addr=0x%x)", timer_id.addr());
*timer_id = sys_timer.GetNewId(new timer, TYPE_TIMER);
std::shared_ptr<timer> timer_data(new timer);
*timer_id = sys_timer.GetNewId(timer_data, TYPE_TIMER);
return CELL_OK;
}
@ -31,7 +32,7 @@ s32 sys_timer_get_information(u32 timer_id, vm::ptr<sys_timer_information_t> inf
{
sys_timer.Warning("sys_timer_get_information(timer_id=%d, info_addr=0x%x)", timer_id, info.addr());
timer* timer_data = nullptr;
std::shared_ptr<timer> timer_data = nullptr;
if(!sys_timer.CheckId(timer_id, timer_data)) return CELL_ESRCH;
*info = timer_data->timer_information_t;
@ -42,7 +43,7 @@ s32 sys_timer_start(u32 timer_id, s64 base_time, u64 period)
{
sys_timer.Warning("sys_timer_start_periodic_absolute(timer_id=%d, basetime=%lld, period=%llu)", timer_id, base_time, period);
timer* timer_data = nullptr;
std::shared_ptr<timer> timer_data = nullptr;
if(!sys_timer.CheckId(timer_id, timer_data)) return CELL_ESRCH;
if(timer_data->timer_information_t.timer_state != SYS_TIMER_STATE_STOP) return CELL_EBUSY;
@ -66,7 +67,7 @@ s32 sys_timer_stop(u32 timer_id)
{
sys_timer.Todo("sys_timer_stop()");
timer* timer_data = nullptr;
std::shared_ptr<timer> timer_data = nullptr;
if(!sys_timer.CheckId(timer_id, timer_data)) return CELL_ESRCH;
timer_data->timer_information_t.timer_state = SYS_TIMER_STATE_STOP;
@ -78,8 +79,8 @@ s32 sys_timer_connect_event_queue(u32 timer_id, u32 queue_id, u64 name, u64 data
sys_timer.Warning("sys_timer_connect_event_queue(timer_id=%d, queue_id=%d, name=%llu, data1=%llu, data2=%llu)",
timer_id, queue_id, name, data1, data2);
timer* timer_data = nullptr;
EventQueue* equeue = nullptr;
std::shared_ptr<timer> timer_data = nullptr;
std::shared_ptr<EventQueue> equeue = nullptr;
if(!sys_timer.CheckId(timer_id, timer_data)) return CELL_ESRCH;
if(!sys_timer.CheckId(queue_id, equeue)) return CELL_ESRCH;
@ -92,7 +93,7 @@ s32 sys_timer_disconnect_event_queue(u32 timer_id)
{
sys_timer.Todo("sys_timer_disconnect_event_queue(timer_id=%d)", timer_id);
timer* timer_data = nullptr;
std::shared_ptr<timer> timer_data = nullptr;
if(!sys_timer.CheckId(timer_id, timer_data)) return CELL_ESRCH;
//TODO: ?