[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 1/5] pci: replace the magic, 256, for the maximum
From: |
Isaku Yamahata |
Subject: |
[Qemu-devel] [PATCH v2 1/5] pci: replace the magic, 256, for the maximum of devfn |
Date: |
Thu, 27 Jan 2011 15:56:35 +0900 |
Introduce symbol PCI_DEVFN_MAX for the maximum of devfn
and replace the magic, 256.
Signed-off-by: Isaku Yamahata <address@hidden>
---
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
- [Qemu-devel] [PATCH v2 0/5] pci/pcie: implement ARI enable bit correctly, Isaku Yamahata, 2011/01/27
- [Qemu-devel] [PATCH v2 3/5] pci/pcie: make pci_find_device() ARI aware., Isaku Yamahata, 2011/01/27
- [Qemu-devel] [PATCH v2 4/5] pci: use PCI_SLOT in pci_get_bus_devfn(), Isaku Yamahata, 2011/01/27
- [Qemu-devel] [PATCH v2 5/5] pci: use uint8_t for devfn_min, Isaku Yamahata, 2011/01/27
- [Qemu-devel] [PATCH v2 1/5] pci: replace the magic, 256, for the maximum of devfn,
Isaku Yamahata <=
- [Qemu-devel] [PATCH v2 2/5] pci: use devfn for pci_find_device() instead of (slot, fn) pair, Isaku Yamahata, 2011/01/27
- [Qemu-devel] Re: [PATCH v2 0/5] pci/pcie: implement ARI enable bit correctly, Michael S. Tsirkin, 2011/01/27