* XXX * This should really be done using the PCI BIOS.
* This should really be done using the PCI BIOS.  If we get here, the * PCI BIOS does not exist, or the boot blocks did not provide the * information.
pci_mode_detect(){#ifdef PCI_CONF_MODE#if (PCI_CONF_MODE == 1) || (PCI_CONF_MODE == 2)	return (pci_mode = PCI_CONF_MODE);#else#error Invalid PCI configuration mode.#endif#else	if (pci_mode != -1)		return pci_mode;	/*	 * We try to divine which configuration mode the host bridge wants.  We	 * try mode 2 first, because our probe for mode 1 is likely to succeed	 * for mode 2 also.	 *	 * XXX	 * This should really be done using the PCI BIOS.	 */	outb(PCI_MODE2_ENABLE_REG, 0);	outb(PCI_MODE2_FORWARD_REG, 0);	if (inb(PCI_MODE2_ENABLE_REG) != 0 ||	    inb(PCI_MODE2_FORWARD_REG) != 0)		goto not2;	return (pci_mode = 2);not2:	outl(PCI_MODE1_ADDRESS_REG, PCI_MODE1_ENABLE);	if (inl(PCI_MODE1_ADDRESS_REG) != PCI_MODE1_ENABLE)		goto not1;	outl(PCI_MODE1_ADDRESS_REG, 0);	if (inl(PCI_MODE1_ADDRESS_REG) != 0)		goto not1;	return (pci_mode = 1);not1:	return (pci_mode = 0);#endif}