This commit is contained in:
Nekotekina 2015-06-21 03:17:42 +03:00
parent bc9481db1b
commit 6c4148a949
11 changed files with 62 additions and 42 deletions

View file

@ -72,6 +72,8 @@ s32 sys_timer_destroy(u32 timer_id)
{
sys_timer.Warning("sys_timer_destroy(timer_id=0x%x)", timer_id);
LV2_LOCK;
const auto timer = Emu.GetIdManager().get<lv2_timer_t>(timer_id);
if (!timer)
@ -79,8 +81,6 @@ s32 sys_timer_destroy(u32 timer_id)
return CELL_ESRCH;
}
LV2_LOCK;
if (!timer->port.expired())
{
return CELL_EISCONN;
@ -88,6 +88,8 @@ s32 sys_timer_destroy(u32 timer_id)
Emu.GetIdManager().remove<lv2_timer_t>(timer_id);
lv2_lock.unlock();
return CELL_OK;
}
@ -95,6 +97,8 @@ s32 sys_timer_get_information(u32 timer_id, vm::ptr<sys_timer_information_t> inf
{
sys_timer.Warning("sys_timer_get_information(timer_id=0x%x, info=*0x%x)", timer_id, info);
LV2_LOCK;
const auto timer = Emu.GetIdManager().get<lv2_timer_t>(timer_id);
if (!timer)
@ -102,8 +106,6 @@ s32 sys_timer_get_information(u32 timer_id, vm::ptr<sys_timer_information_t> inf
return CELL_ESRCH;
}
LV2_LOCK;
info->next_expiration_time = timer->start;
info->period = timer->period;
@ -118,6 +120,8 @@ s32 _sys_timer_start(u32 timer_id, u64 base_time, u64 period)
const u64 start_time = get_system_time();
LV2_LOCK;
const auto timer = Emu.GetIdManager().get<lv2_timer_t>(timer_id);
if (!timer)
@ -125,8 +129,6 @@ s32 _sys_timer_start(u32 timer_id, u64 base_time, u64 period)
return CELL_ESRCH;
}
LV2_LOCK;
if (timer->state != SYS_TIMER_STATE_STOP)
{
return CELL_EBUSY;
@ -170,6 +172,8 @@ s32 sys_timer_stop(u32 timer_id)
{
sys_timer.Warning("sys_timer_stop()");
LV2_LOCK;
const auto timer = Emu.GetIdManager().get<lv2_timer_t>(timer_id);
if (!timer)
@ -177,8 +181,6 @@ s32 sys_timer_stop(u32 timer_id)
return CELL_ESRCH;
}
LV2_LOCK;
timer->state = SYS_TIMER_STATE_STOP; // stop timer
return CELL_OK;
@ -188,6 +190,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=0x%x, queue_id=0x%x, name=0x%llx, data1=0x%llx, data2=0x%llx)", timer_id, queue_id, name, data1, data2);
LV2_LOCK;
const auto timer = Emu.GetIdManager().get<lv2_timer_t>(timer_id);
const auto queue = Emu.GetIdManager().get<lv2_event_queue_t>(queue_id);
@ -196,8 +200,6 @@ s32 sys_timer_connect_event_queue(u32 timer_id, u32 queue_id, u64 name, u64 data
return CELL_ESRCH;
}
LV2_LOCK;
if (!timer->port.expired())
{
return CELL_EISCONN;
@ -215,6 +217,8 @@ s32 sys_timer_disconnect_event_queue(u32 timer_id)
{
sys_timer.Warning("sys_timer_disconnect_event_queue(timer_id=0x%x)", timer_id);
LV2_LOCK;
const auto timer = Emu.GetIdManager().get<lv2_timer_t>(timer_id);
if (!timer)
@ -222,8 +226,6 @@ s32 sys_timer_disconnect_event_queue(u32 timer_id)
return CELL_ESRCH;
}
LV2_LOCK;
if (timer->port.expired())
{
return CELL_ENOTCONN;