| 149 | } |
| 150 | |
| 151 | int timer_sched_callback(struct timeout_callback *tocb, uint64_t us) |
| 152 | { |
| 153 | struct mono_time current_time; |
| 154 | |
| 155 | if ((long)us < 0) |
| 156 | return -1; |
| 157 | |
| 158 | timer_monotonic_get(¤t_time); |
| 159 | tocb->expiration = current_time; |
| 160 | mono_time_add_usecs(&tocb->expiration, us); |
| 161 | |
| 162 | /* The expiration overflowed. */ |
| 163 | if (us != 0 && !mono_time_before(¤t_time, &tocb->expiration)) |
| 164 | return -1; |
| 165 | |
| 166 | return timer_queue_insert(&global_timer_queue, tocb); |
| 167 | } |
| 168 | |
| 169 | int timers_run(void) |
| 170 | { |
no test coverage detected