]> 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>
Fri, 21 May 2010 10:00:22 +0000 (12:00 +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>
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;