From patchwork Fri Dec 18 22:37:26 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Graf X-Patchwork-Id: 41434 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id BDBBAB6EEE for ; Sat, 19 Dec 2009 09:38:21 +1100 (EST) Received: from localhost ([127.0.0.1]:39992 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NLlSj-00074d-PM for incoming@patchwork.ozlabs.org; Fri, 18 Dec 2009 17:38:17 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NLlS4-0006zK-7q for qemu-devel@nongnu.org; Fri, 18 Dec 2009 17:37:36 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NLlRz-0006pZ-JE for qemu-devel@nongnu.org; Fri, 18 Dec 2009 17:37:35 -0500 Received: from [199.232.76.173] (port=46138 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NLlRz-0006pI-6Y for qemu-devel@nongnu.org; Fri, 18 Dec 2009 17:37:31 -0500 Received: from cantor.suse.de ([195.135.220.2]:45950 helo=mx1.suse.de) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NLlRy-00012J-T0 for qemu-devel@nongnu.org; Fri, 18 Dec 2009 17:37:31 -0500 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.221.2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.suse.de (Postfix) with ESMTP id 430968FEA2; Fri, 18 Dec 2009 23:37:28 +0100 (CET) From: Alexander Graf To: qemu-devel@nongnu.org Date: Fri, 18 Dec 2009 23:37:26 +0100 Message-Id: <1261175847-16915-1-git-send-email-agraf@suse.de> X-Mailer: git-send-email 1.6.0.2 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.4-2.6 Cc: blauwirbel@gmail.com, Aurelien Jarno Subject: [Qemu-devel] [PATCH] PPC: Initialize OpenPIC properly X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org When lowering an IRQ line, we search for the line we're supposed to lower. Usually we run into an optimization there that queues up interrupts. This queue ends with -1. Unfortunately we didn't set the first item to -1. This patch fixes this, making interrupts work on PPC64. Signed-off-by: Alexander Graf --- hw/openpic.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/hw/openpic.c b/hw/openpic.c index 42db59d..1e4b3c1 100644 --- a/hw/openpic.c +++ b/hw/openpic.c @@ -442,7 +442,9 @@ static void openpic_reset (void *opaque) opp->dst[i].pctp = 0x0000000F; opp->dst[i].pcsr = 0x00000000; memset(&opp->dst[i].raised, 0, sizeof(IRQ_queue_t)); + opp->dst[i].raised.next = -1; memset(&opp->dst[i].servicing, 0, sizeof(IRQ_queue_t)); + opp->dst[i].servicing.next = -1; } /* Initialise timers */ for (i = 0; i < MAX_TMR; i++) {