From patchwork Thu Jan 27 06:56:35 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Isaku Yamahata X-Patchwork-Id: 80604 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 4BD35B7105 for ; Thu, 27 Jan 2011 18:04:52 +1100 (EST) Received: from localhost ([127.0.0.1]:50317 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PiLuS-0004RL-Rf for incoming@patchwork.ozlabs.org; Thu, 27 Jan 2011 02:04:48 -0500 Received: from [140.186.70.92] (port=44824 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PiLmi-000074-2O for qemu-devel@nongnu.org; Thu, 27 Jan 2011 01:56:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PiLme-0003Pb-EL for qemu-devel@nongnu.org; Thu, 27 Jan 2011 01:56:47 -0500 Received: from mail.valinux.co.jp ([210.128.90.3]:37199) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PiLme-0003Ot-5C for qemu-devel@nongnu.org; Thu, 27 Jan 2011 01:56:44 -0500 Received: from ps.local.valinux.co.jp (vagw.valinux.co.jp [210.128.90.14]) by mail.valinux.co.jp (Postfix) with SMTP id AE09287479; Thu, 27 Jan 2011 15:56:40 +0900 (JST) Received: (nullmailer pid 32104 invoked by uid 1000); Thu, 27 Jan 2011 06:56:39 -0000 From: Isaku Yamahata To: qemu-devel@nongnu.org Date: Thu, 27 Jan 2011 15:56:35 +0900 Message-Id: X-Mailer: git-send-email 1.7.1.1 In-Reply-To: References: In-Reply-To: References: X-Virus-Scanned: clamav-milter 0.95.2 at va-mail.local.valinux.co.jp X-Virus-Status: Clean X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) Cc: yamahata@valinux.co.jp, mst@redhat.com Subject: [Qemu-devel] [PATCH v2 1/5] pci: replace the magic, 256, for the maximum of devfn X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Introduce symbol PCI_DEVFN_MAX for the maximum of devfn and replace the magic, 256. Signed-off-by: Isaku Yamahata --- 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;