From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MGy3Y-00085M-Fg for qemu-devel@nongnu.org; Wed, 17 Jun 2009 12:32:12 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MGy3T-0007xF-Dk for qemu-devel@nongnu.org; Wed, 17 Jun 2009 12:32:11 -0400 Received: from [199.232.76.173] (port=41027 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MGy3S-0007we-R6 for qemu-devel@nongnu.org; Wed, 17 Jun 2009 12:32:06 -0400 Received: from mx2.redhat.com ([66.187.237.31]:61000) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MGy3S-0008Jo-2B for qemu-devel@nongnu.org; Wed, 17 Jun 2009 12:32:06 -0400 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n5HGW4Z2031535 for ; Wed, 17 Jun 2009 12:32:04 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n5HGW4kc014532 for ; Wed, 17 Jun 2009 12:32:04 -0400 Received: from dhcp-1-237.tlv.redhat.com (dhcp-1-237.tlv.redhat.com [10.35.1.237]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n5HGW3ZG020693 for ; Wed, 17 Jun 2009 12:32:03 -0400 From: Gleb Natapov Date: Wed, 17 Jun 2009 19:32:01 +0300 Message-Id: <1245256322-30990-2-git-send-email-gleb@redhat.com> In-Reply-To: <1245256322-30990-1-git-send-email-gleb@redhat.com> References: <1245256322-30990-1-git-send-email-gleb@redhat.com> Subject: [Qemu-devel] [PATCH 2/3] Call piix3_reset() on system reset. List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Also zero pci_irq_levels on reset to avoid stuck irq after reset. Signed-off-by: Gleb Natapov Signed-off-by: Yaniv Kamay --- hw/piix_pci.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/hw/piix_pci.c b/hw/piix_pci.c index 914a65a..ff2cbde 100644 --- a/hw/piix_pci.c +++ b/hw/piix_pci.c @@ -232,8 +232,9 @@ static void piix3_set_irq(qemu_irq *pic, int irq_num, int level) } } -static void piix3_reset(PCIDevice *d) +static void piix3_reset(void *opaque) { + PCIDevice *d = opaque; uint8_t *pci_conf = d->config; pci_conf[0x04] = 0x07; // master, memory and I/O @@ -267,6 +268,8 @@ static void piix3_reset(PCIDevice *d) pci_conf[0xab] = 0x00; pci_conf[0xac] = 0x00; pci_conf[0xae] = 0x00; + + memset(pci_irq_levels, 0, sizeof(pci_irq_levels)); } static void piix4_reset(PCIDevice *d) @@ -339,6 +342,7 @@ int piix3_init(PCIBus *bus, int devfn) PCI_HEADER_TYPE_NORMAL | PCI_HEADER_TYPE_MULTI_FUNCTION; // header_type = PCI_multifunction, generic piix3_reset(d); + qemu_register_reset(piix3_reset, 0, d); return d->devfn; } -- 1.6.2.1