Revision 74475455 hw/hpet.c
b/hw/hpet.c | ||
---|---|---|
143 | 143 |
|
144 | 144 |
static uint64_t hpet_get_ticks(HPETState *s) |
145 | 145 |
{ |
146 |
return ns_to_ticks(qemu_get_clock(vm_clock) + s->hpet_offset); |
|
146 |
return ns_to_ticks(qemu_get_clock_ns(vm_clock) + s->hpet_offset);
|
|
147 | 147 |
} |
148 | 148 |
|
149 | 149 |
/* |
... | ... | |
224 | 224 |
HPETState *s = opaque; |
225 | 225 |
|
226 | 226 |
/* Recalculate the offset between the main counter and guest time */ |
227 |
s->hpet_offset = ticks_to_ns(s->hpet_counter) - qemu_get_clock(vm_clock); |
|
227 |
s->hpet_offset = ticks_to_ns(s->hpet_counter) - qemu_get_clock_ns(vm_clock);
|
|
228 | 228 |
|
229 | 229 |
/* Push number of timers into capability returned via HPET_ID */ |
230 | 230 |
s->capability &= ~HPET_ID_NUM_TIM_MASK; |
... | ... | |
298 | 298 |
} |
299 | 299 |
diff = hpet_calculate_diff(t, cur_tick); |
300 | 300 |
qemu_mod_timer(t->qemu_timer, |
301 |
qemu_get_clock(vm_clock) + (int64_t)ticks_to_ns(diff)); |
|
301 |
qemu_get_clock_ns(vm_clock) + (int64_t)ticks_to_ns(diff));
|
|
302 | 302 |
} else if (t->config & HPET_TN_32BIT && !timer_is_periodic(t)) { |
303 | 303 |
if (t->wrap_flag) { |
304 | 304 |
diff = hpet_calculate_diff(t, cur_tick); |
305 |
qemu_mod_timer(t->qemu_timer, qemu_get_clock(vm_clock) + |
|
305 |
qemu_mod_timer(t->qemu_timer, qemu_get_clock_ns(vm_clock) +
|
|
306 | 306 |
(int64_t)ticks_to_ns(diff)); |
307 | 307 |
t->wrap_flag = 0; |
308 | 308 |
} |
... | ... | |
331 | 331 |
} |
332 | 332 |
} |
333 | 333 |
qemu_mod_timer(t->qemu_timer, |
334 |
qemu_get_clock(vm_clock) + (int64_t)ticks_to_ns(diff)); |
|
334 |
qemu_get_clock_ns(vm_clock) + (int64_t)ticks_to_ns(diff));
|
|
335 | 335 |
} |
336 | 336 |
|
337 | 337 |
static void hpet_del_timer(HPETTimer *t) |
... | ... | |
547 | 547 |
if (activating_bit(old_val, new_val, HPET_CFG_ENABLE)) { |
548 | 548 |
/* Enable main counter and interrupt generation. */ |
549 | 549 |
s->hpet_offset = |
550 |
ticks_to_ns(s->hpet_counter) - qemu_get_clock(vm_clock); |
|
550 |
ticks_to_ns(s->hpet_counter) - qemu_get_clock_ns(vm_clock);
|
|
551 | 551 |
for (i = 0; i < s->num_timers; i++) { |
552 | 552 |
if ((&s->timer[i])->cmp != ~0ULL) { |
553 | 553 |
hpet_set_timer(&s->timer[i]); |
... | ... | |
703 | 703 |
} |
704 | 704 |
for (i = 0; i < HPET_MAX_TIMERS; i++) { |
705 | 705 |
timer = &s->timer[i]; |
706 |
timer->qemu_timer = qemu_new_timer(vm_clock, hpet_timer, timer); |
|
706 |
timer->qemu_timer = qemu_new_timer_ns(vm_clock, hpet_timer, timer);
|
|
707 | 707 |
timer->tn = i; |
708 | 708 |
timer->state = s; |
709 | 709 |
} |
Also available in: Unified diff