clib: Some PCI define cleanups

This commit is contained in:
RichardG867
2024-10-25 15:40:02 -03:00
parent 4d4a29b936
commit e120b47de0

View File

@@ -32,7 +32,8 @@ uint8_t pci_mechanism = 0, pci_device_count = 0;
#ifdef PCI_LIB_VERSION
static struct pci_access *pacc;
static struct pci_dev *pdev = NULL;
# ifdef _WIN32
# if defined(_WIN32) && (PCI_LIB_VERSION >= 0x030800)
# define DUMMY_CONFIG_SPACE
static const char win_notice[] = "NOTICE: These are dummy configuration registers generated by libpci, as it cannot access the real ones under Windows. It does not reflect the device's actual configuration.";
# endif
#endif
@@ -142,7 +143,7 @@ pci_init_dev(uint8_t bus, uint8_t dev, uint8_t func)
if (!pacc->devices) {
libpci_scan_bus(pacc);
#if defined(_WIN32) && (PCI_LIB_VERSION >= 0x030800)
# ifdef DUMMY_CONFIG_SPACE
/* Generate additional configuration values not generated by
libpci's emulated configuration space code on Windows. */
if ((pacc->method == PCI_ACCESS_WIN32_CFGMGR32) && !pacc->backend_data) { /* backend_data is NULL if no usable raw access method was found */
@@ -179,7 +180,7 @@ pci_init_dev(uint8_t bus, uint8_t dev, uint8_t func)
}
}
}
#endif
# endif
}
for (pdev = pacc->devices; pdev; pdev = pdev->next) {