From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NDeKw-0001Ys-30 for qemu-devel@nongnu.org; Thu, 26 Nov 2009 08:24:42 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NDeKq-0001Wp-28 for qemu-devel@nongnu.org; Thu, 26 Nov 2009 08:24:40 -0500 Received: from [199.232.76.173] (port=42062 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NDeKo-0001WF-CF for qemu-devel@nongnu.org; Thu, 26 Nov 2009 08:24:34 -0500 Received: from mx1.redhat.com ([209.132.183.28]:11544) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NDeKn-0007jt-MN for qemu-devel@nongnu.org; Thu, 26 Nov 2009 08:24:33 -0500 Date: Thu, 26 Nov 2009 15:21:52 +0200 From: "Michael S. Tsirkin" Message-ID: <20091126132152.GA31817@redhat.com> References: <20091125165906.GE24783@redhat.com> <20091126030451.GG25483%yamahata@valinux.co.jp> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20091126030451.GG25483%yamahata@valinux.co.jp> Subject: [Qemu-devel] Re: [PATCH 4/4] pci: interrupt disable bit support List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Isaku Yamahata Cc: qemu-devel@nongnu.org On Thu, Nov 26, 2009 at 12:04:51PM +0900, Isaku Yamahata wrote: > On Wed, Nov 25, 2009 at 06:59:06PM +0200, Michael S. Tsirkin wrote: > > interrupt disable bit is mandatory in PCI spec, > > so we must implement it to be spec compliant. > > > > Signed-off-by: Michael S. Tsirkin > > --- > > hw/pci.c | 57 ++++++++++++++++++++++++++++++++++++++++----------------- > > hw/pci.h | 4 ++++ > > 2 files changed, 44 insertions(+), 17 deletions(-) > > > > diff --git a/hw/pci.c b/hw/pci.c > > index 844664b..3daae46 100644 > > --- a/hw/pci.c > > +++ b/hw/pci.c > > @@ -114,12 +114,43 @@ static void pci_update_irq_status(PCIDevice *dev) > > } > > } > > > > +static void pci_change_irq_level(PCIDevice *pci_dev, int irq_num, int change) > > +{ > > + PCIBus *bus; > > + for (;;) { > > + bus = pci_dev->bus; > > + irq_num = bus->map_irq(pci_dev, irq_num); > > + if (bus->set_irq) > > + break; > > + pci_dev = bus->parent_dev; > > + } > > + bus->irq_count[irq_num] += change; > > + bus->set_irq(bus->irq_opaque, irq_num, bus->irq_count[irq_num] != 0); > > Let's use ! instead of != 0 for consistency. By the way, this would have to be !!, not !. So not sure there's much consistency to be gained: != appears in pci.c more times than !!. -- MST