Fix build broken by r336130

Add ifdef's to compile parts of pci_host_generic only on armv8
This commit is contained in:
Wojciech Macek 2018-07-10 09:49:27 +00:00
parent 65c3a353e6
commit ad90dbb842

View File

@ -99,6 +99,8 @@ static int generic_pcie_read_ivar(device_t dev, device_t child, int index,
uintptr_t *result);
static int generic_pcie_write_ivar(device_t dev, device_t child, int index,
uintptr_t value);
#if defined(__aarch64__)
static void pci_host_generic_apply_quirks(device_t);
static void thunderx2_ahci_bar_quirk(device_t);
@ -114,6 +116,7 @@ struct pci_host_generic_block_entry pci_host_generic_blocked[] =
{CPU_IMPL_CAVIUM, CPU_PART_THUNDERX2, 0, 0, 0x80, 0x10},
{0, 0, 0, 0, 0, 0}
};
#endif
int
pci_host_generic_core_attach(device_t dev)
@ -168,11 +171,14 @@ pci_host_generic_core_attach(device_t dev)
return (error);
}
#if defined(__aarch64__)
pci_host_generic_apply_quirks(dev);
#endif
return (0);
}
#if defined(__aarch64__)
static void
pci_host_generic_apply_quirks(device_t dev)
{
@ -191,6 +197,7 @@ pci_host_generic_apply_quirks(device_t dev)
quirk++;
}
}
#endif
static uint32_t
generic_pcie_read_config(device_t dev, u_int bus, u_int slot,
@ -201,12 +208,15 @@ generic_pcie_read_config(device_t dev, u_int bus, u_int slot,
bus_space_tag_t t;
uint64_t offset;
uint32_t data;
#if defined(__aarch64__)
struct pci_host_generic_block_entry *block;
#endif
if ((bus > PCI_BUSMAX) || (slot > PCI_SLOTMAX) ||
(func > PCI_FUNCMAX) || (reg > PCIE_REGMAX))
return (~0U);
#if defined(__aarch64__)
block = pci_host_generic_blocked;
while (1) {
if (block->impl == 0)
@ -219,6 +229,7 @@ generic_pcie_read_config(device_t dev, u_int bus, u_int slot,
block++;
}
#endif
sc = device_get_softc(dev);
@ -462,6 +473,7 @@ static device_method_t generic_pcie_methods[] = {
DEFINE_CLASS_0(pcib, generic_pcie_core_driver,
generic_pcie_methods, sizeof(struct generic_pcie_core_softc));
#if defined(__aarch64__)
static void thunderx2_ahci_bar_quirk(device_t dev)
{
@ -478,3 +490,4 @@ static void thunderx2_ahci_bar_quirk(device_t dev)
PCIB_WRITE_CONFIG(dev, 0, 16, 1, 0x1c, 0x40, 4);
}
}
#endif