From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=45091 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OfzID-0003Ih-Fw for qemu-devel@nongnu.org; Mon, 02 Aug 2010 13:59:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OfzHM-00074e-J8 for qemu-devel@nongnu.org; Mon, 02 Aug 2010 13:58:25 -0400 Received: from mail-bw0-f45.google.com ([209.85.214.45]:44283) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OfzHM-00074J-DO for qemu-devel@nongnu.org; Mon, 02 Aug 2010 13:58:24 -0400 Received: by bwz16 with SMTP id 16so1868247bwz.4 for ; Mon, 02 Aug 2010 10:58:23 -0700 (PDT) From: Artyom Tarasenko Date: Mon, 2 Aug 2010 19:58:21 +0200 Message-Id: <1280771901-9758-1-git-send-email-atar4qemu@gmail.com> Subject: [Qemu-devel] [PATCH] [sparc32] fix last cpu timer initialization List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: blauwirbel@gmail.com, Artyom Tarasenko 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. --- hw/slavio_timer.c | 4 ++-- 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; } -- 1.6.2.5