From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HWwkB-0006rd-Ak for qemu-devel@nongnu.org; Thu, 29 Mar 2007 11:40:55 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HWwk9-0006nm-Jg for qemu-devel@nongnu.org; Thu, 29 Mar 2007 11:40:54 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HWwk9-0006nO-Fe for qemu-devel@nongnu.org; Thu, 29 Mar 2007 10:40:53 -0500 Received: from os.inf.tu-dresden.de ([141.76.48.99]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1HWwhX-0006iE-Si for qemu-devel@nongnu.org; Thu, 29 Mar 2007 11:38:12 -0400 Received: from silo.inf.tu-dresden.de ([141.76.48.100]) by os.inf.tu-dresden.de with esmtps (TLSv1:AES256-SHA:256) (Exim 4.66) id 1HWwhU-0008Ql-2o for qemu-devel@nongnu.org; Thu, 29 Mar 2007 17:38:08 +0200 Received: from kauer by silo.inf.tu-dresden.de with local (Exim 4.50) id 1HWwhT-0004J9-QT for qemu-devel@nongnu.org; Thu, 29 Mar 2007 17:38:07 +0200 Date: Thu, 29 Mar 2007 17:38:07 +0200 Message-ID: <20070329153807.GC24080@silo.inf.tu-dresden.de> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="FCuugMFkClbJLl1L" Content-Disposition: inline From: Bernhard Kauer Subject: [Qemu-devel] Patch: PIC-i8259 does not work in single mode 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 --FCuugMFkClbJLl1L Content-Type: text/plain; charset=us-ascii Content-Disposition: inline The PIC-i8259 does not work in single mode, where only the master PIC is used. The attached patch fixes the initialization part for single mode. Bernhard Kauer --FCuugMFkClbJLl1L Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="qemu_pic_single.diff" Index: i8259.c =================================================================== RCS file: /sources/qemu/qemu/hw/i8259.c,v retrieving revision 1.20 diff -u -r1.20 i8259.c --- i8259.c 24 Jan 2007 01:47:51 -0000 1.20 +++ i8259.c 26 Mar 2007 17:01:18 -0000 @@ -44,6 +44,7 @@ uint8_t rotate_on_auto_eoi; uint8_t special_fully_nested_mode; uint8_t init4; /* true if 4 byte init */ + uint8_t single_mode; /* true if slave pic is not initialized */ uint8_t elcr; /* PIIX edge/trigger selection*/ uint8_t elcr_mask; PicState2 *pics_state; @@ -278,6 +279,7 @@ s->rotate_on_auto_eoi = 0; s->special_fully_nested_mode = 0; s->init4 = 0; + s->single_mode = 0; /* Note: ELCR is not reset */ } @@ -298,8 +300,7 @@ s->pics_state->irq_request(s->pics_state->irq_request_opaque, 0); s->init_state = 1; s->init4 = val & 1; - if (val & 0x02) - hw_error("single mode not supported"); + s->single_mode = val & 2; if (val & 0x08) hw_error("level sensitive irq not supported"); } else if (val & 0x08) { @@ -356,7 +357,7 @@ break; case 1: s->irq_base = val & 0xf8; - s->init_state = 2; + s->init_state = s->single_mode && s->init4 ? 3 : 2; break; case 2: if (s->init4) { @@ -468,6 +469,7 @@ qemu_put_8s(f, &s->rotate_on_auto_eoi); qemu_put_8s(f, &s->special_fully_nested_mode); qemu_put_8s(f, &s->init4); + qemu_put_8s(f, &s->single_mode); qemu_put_8s(f, &s->elcr); } @@ -492,6 +494,7 @@ qemu_get_8s(f, &s->rotate_on_auto_eoi); qemu_get_8s(f, &s->special_fully_nested_mode); qemu_get_8s(f, &s->init4); + qemu_get_8s(f, &s->single_mode); qemu_get_8s(f, &s->elcr); return 0; } --FCuugMFkClbJLl1L--