]> git.proxmox.com Git - mirror_qemu.git/blobdiff - hw/mips_timer.c
Add instruction counter.
[mirror_qemu.git] / hw / mips_timer.c
index 5b172ea424271e4de15e1a69db6e3f4f823d6549..5549e2483a86562cc498893c64a87ba85ef19c50 100644 (file)
@@ -91,7 +91,12 @@ static void mips_timer_cb (void *opaque)
     if (env->CP0_Cause & (1 << CP0Ca_DC))
         return;
 
+    /* ??? This callback should occur when the counter is exactly equal to
+       the comparator value.  Offset the count by one to avoid immediately
+       retriggering the callback before any virtual time has passed.  */
+    env->CP0_Count++;
     cpu_mips_timer_update(env);
+    env->CP0_Count--;
     if (env->insn_flags & ISA_MIPS32R2)
         env->CP0_Cause |= 1 << CP0Ca_TI;
     qemu_irq_raise(env->irq[(env->CP0_IntCtl >> CP0IntCtl_IPTI) & 0x7]);