diff options
author | Pierre Morel <pmorel@linux.vnet.ibm.com> | 2016-11-15 15:51:38 +0800 |
---|---|---|
committer | Cornelia Huck <cornelia.huck@de.ibm.com> | 2017-01-20 10:01:24 +0100 |
commit | e70377dfa4bbc2e101066ca35675bed4129c5a8c (patch) | |
tree | a9a0ba6a3937e8dcc4fff8cb72396cb756d3d031 /hw/s390x/s390-pci-bus.h | |
parent | 03805be08195fca358b12dacc26370f8d1b2c27b (diff) |
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 <pmorel@linux.vnet.ibm.com>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Diffstat (limited to 'hw/s390x/s390-pci-bus.h')
-rw-r--r-- | hw/s390x/s390-pci-bus.h | 7 |
1 files changed, 5 insertions, 2 deletions
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); |