summaryrefslogtreecommitdiff
path: root/hw/mips_timer.c
diff options
context:
space:
mode:
authorJuan Quintela <quintela@redhat.com>2009-09-10 03:04:26 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2009-09-11 10:19:52 -0500
commit6ee093c90761eabfc6255624000d3d8248802209 (patch)
treef550274a05a1cd7a379f3e4d1cb7789fb2e64b8c /hw/mips_timer.c
parentb03b2e48cb322cb695ff7a6666b25712140ea3c9 (diff)
downloadqemu-6ee093c90761eabfc6255624000d3d8248802209.tar.gz
Unexport ticks_per_sec variable. Create get_ticks_per_sec() function
Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/mips_timer.c')
-rw-r--r--hw/mips_timer.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/hw/mips_timer.c b/hw/mips_timer.c
index d341e51657..bb3c3e4ec3 100644
--- a/hw/mips_timer.c
+++ b/hw/mips_timer.c
@@ -27,7 +27,7 @@ uint32_t cpu_mips_get_count (CPUState *env)
else
return env->CP0_Count +
(uint32_t)muldiv64(qemu_get_clock(vm_clock),
- TIMER_FREQ, ticks_per_sec);
+ TIMER_FREQ, get_ticks_per_sec());
}
static void cpu_mips_timer_update(CPUState *env)
@@ -37,8 +37,8 @@ static void cpu_mips_timer_update(CPUState *env)
now = qemu_get_clock(vm_clock);
wait = env->CP0_Compare - env->CP0_Count -
- (uint32_t)muldiv64(now, TIMER_FREQ, ticks_per_sec);
- next = now + muldiv64(wait, ticks_per_sec, TIMER_FREQ);
+ (uint32_t)muldiv64(now, TIMER_FREQ, get_ticks_per_sec());
+ next = now + muldiv64(wait, get_ticks_per_sec(), TIMER_FREQ);
qemu_mod_timer(env->timer, next);
}
@@ -50,7 +50,7 @@ void cpu_mips_store_count (CPUState *env, uint32_t count)
/* Store new count register */
env->CP0_Count =
count - (uint32_t)muldiv64(qemu_get_clock(vm_clock),
- TIMER_FREQ, ticks_per_sec);
+ TIMER_FREQ, get_ticks_per_sec());
/* Update timer timer */
cpu_mips_timer_update(env);
}
@@ -75,7 +75,7 @@ void cpu_mips_stop_count(CPUState *env)
{
/* Store the current value */
env->CP0_Count += (uint32_t)muldiv64(qemu_get_clock(vm_clock),
- TIMER_FREQ, ticks_per_sec);
+ TIMER_FREQ, get_ticks_per_sec());
}
static void mips_timer_cb (void *opaque)