]> git.proxmox.com Git - qemu.git/commitdiff
arm_timer: fix oneshot mode
authorRabin Vincent <rabin@rab.in>
Sun, 2 May 2010 09:50:52 +0000 (15:20 +0530)
committerAurelien Jarno <aurelien@aurel32.net>
Thu, 27 May 2010 13:52:57 +0000 (15:52 +0200)
In oneshot mode, the delta needs to come from the TimerLoad register,
not the maximum limit.

Signed-off-by: Rabin Vincent <rabin@rab.in>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
(cherry picked from commit a9cf98d939c4f6539fad7e7d812ea16d96ba3dc9)

hw/arm_timer.c

index 5b6947a16684db78e2efe331549899a4c064cbd5..9073ffc00773e217265ec32faf88dae9f1f30282 100644 (file)
@@ -71,7 +71,7 @@ static void arm_timer_recalibrate(arm_timer_state *s, int reload)
 {
     uint32_t limit;
 
-    if ((s->control & TIMER_CTRL_PERIODIC) == 0) {
+    if ((s->control & (TIMER_CTRL_PERIODIC | TIMER_CTRL_ONESHOT)) == 0) {
         /* Free running.  */
         if (s->control & TIMER_CTRL_32BIT)
             limit = 0xffffffff;