summaryrefslogtreecommitdiff
path: root/xc/programs/Xserver/hw/xfree86/os-support/bus/ix86Pci.c
diff options
context:
space:
mode:
Diffstat (limited to 'xc/programs/Xserver/hw/xfree86/os-support/bus/ix86Pci.c')
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/bus/ix86Pci.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/bus/ix86Pci.c b/xc/programs/Xserver/hw/xfree86/os-support/bus/ix86Pci.c
index 69597dede..e07f5497c 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/bus/ix86Pci.c
+++ b/xc/programs/Xserver/hw/xfree86/os-support/bus/ix86Pci.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/ix86Pci.c,v 1.14 2002/09/16 16:55:33 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/ix86Pci.c,v 1.18 2003/01/27 00:01:44 tsi Exp $ */
/*
* ix86Pci.c - x86 PCI driver
*
@@ -199,10 +199,7 @@ ix86PciBusCheck(void)
tag = PCI_MAKE_TAG(0, device, 0);
id = (*ix86Pci0.funcs->pciReadLong)(tag, PCI_ID_REG);
- if ((id == 0x00000000) ||
- (id == 0xffffffff) ||
- (id == 0x0000ffff) ||
- (id == 0xffff0000))
+ if ((CARD16)(id + 1U) <= (CARD16)1UL)
continue;
/* The rest of this is inspired by the Linux kernel */
@@ -664,26 +661,30 @@ ix86PciInit()
/*
* A small table of host bridges that limit the number of PCI buses to less
- * than the maximum of 256. Please keep this table in ascending devid order.
+ * than the maximum of 256.
*/
static struct {
CARD32 devid;
int maxpcibus;
} host_bridges[] = {
{ DEVID(ALI_2, M1541), 128},
+ { DEVID(VIA, APOLLOVP1), 64},
{ DEVID(VIA, APOLLOPRO133X), 64},
{ DEVID(INTEL, 430HX_BRIDGE), 16},
{ DEVID(INTEL, 440BX_BRIDGE), 32},
- { PCI_NOT_FOUND, MAX_PCI_BUSES}
};
+#define NUM_BRIDGES (sizeof(host_bridges) / sizeof(host_bridges[0]))
void ARCH_PCI_HOST_BRIDGE(pciConfigPtr pPCI)
{
int i;
- for (i = 0; pPCI->pci_device_vendor > host_bridges[i].devid; i++);
- if (pPCI->pci_device_vendor == host_bridges[i].devid)
- pciMaxBusNum = host_bridges[i].maxpcibus;
+ for (i = 0; i < NUM_BRIDGES; i++) {
+ if (pPCI->pci_device_vendor == host_bridges[i].devid) {
+ pciMaxBusNum = host_bridges[i].maxpcibus;
+ break;
+ }
+ }
}
#endif /* ARCH_PCI_HOST_BRIDGE */