From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=54063 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PiLz3-0007cn-FS for qemu-devel@nongnu.org; Thu, 27 Jan 2011 02:09:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PiLz2-0006X0-EV for qemu-devel@nongnu.org; Thu, 27 Jan 2011 02:09:33 -0500 Received: from mx1.redhat.com ([209.132.183.28]:21868) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PiLz2-0006Ws-6Q for qemu-devel@nongnu.org; Thu, 27 Jan 2011 02:09:32 -0500 Date: Thu, 27 Jan 2011 09:09:15 +0200 From: "Michael S. Tsirkin" Message-ID: <20110127070915.GA28291@redhat.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: [Qemu-devel] Re: [PATCH v2 1/5] pci: replace the magic, 256, for the maximum of devfn 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, Jan 27, 2011 at 03:56:35PM +0900, Isaku Yamahata wrote: > Introduce symbol PCI_DEVFN_MAX for the maximum of devfn > and replace the magic, 256. > > Signed-off-by: Isaku Yamahata Applied, tweaked the comment. > --- > hw/pci.h | 1 + > hw/pci_internals.h | 2 +- > 2 files changed, 2 insertions(+), 1 deletions(-) > > diff --git a/hw/pci.h b/hw/pci.h > index 0d2753f..aa5f912 100644 > --- a/hw/pci.h > +++ b/hw/pci.h > @@ -16,6 +16,7 @@ > #define PCI_DEVFN(slot, func) ((((slot) & 0x1f) << 3) | ((func) & 0x07)) > #define PCI_SLOT(devfn) (((devfn) >> 3) & 0x1f) > #define PCI_FUNC(devfn) ((devfn) & 0x07) > +#define PCI_SLOT_MAX 32 > #define PCI_FUNC_MAX 8 > > /* Class, Vendor and Device IDs from Linux's pci_ids.h */ > diff --git a/hw/pci_internals.h b/hw/pci_internals.h > index e3c93a3..efaefcd 100644 > --- a/hw/pci_internals.h > +++ b/hw/pci_internals.h > @@ -22,7 +22,7 @@ struct PCIBus { > pci_hotplug_fn hotplug; > DeviceState *hotplug_qdev; > void *irq_opaque; > - PCIDevice *devices[256]; > + PCIDevice *devices[PCI_SLOT_MAX * PCI_FUNC_MAX]; > PCIDevice *parent_dev; > target_phys_addr_t mem_base; > > -- > 1.7.1.1