From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LXWhC-00029E-6P for qemu-devel@nongnu.org; Thu, 12 Feb 2009 03:13:18 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LXWhB-00028c-6R for qemu-devel@nongnu.org; Thu, 12 Feb 2009 03:13:17 -0500 Received: from [199.232.76.173] (port=51356 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LXWhA-00028M-Ri for qemu-devel@nongnu.org; Thu, 12 Feb 2009 03:13:16 -0500 Received: from mx20.gnu.org ([199.232.41.8]:3653) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LXWhA-0001d5-Aj for qemu-devel@nongnu.org; Thu, 12 Feb 2009 03:13:16 -0500 Received: from mx2.redhat.com ([66.187.237.31]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LXWh9-0002xq-CO for qemu-devel@nongnu.org; Thu, 12 Feb 2009 03:13:15 -0500 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 n1C8DE62022186 for ; Thu, 12 Feb 2009 03:13:14 -0500 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 n1C8DFmJ031748 for ; Thu, 12 Feb 2009 03:13:15 -0500 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 n1C8DECV009377 for ; Thu, 12 Feb 2009 03:13:14 -0500 Received: from dhcp-1-237.tlv.redhat.com (localhost [127.0.0.1]) by dhcp-1-237.tlv.redhat.com (Postfix) with ESMTP id A0D0118D43A for ; Thu, 12 Feb 2009 10:10:36 +0200 (IST) From: Gleb Natapov Date: Thu, 12 Feb 2009 10:10:36 +0200 Message-ID: <20090212081036.29410.74172.stgit@dhcp-1-237.tlv.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] [PATCH] Generate PCI hotplug interrupt only if corespondent EN bit is set. 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 Signed-off-by: Gleb Natapov --- hw/acpi.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/acpi.c b/hw/acpi.c index 5eac1ad..2375f20 100644 --- a/hw/acpi.c +++ b/hw/acpi.c @@ -724,27 +724,27 @@ void qemu_system_hot_add_init(void) static void enable_device(struct pci_status *p, struct gpe_regs *g, int slot) { g->sts |= 2; - g->en |= 2; p->up |= (1 << slot); } static void disable_device(struct pci_status *p, struct gpe_regs *g, int slot) { g->sts |= 2; - g->en |= 2; p->down |= (1 << slot); } void qemu_system_device_hot_add(int bus, int slot, int state) { - qemu_set_irq(pm_state->irq, 1); pci0_status.up = 0; pci0_status.down = 0; if (state) enable_device(&pci0_status, &gpe, slot); else disable_device(&pci0_status, &gpe, slot); - qemu_set_irq(pm_state->irq, 0); + if (gpe.en & 2) { + qemu_set_irq(pm_state->irq, 1); + qemu_set_irq(pm_state->irq, 0); + } } struct acpi_table_header