From e70377dfa4bbc2e101066ca35675bed4129c5a8c Mon Sep 17 00:00:00 2001 From: Pierre Morel Date: Tue, 15 Nov 2016 15:51:38 +0800 Subject: s390x/pci: change the device array to a list In order to support a greater number of devices we use a QTAILQ list of devices instead of a limited array. This leads us to change: - every lookup function s390_pci_find_xxx() for QTAILQ - the FH_MASK_INDEX to index up to 65536 devices Signed-off-by: Pierre Morel Signed-off-by: Cornelia Huck --- hw/s390x/s390-pci-bus.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'hw/s390x/s390-pci-bus.h') diff --git a/hw/s390x/s390-pci-bus.h b/hw/s390x/s390-pci-bus.h index fe108e9330..1bd37ad821 100644 --- a/hw/s390x/s390-pci-bus.h +++ b/hw/s390x/s390-pci-bus.h @@ -27,7 +27,7 @@ #define FH_MASK_ENABLE 0x80000000 #define FH_MASK_INSTANCE 0x7f000000 #define FH_MASK_SHM 0x00ff0000 -#define FH_MASK_INDEX 0x0000001f +#define FH_MASK_INDEX 0x0000ffff #define FH_SHM_VFIO 0x00010000 #define FH_SHM_EMUL 0x00020000 #define S390_PCIPT_ADAPTER 2 @@ -285,6 +285,7 @@ typedef struct S390PCIBusDevice { ZpciState state; char *target; uint16_t uid; + uint32_t idx; uint32_t fh; uint32_t fid; bool fid_defined; @@ -299,6 +300,7 @@ typedef struct S390PCIBusDevice { IndAddr *summary_ind; IndAddr *indicator; QEMUTimer *release_timer; + QTAILQ_ENTRY(S390PCIBusDevice) link; } S390PCIBusDevice; typedef struct S390PCIBus { @@ -307,10 +309,11 @@ typedef struct S390PCIBus { typedef struct S390pciState { PCIHostState parent_obj; + uint32_t next_idx; S390PCIBus *bus; - S390PCIBusDevice *pbdev[PCI_SLOT_MAX]; GHashTable *iommu_table; QTAILQ_HEAD(, SeiContainer) pending_sei; + QTAILQ_HEAD(, S390PCIBusDevice) zpci_devs; } S390pciState; int chsc_sei_nt2_get_event(void *res); -- cgit v1.2.3