]> Git Repo - qemu.git/commitdiff
Fix interval interrupt of cadence ttc when timer is in decrement mode
authorJohannes Schlatow <[email protected]>
Mon, 6 Jul 2015 09:05:44 +0000 (10:05 +0100)
committerPeter Maydell <[email protected]>
Mon, 6 Jul 2015 09:05:44 +0000 (10:05 +0100)
The interval interrupt is not set if the timer is in decrement mode.
This is because x >=0 and x < interval after leaving the while-loop.

Signed-off-by: Johannes Schlatow <[email protected]>
Message-id: 20150630135821.51f3b4fd@johanness-latitude
Reviewed-by: Peter Crosthwaite <[email protected]>
Signed-off-by: Peter Maydell <[email protected]>
hw/timer/cadence_ttc.c

index d46db3c0e29e57728c0010658118507b8ef7b409..35bc88033e66e5fb5bff24ec9339898131073587 100644 (file)
@@ -208,15 +208,14 @@ static void cadence_timer_sync(CadenceTimerState *s)
             s->reg_intr |= (2 << i);
         }
     }
+    if ((x < 0) || (x >= interval)) {
+        s->reg_intr |= (s->reg_count & COUNTER_CTRL_INT) ?
+            COUNTER_INTR_IV : COUNTER_INTR_OV;
+    }
     while (x < 0) {
         x += interval;
     }
     s->reg_value = (uint32_t)(x % interval);
-
-    if (s->reg_value != x) {
-        s->reg_intr |= (s->reg_count & COUNTER_CTRL_INT) ?
-            COUNTER_INTR_IV : COUNTER_INTR_OV;
-    }
     cadence_timer_update(s);
 }
 
This page took 0.023756 seconds and 4 git commands to generate.