MCPcopy Create free account
hub / github.com/RPCSX/rpcsx / sys_timer_disconnect_event_queue

Function sys_timer_disconnect_event_queue

kernel/cellos/src/sys_timer.cpp:379–411  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

377}
378
379error_code sys_timer_disconnect_event_queue(ppu_thread &ppu, u32 timer_id) {
380 ppu.state += cpu_flag::wait;
381
382 sys_timer.warning("sys_timer_disconnect_event_queue(timer_id=0x%x)",
383 timer_id);
384
385 const auto timer = idm::check<lv2_obj, lv2_timer>(
386 timer_id,
387 [now = get_guest_system_time(),
388 notify = lv2_obj::notify_all_t()](lv2_timer &timer) -> CellError {
389 std::lock_guard lock(timer.mutex);
390
391 timer.check_unlocked(now);
392 timer.state = SYS_TIMER_STATE_STOP;
393
394 if (!lv2_obj::check(timer.port)) {
395 return CELL_ENOTCONN;
396 }
397
398 timer.port.reset();
399 return {};
400 });
401
402 if (!timer) {
403 return CELL_ESRCH;
404 }
405
406 if (timer.ret) {
407 return timer.ret;
408 }
409
410 return CELL_OK;
411}
412
413error_code sys_timer_sleep(ppu_thread &ppu, u32 sleep_time) {
414 ppu.state += cpu_flag::wait;

Callers

nothing calls this directly

Calls 4

get_guest_system_timeFunction · 0.85
notify_all_tClass · 0.85
check_unlockedMethod · 0.45
resetMethod · 0.45

Tested by

no test coverage detected