Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GV7BV-0004lw-F8 for qemu-devel@nongnu.org; Wed, 04 Oct 2006 09:53:17 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GV7BR-0004kw-BV for qemu-devel@nongnu.org; Wed, 04 Oct 2006 09:53:16 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GV7BR-0004kt-76 for qemu-devel@nongnu.org; Wed, 04 Oct 2006 09:53:13 -0400 Received: from [199.232.41.67] (helo=mx20.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1GV7HQ-0005i8-Fp for qemu-devel@nongnu.org; Wed, 04 Oct 2006 09:59:24 -0400 Received: from [141.76.48.99] (helo=os.inf.tu-dresden.de) by mx20.gnu.org with esmtp (Exim 4.52) id 1GV77d-0008Ds-PE for qemu-devel@nongnu.org; Wed, 04 Oct 2006 09:49:18 -0400 Received: from erwin.inf.tu-dresden.de ([141.76.48.80]) by os.inf.tu-dresden.de with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) id 1GV77T-0005d1-4I for qemu-devel@nongnu.org; Wed, 04 Oct 2006 15:49:07 +0200 Received: from adam by erwin.inf.tu-dresden.de with local (Exim 4.50) id 1GV77S-0004Wm-Me for qemu-devel@nongnu.org; Wed, 04 Oct 2006 15:49:06 +0200 Date: Wed, 4 Oct 2006 15:49:06 +0200 From: Adam Lackorzynski Message-ID: <20061004134906.GF2353@os.inf.tu-dresden.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Subject: [Qemu-devel] [PATCH] fix for arm_gic Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Hi, the priority array of the gic_state structure contains 96 elements but gic_set_running_irq is also called with irq == 1023 so that without the fix some random value is used for s->running_priority. The printf patch is necessary to make the DPRINTFs work. Index: arm_gic.c =================================================================== RCS file: /sources/qemu/qemu/hw/arm_gic.c,v retrieving revision 1.2 diff -u -r1.2 arm_gic.c --- arm_gic.c 1 Oct 2006 13:03:52 -0000 1.2 +++ arm_gic.c 4 Oct 2006 13:39:24 -0000 @@ -17,7 +17,7 @@ #ifdef DEBUG_GIC #define DPRINTF(fmt, args...) \ -do { printf("arm_gic: " fmt , (int)s->base, ##args); } while (0) +do { printf("arm_gic(%x): " fmt , (int)s->base, ##args); } while (0) #else #define DPRINTF(fmt, args...) do {} while(0) #endif @@ -135,7 +135,7 @@ static void gic_set_running_irq(gic_state *s, int irq) { s->running_irq = irq; - s->running_priority = s->priority[irq]; + s->running_priority = (irq == 1023) ? 0x100 : s->priority[irq]; gic_update(s); } Thanks, Adam -- Adam adam@os.inf.tu-dresden.de Lackorzynski http://os.inf.tu-dresden.de/~adam/