Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 16 Nov 2020 15:29:52 +0000 (UTC)
From:      Ruslan Bukin <br@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r367725 - in head/sys: dev/iommu x86/iommu
Message-ID:  <202011161529.0AGFTqTh048902@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: br
Date: Mon Nov 16 15:29:52 2020
New Revision: 367725
URL: https://svnweb.freebsd.org/changeset/base/367725

Log:
  Add device_t member to struct iommu.
  
  This is needed on arm64 for the interface between iommu framework
  and iommu controller drivers.
  
  Reviewed by:	kib
  Sponsored by:	Innovate DSbD
  Differential Revision:	https://reviews.freebsd.org/D27229

Modified:
  head/sys/dev/iommu/iommu.h
  head/sys/x86/iommu/intel_drv.c

Modified: head/sys/dev/iommu/iommu.h
==============================================================================
--- head/sys/dev/iommu/iommu.h	Mon Nov 16 11:58:22 2020	(r367724)
+++ head/sys/dev/iommu/iommu.h	Mon Nov 16 15:29:52 2020	(r367725)
@@ -67,6 +67,7 @@ struct iommu_map_entry {
 
 struct iommu_unit {
 	struct mtx lock;
+	device_t dev;
 	int unit;
 
 	int dma_enabled;

Modified: head/sys/x86/iommu/intel_drv.c
==============================================================================
--- head/sys/x86/iommu/intel_drv.c	Mon Nov 16 11:58:22 2020	(r367724)
+++ head/sys/x86/iommu/intel_drv.c	Mon Nov 16 15:29:52 2020	(r367725)
@@ -411,6 +411,7 @@ dmar_attach(device_t dev)
 	unit = device_get_softc(dev);
 	unit->dev = dev;
 	unit->iommu.unit = device_get_unit(dev);
+	unit->iommu.dev = dev;
 	dmaru = dmar_find_by_index(unit->iommu.unit);
 	if (dmaru == NULL)
 		return (EINVAL);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202011161529.0AGFTqTh048902>