Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/pci/pci.c
Show First 20 Lines • Show All 5,679 Lines • ▼ Show 20 Lines | |||||
struct resource_list * | struct resource_list * | ||||
pci_get_resource_list (device_t dev, device_t child) | pci_get_resource_list (device_t dev, device_t child) | ||||
{ | { | ||||
struct pci_devinfo *dinfo = device_get_ivars(child); | struct pci_devinfo *dinfo = device_get_ivars(child); | ||||
return (&dinfo->resources); | return (&dinfo->resources); | ||||
} | } | ||||
#ifdef ACPI_DMAR | #if defined(ACPI_DMAR) || defined(ACPI_SMMU) | ||||
bus_dma_tag_t acpi_iommu_get_dma_tag(device_t dev, device_t child); | bus_dma_tag_t acpi_iommu_get_dma_tag(device_t dev, device_t child); | ||||
bus_dma_tag_t | bus_dma_tag_t | ||||
pci_get_dma_tag(device_t bus, device_t dev) | pci_get_dma_tag(device_t bus, device_t dev) | ||||
{ | { | ||||
bus_dma_tag_t tag; | bus_dma_tag_t tag; | ||||
struct pci_softc *sc; | struct pci_softc *sc; | ||||
if (device_get_parent(dev) == bus) { | if (device_get_parent(dev) == bus) { | ||||
/* try iommu and return if it works */ | /* try iommu and return if it works */ | ||||
tag = acpi_iommu_get_dma_tag(bus, dev); | tag = acpi_iommu_get_dma_tag(bus, dev); | ||||
} else | } else | ||||
tag = NULL; | tag = NULL; | ||||
if (tag == NULL) { | if (tag == NULL) { | ||||
sc = device_get_softc(bus); | sc = device_get_softc(bus); | ||||
tag = sc->sc_dma_tag; | tag = sc->sc_dma_tag; | ||||
} | } | ||||
return (tag); | return (tag); | ||||
} | } | ||||
#else | #else | ||||
bus_dma_tag_t | bus_dma_tag_t | ||||
pci_get_dma_tag(device_t bus, device_t dev) | pci_get_dma_tag(device_t bus, device_t dev) | ||||
{ | { | ||||
kib: Am I right that ACPI_DMAR and ACPI_SMMU differ only in dmar_get_dma_tag… | |||||
struct pci_softc *sc = device_get_softc(bus); | struct pci_softc *sc = device_get_softc(bus); | ||||
return (sc->sc_dma_tag); | return (sc->sc_dma_tag); | ||||
} | } | ||||
#endif | #endif | ||||
uint32_t | uint32_t | ||||
pci_read_config_method(device_t dev, device_t child, int reg, int width) | pci_read_config_method(device_t dev, device_t child, int reg, int width) | ||||
▲ Show 20 Lines • Show All 973 Lines • Show Last 20 Lines |
Am I right that ACPI_DMAR and ACPI_SMMU differ only in dmar_get_dma_tag->bounce_smmu_get_dma_tag ? This should be unified, e.g. rename both functions to acpi_iommu_get_dma_tag.