Revision 74475455 hw/sun4u.c
b/hw/sun4u.c | ||
---|---|---|
352 | 352 |
timer->disabled_mask = disabled_mask; |
353 | 353 |
|
354 | 354 |
timer->disabled = 1; |
355 |
timer->clock_offset = qemu_get_clock(vm_clock); |
|
355 |
timer->clock_offset = qemu_get_clock_ns(vm_clock);
|
|
356 | 356 |
|
357 |
timer->qtimer = qemu_new_timer(vm_clock, cb, env); |
|
357 |
timer->qtimer = qemu_new_timer_ns(vm_clock, cb, env);
|
|
358 | 358 |
|
359 | 359 |
return timer; |
360 | 360 |
} |
... | ... | |
362 | 362 |
static void cpu_timer_reset(CPUTimer *timer) |
363 | 363 |
{ |
364 | 364 |
timer->disabled = 1; |
365 |
timer->clock_offset = qemu_get_clock(vm_clock); |
|
365 |
timer->clock_offset = qemu_get_clock_ns(vm_clock);
|
|
366 | 366 |
|
367 | 367 |
qemu_del_timer(timer->qtimer); |
368 | 368 |
} |
... | ... | |
457 | 457 |
uint64_t real_count = count & ~timer->disabled_mask; |
458 | 458 |
uint64_t disabled_bit = count & timer->disabled_mask; |
459 | 459 |
|
460 |
int64_t vm_clock_offset = qemu_get_clock(vm_clock) - |
|
460 |
int64_t vm_clock_offset = qemu_get_clock_ns(vm_clock) -
|
|
461 | 461 |
cpu_to_timer_ticks(real_count, timer->frequency); |
462 | 462 |
|
463 | 463 |
TIMER_DPRINTF("%s set_count count=0x%016lx (%s) p=%p\n", |
... | ... | |
471 | 471 |
uint64_t cpu_tick_get_count(CPUTimer *timer) |
472 | 472 |
{ |
473 | 473 |
uint64_t real_count = timer_to_cpu_ticks( |
474 |
qemu_get_clock(vm_clock) - timer->clock_offset, |
|
474 |
qemu_get_clock_ns(vm_clock) - timer->clock_offset,
|
|
475 | 475 |
timer->frequency); |
476 | 476 |
|
477 | 477 |
TIMER_DPRINTF("%s get_count count=0x%016lx (%s) p=%p\n", |
... | ... | |
486 | 486 |
|
487 | 487 |
void cpu_tick_set_limit(CPUTimer *timer, uint64_t limit) |
488 | 488 |
{ |
489 |
int64_t now = qemu_get_clock(vm_clock); |
|
489 |
int64_t now = qemu_get_clock_ns(vm_clock);
|
|
490 | 490 |
|
491 | 491 |
uint64_t real_limit = limit & ~timer->disabled_mask; |
492 | 492 |
timer->disabled = (limit & timer->disabled_mask) ? 1 : 0; |
Also available in: Unified diff