]> git.proxmox.com Git - mirror_qemu.git/blobdiff - hw/mips_timer.c
Unexport ticks_per_sec variable. Create get_ticks_per_sec() function
[mirror_qemu.git] / hw / mips_timer.c
index d341e5165729e58cacd95d8592336aaee9fdb0f8..bb3c3e4ec32b8359a1ec314945f513f9a174e350 100644 (file)
@@ -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)