svn commit: r367725 - in head/sys: dev/iommu x86/iommu

Ruslan Bukin br at FreeBSD.org
Mon Nov 16 15:29:53 UTC 2020


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);


More information about the svn-src-head mailing list