| 377 | } |
| 378 | |
| 379 | error_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 | |
| 413 | error_code sys_timer_sleep(ppu_thread &ppu, u32 sleep_time) { |
| 414 | ppu.state += cpu_flag::wait; |
nothing calls this directly
no test coverage detected