aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorArtyom Tarasenko <atar4qemu@googlemail.com>2010-08-02 19:58:21 +0200
committerBlue Swirl <blauwirbel@gmail.com>2010-08-02 18:49:13 +0000
commit5933e8a96ab9c59cb6b6c80c9db385364a68c959 (patch)
tree5cd8921dd78b6d69efca5b5e623a5f9979b8938a /hw
parentad7ee4ad6c3a5388acf94dd532d291ea6d3a5972 (diff)
downloadqemu-5933e8a96ab9c59cb6b6c80c9db385364a68c959.zip
qemu-5933e8a96ab9c59cb6b6c80c9db385364a68c959.tar.gz
qemu-5933e8a96ab9c59cb6b6c80c9db385364a68c959.tar.bz2
fix last cpu timer initialization
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>
Diffstat (limited to 'hw')
-rw-r--r--hw/slavio_timer.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/hw/slavio_timer.c b/hw/slavio_timer.c
index d787553..c125de4 100644
--- a/hw/slavio_timer.c
+++ b/hw/slavio_timer.c
@@ -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;
}