]> git.proxmox.com Git - mirror_qemu.git/commitdiff
fix last cpu timer initialization
authorArtyom Tarasenko <atar4qemu@googlemail.com>
Mon, 2 Aug 2010 17:58:21 +0000 (19:58 +0200)
committerBlue Swirl <blauwirbel@gmail.com>
Mon, 2 Aug 2010 18:49:13 +0000 (18:49 +0000)
The timer #0 is the system timer, so the timer #num_cpu is the
timer of the last CPU, and it must be initialized in slavio_timer_reset.

Don't mark non-existing timers as running.

Signed-off-by: Artyom Tarasenko <atar4qemu@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
hw/slavio_timer.c

index d7875536b613ceb3149407fe48d1cd7b31847894..c125de4b62dbc625f7065bb22107feaf1272d2d8 100644 (file)
@@ -377,12 +377,12 @@ static void slavio_timer_reset(DeviceState *d)
         curr_timer->limit = 0;
         curr_timer->count = 0;
         curr_timer->reached = 0;
-        if (i < s->num_cpus) {
+        if (i <= s->num_cpus) {
             ptimer_set_limit(curr_timer->timer,
                              LIMIT_TO_PERIODS(TIMER_MAX_COUNT32), 1);
             ptimer_run(curr_timer->timer, 0);
+            curr_timer->running = 1;
         }
-        curr_timer->running = 1;
     }
     s->cputimer_mode = 0;
 }