o Add machine/iommu.h and include MD iommu headers from it,

so we don't ifdef for every arch in busdma_iommu.c;
o No need to include specialreg.h for x86, remove it.

Requested by:	andrew
Reviewed by:	kib
Sponsored by:	DARPA/AFRL
Differential Revision:	https://reviews.freebsd.org/D25957
This commit is contained in:
Ruslan Bukin 2020-08-05 19:11:31 +00:00
parent 94e9ef85c5
commit c4cd699010
5 changed files with 28 additions and 10 deletions

View File

@ -0,0 +1,6 @@
/*-
* This file is in the public domain.
*/
/* $FreeBSD$ */
#include <x86/iommu.h>

View File

@ -59,17 +59,12 @@ __FBSDID("$FreeBSD$");
#include <vm/vm_object.h>
#include <vm/vm_page.h>
#include <vm/vm_map.h>
#include <dev/iommu/iommu.h>
#include <machine/atomic.h>
#include <machine/bus.h>
#include <machine/md_var.h>
#if defined(__amd64__) || defined(__i386__)
#include <machine/specialreg.h>
#include <x86/include/busdma_impl.h>
#include <x86/iommu/intel_reg.h>
#include <machine/iommu.h>
#include <dev/iommu/busdma_iommu.h>
#include <dev/iommu/iommu.h>
#include <x86/iommu/intel_dmar.h>
#endif
/*
* busdma_iommu.c, the implementation of the busdma(9) interface using

View File

@ -65,9 +65,7 @@ __FBSDID("$FreeBSD$");
#include <machine/atomic.h>
#include <machine/bus.h>
#include <machine/md_var.h>
#if defined(__amd64__) || defined(__i386__)
#include <x86/iommu/intel_reg.h>
#endif
#include <machine/iommu.h>
#include <dev/iommu/busdma_iommu.h>
/*

6
sys/i386/include/iommu.h Normal file
View File

@ -0,0 +1,6 @@
/*-
* This file is in the public domain.
*/
/* $FreeBSD$ */
#include <x86/iommu.h>

13
sys/x86/include/iommu.h Normal file
View File

@ -0,0 +1,13 @@
/*-
* This file is in the public domain.
*/
/* $FreeBSD$ */
#ifndef _MACHINE_IOMMU_H_
#define _MACHINE_IOMMU_H_
#include <x86/include/busdma_impl.h>
#include <x86/iommu/intel_reg.h>
#include <x86/iommu/intel_dmar.h>
#endif /* !_MACHINE_IOMMU_H_ */