Old versions of libpci (including the ones on the automatic tests
which control Xen staging propagation) do not define
PCI_LIB_VERSION or the PCI_ERR_{UNCOR_MASK,...} constants.
This means that change
8c771eb6294afc5b3754a9e3de51568d4e5986c2 breaks
the build. In this changeset I apply what is intended to be a
workaround for this problem but it may not be completely correct; this
is therefore perhaps an interim fix.
The potential problem is that the save/restore of some PCI passthrough
error handling registers (across suspend/resume) may not work properly
with old versions of libpci. However non-passthrough and non-suspect
use cases should now be fine.
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
static void pt_libpci_fixup(struct pci_dev *dev)
{
-#if PCI_LIB_VERSION < 0x030100
+#if !defined(PCI_LIB_VERSION) || PCI_LIB_VERSION < 0x030100
int i;
FILE *fp;
char path[PATH_MAX], buf[256];
/* Root Port and Root Complex Event Collector need size expansion */
int aer_size = 0x2c;
+#ifdef PCI_ERR_UNCOR_MASK
for (i=0; i < aer_size; i+=4)
{
switch (i) {
break;
}
}
+#endif
}
/* restore AER register */
/* Root Port and Root Complex Event Collector need size expansion */
int aer_size = 0x2c;
+#ifdef PCI_ERR_UNCOR_MASK
for (i=0; i < aer_size; i+=4)
{
switch (i) {
break;
}
}
+#endif
}
/* reset Interrupt and I/O resource */