| 201 | } |
| 202 | |
| 203 | error_code sys_timer_get_information(ppu_thread &ppu, u32 timer_id, |
| 204 | vm::ptr<sys_timer_information_t> info) { |
| 205 | ppu.state += cpu_flag::wait; |
| 206 | |
| 207 | sys_timer.trace("sys_timer_get_information(timer_id=0x%x, info=*0x%x)", |
| 208 | timer_id, info); |
| 209 | |
| 210 | sys_timer_information_t _info{}; |
| 211 | const u64 now = get_guest_system_time(); |
| 212 | |
| 213 | const auto timer = |
| 214 | idm::check<lv2_obj, lv2_timer>(timer_id, [&](lv2_timer &timer) { |
| 215 | std::lock_guard lock(timer.mutex); |
| 216 | |
| 217 | timer.check_unlocked(now); |
| 218 | timer.get_information(_info); |
| 219 | }); |
| 220 | |
| 221 | if (!timer) { |
| 222 | return CELL_ESRCH; |
| 223 | } |
| 224 | |
| 225 | ppu.check_state(); |
| 226 | std::memcpy(info.get_ptr(), &_info, info.size()); |
| 227 | return CELL_OK; |
| 228 | } |
| 229 | |
| 230 | error_code _sys_timer_start(ppu_thread &ppu, u32 timer_id, u64 base_time, |
| 231 | u64 period) { |
nothing calls this directly
no test coverage detected