From owner-svn-src-head@freebsd.org Tue Sep 29 15:10:57 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C8DAA4260E7; Tue, 29 Sep 2020 15:10:57 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C12rx4W00z4vfR; Tue, 29 Sep 2020 15:10:57 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7DE9C10989; Tue, 29 Sep 2020 15:10:57 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08TFAvoC069583; Tue, 29 Sep 2020 15:10:57 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08TFAuhN069579; Tue, 29 Sep 2020 15:10:56 GMT (envelope-from br@FreeBSD.org) Message-Id: <202009291510.08TFAuhN069579@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Tue, 29 Sep 2020 15:10:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366257 - in head/sys/dev: acpica iommu pci X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: in head/sys/dev: acpica iommu pci X-SVN-Commit-Revision: 366257 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Sep 2020 15:10:57 -0000 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 #include #include +#include +#include #include #include @@ -49,6 +51,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include + #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 #include #include +#include +#include #include #include @@ -77,6 +79,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include + #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) {