diff options
author | Aurelien Jarno <aurelien@aurel32.net> | 2011-03-21 21:28:38 +0100 |
---|---|---|
committer | Aurelien Jarno <aurelien@aurel32.net> | 2011-03-21 21:28:38 +0100 |
commit | aa315f95b7c3c5b032cbc6c78f434a871002f558 (patch) | |
tree | 61c0142bd9a3f43aa6f800fcaebc2e1f0ccf5f5b /hw/sun4u.c | |
parent | 32465727627711ff3e1cde6777a014413c3cb9ee (diff) | |
parent | 6d5ad9bf9318b1555d5567cd7e1760a51a55ebf8 (diff) |
Merge branch 'for-anthony' of git://github.com/bonzini/qemu
* 'for-anthony' of git://github.com/bonzini/qemu:
remove qemu_get_clock
add a generic scaling mechanism for timers
change all other clock references to use nanosecond resolution accessors
change all rt_clock references to use millisecond resolution accessors
add more helper functions with explicit milli/nanosecond resolution
Diffstat (limited to 'hw/sun4u.c')
-rw-r--r-- | hw/sun4u.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/hw/sun4u.c b/hw/sun4u.c index d28232426f..dbb5a15066 100644 --- a/hw/sun4u.c +++ b/hw/sun4u.c @@ -352,9 +352,9 @@ static CPUTimer* cpu_timer_create(const char* name, CPUState *env, timer->disabled_mask = disabled_mask; timer->disabled = 1; - timer->clock_offset = qemu_get_clock(vm_clock); + timer->clock_offset = qemu_get_clock_ns(vm_clock); - timer->qtimer = qemu_new_timer(vm_clock, cb, env); + timer->qtimer = qemu_new_timer_ns(vm_clock, cb, env); return timer; } @@ -362,7 +362,7 @@ static CPUTimer* cpu_timer_create(const char* name, CPUState *env, static void cpu_timer_reset(CPUTimer *timer) { timer->disabled = 1; - timer->clock_offset = qemu_get_clock(vm_clock); + timer->clock_offset = qemu_get_clock_ns(vm_clock); qemu_del_timer(timer->qtimer); } @@ -457,7 +457,7 @@ void cpu_tick_set_count(CPUTimer *timer, uint64_t count) uint64_t real_count = count & ~timer->disabled_mask; uint64_t disabled_bit = count & timer->disabled_mask; - int64_t vm_clock_offset = qemu_get_clock(vm_clock) - + int64_t vm_clock_offset = qemu_get_clock_ns(vm_clock) - cpu_to_timer_ticks(real_count, timer->frequency); TIMER_DPRINTF("%s set_count count=0x%016lx (%s) p=%p\n", @@ -471,7 +471,7 @@ void cpu_tick_set_count(CPUTimer *timer, uint64_t count) uint64_t cpu_tick_get_count(CPUTimer *timer) { uint64_t real_count = timer_to_cpu_ticks( - qemu_get_clock(vm_clock) - timer->clock_offset, + qemu_get_clock_ns(vm_clock) - timer->clock_offset, timer->frequency); TIMER_DPRINTF("%s get_count count=0x%016lx (%s) p=%p\n", @@ -486,7 +486,7 @@ uint64_t cpu_tick_get_count(CPUTimer *timer) void cpu_tick_set_limit(CPUTimer *timer, uint64_t limit) { - int64_t now = qemu_get_clock(vm_clock); + int64_t now = qemu_get_clock_ns(vm_clock); uint64_t real_limit = limit & ~timer->disabled_mask; timer->disabled = (limit & timer->disabled_mask) ? 1 : 0; |