svn commit: r366257 - in head/sys/dev: acpica iommu pci

Ruslan Bukin br at FreeBSD.org
Tue Sep 29 15:10:57 UTC 2020


Author: br
Date: Tue Sep 29 15:10:56 2020
New Revision: 366257
URL: https://svnweb.freebsd.org/changeset/base/366257

Log:
  o Rename acpi_iommu_get_dma_tag() -> iommu_get_dma_tag().
    This function isn't ACPI dependent and we may use it on FDT systems
    as well.
  o Don't repeat the function declaration, include iommu.h instead.
  
  Reviewed by:	andrew, kib
  Sponsored by:	DARPA, AFRL
  Differential Revision:	https://reviews.freebsd.org/D26584

Modified:
  head/sys/dev/acpica/acpi_pci.c
  head/sys/dev/iommu/busdma_iommu.c
  head/sys/dev/iommu/busdma_iommu.h
  head/sys/dev/iommu/iommu.h
  head/sys/dev/pci/pci.c

Modified: head/sys/dev/acpica/acpi_pci.c
==============================================================================
--- head/sys/dev/acpica/acpi_pci.c	Tue Sep 29 15:09:38 2020	(r366256)
+++ head/sys/dev/acpica/acpi_pci.c	Tue Sep 29 15:10:56 2020	(r366257)
@@ -37,6 +37,8 @@ __FBSDID("$FreeBSD$");
 #include <sys/kernel.h>
 #include <sys/malloc.h>
 #include <sys/module.h>
+#include <sys/taskqueue.h>
+#include <sys/tree.h>
 
 #include <contrib/dev/acpica/include/acpi.h>
 #include <contrib/dev/acpica/include/accommon.h>
@@ -49,6 +51,8 @@ __FBSDID("$FreeBSD$");
 #include <dev/pci/pcivar.h>
 #include <dev/pci/pci_private.h>
 
+#include <dev/iommu/iommu.h>
+
 #include "pcib_if.h"
 #include "pci_if.h"
 
@@ -456,7 +460,6 @@ acpi_pci_detach(device_t dev)
 }
 
 #ifdef ACPI_DMAR
-bus_dma_tag_t acpi_iommu_get_dma_tag(device_t dev, device_t child);
 static bus_dma_tag_t
 acpi_pci_get_dma_tag(device_t bus, device_t child)
 {
@@ -464,7 +467,7 @@ acpi_pci_get_dma_tag(device_t bus, device_t child)
 
 	if (device_get_parent(child) == bus) {
 		/* try iommu and return if it works */
-		tag = acpi_iommu_get_dma_tag(bus, child);
+		tag = iommu_get_dma_tag(bus, child);
 	} else
 		tag = NULL;
 	if (tag == NULL)

Modified: head/sys/dev/iommu/busdma_iommu.c
==============================================================================
--- head/sys/dev/iommu/busdma_iommu.c	Tue Sep 29 15:09:38 2020	(r366256)
+++ head/sys/dev/iommu/busdma_iommu.c	Tue Sep 29 15:10:56 2020	(r366257)
@@ -270,7 +270,7 @@ iommu_instantiate_ctx(struct iommu_unit *unit, device_
 }
 
 bus_dma_tag_t
-acpi_iommu_get_dma_tag(device_t dev, device_t child)
+iommu_get_dma_tag(device_t dev, device_t child)
 {
 	struct iommu_unit *unit;
 	struct iommu_ctx *ctx;

Modified: head/sys/dev/iommu/busdma_iommu.h
==============================================================================
--- head/sys/dev/iommu/busdma_iommu.h	Tue Sep 29 15:09:38 2020	(r366256)
+++ head/sys/dev/iommu/busdma_iommu.h	Tue Sep 29 15:10:56 2020	(r366257)
@@ -61,6 +61,4 @@ struct bus_dmamap_iommu {
 
 extern struct bus_dma_impl bus_dma_iommu_impl;
 
-bus_dma_tag_t acpi_iommu_get_dma_tag(device_t dev, device_t child);
-
 #endif

Modified: head/sys/dev/iommu/iommu.h
==============================================================================
--- head/sys/dev/iommu/iommu.h	Tue Sep 29 15:09:38 2020	(r366256)
+++ head/sys/dev/iommu/iommu.h	Tue Sep 29 15:10:56 2020	(r366257)
@@ -232,6 +232,8 @@ bool bus_dma_iommu_set_buswide(device_t dev);
 int bus_dma_iommu_load_ident(bus_dma_tag_t dmat, bus_dmamap_t map,
     vm_paddr_t start, vm_size_t length, int flags);
 
+bus_dma_tag_t iommu_get_dma_tag(device_t dev, device_t child);
+
 SYSCTL_DECL(_hw_iommu);
 
 #endif /* !_SYS_IOMMU_H_ */

Modified: head/sys/dev/pci/pci.c
==============================================================================
--- head/sys/dev/pci/pci.c	Tue Sep 29 15:09:38 2020	(r366256)
+++ head/sys/dev/pci/pci.c	Tue Sep 29 15:10:56 2020	(r366257)
@@ -47,6 +47,8 @@ __FBSDID("$FreeBSD$");
 #include <sys/queue.h>
 #include <sys/sysctl.h>
 #include <sys/systm.h>
+#include <sys/taskqueue.h>
+#include <sys/tree.h>
 
 #include <vm/vm.h>
 #include <vm/pmap.h>
@@ -77,6 +79,8 @@ __FBSDID("$FreeBSD$");
 #include <dev/usb/controller/ohcireg.h>
 #include <dev/usb/controller/uhcireg.h>
 
+#include <dev/iommu/iommu.h>
+
 #include "pcib_if.h"
 #include "pci_if.h"
 
@@ -5680,7 +5684,6 @@ pci_get_resource_list (device_t dev, device_t child)
 }
 
 #ifdef ACPI_DMAR
-bus_dma_tag_t acpi_iommu_get_dma_tag(device_t dev, device_t child);
 bus_dma_tag_t
 pci_get_dma_tag(device_t bus, device_t dev)
 {
@@ -5689,7 +5692,7 @@ pci_get_dma_tag(device_t bus, device_t dev)
 
 	if (device_get_parent(dev) == bus) {
 		/* try iommu and return if it works */
-		tag = acpi_iommu_get_dma_tag(bus, dev);
+		tag = iommu_get_dma_tag(bus, dev);
 	} else
 		tag = NULL;
 	if (tag == NULL) {


More information about the svn-src-head mailing list