| 414 | } |
| 415 | |
| 416 | uc_err stop_timer(uc_engine *uc, uint32_t id) { |
| 417 | struct TimerState* timers = &uc->fw->timers; |
| 418 | |
| 419 | if(id >= MAX_TIMERS) { |
| 420 | perror("[TIMER ERROR] stop_timer: Too high id passed\n"); |
| 421 | exit(-1); |
| 422 | } else if(!timers->timers[id].in_use) { |
| 423 | perror("[TIMER ERROR] stop_timer: Unused timer to be started\n"); |
| 424 | exit(-1); |
| 425 | } |
| 426 | |
| 427 | struct Timer *tim = &timers->timers[id]; |
| 428 | if(tim->is_active) { |
| 429 | tim->is_active = 0; |
| 430 | |
| 431 | remove_active_timer(uc, tim); |
| 432 | } |
| 433 | |
| 434 | return UC_ERR_OK; |
| 435 | } |
| 436 | |
| 437 | void *timers_take_snapshot(uc_engine *uc) { |
| 438 | size_t size = sizeof(struct TimerState); |
no test coverage detected