Skip to content

Commit

Permalink
o Don't include headers from iommu.h, include them from the header
Browse files Browse the repository at this point in the history
  consumers instead;
o Order includes properly.

Reviewed by:	kib
Sponsored by:	DARPA/AFRL
Differential Revision:	https://reviews.freebsd.org/D25878
  • Loading branch information
bukinr committed Jul 29, 2020
1 parent 40326c1 commit c8597a1
Show file tree
Hide file tree
Showing 11 changed files with 45 additions and 48 deletions.
8 changes: 0 additions & 8 deletions sys/dev/iommu/iommu.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,6 @@
#ifndef _SYS_IOMMU_H_
#define _SYS_IOMMU_H_

#include <sys/types.h>
#include <sys/queue.h>
#include <sys/sysctl.h>
#include <sys/taskqueue.h>
#include <sys/tree.h>

#include <dev/pci/pcireg.h>

/* Host or physical memory address, after translation. */
typedef uint64_t iommu_haddr_t;
/* Guest or bus address, before translation. */
Expand Down
8 changes: 4 additions & 4 deletions sys/dev/iommu/iommu_gas.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,26 +52,26 @@ __FBSDID("$FreeBSD$");
#include <sys/tree.h>
#include <sys/uio.h>
#include <sys/vmem.h>
#include <dev/pci/pcivar.h>
#include <vm/vm.h>
#include <vm/vm_extern.h>
#include <vm/vm_kern.h>
#include <vm/vm_object.h>
#include <vm/vm_page.h>
#include <vm/vm_map.h>
#include <vm/uma.h>
#include <dev/pci/pcireg.h>
#include <dev/pci/pcivar.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 <dev/iommu/busdma_iommu.h>
#include <dev/iommu/iommu.h>
#include <dev/pci/pcireg.h>
#include <x86/iommu/intel_dmar.h>
#endif
#include <dev/iommu/busdma_iommu.h>

/*
* Guest Address Space management.
Expand Down
2 changes: 2 additions & 0 deletions sys/dev/ntb/ntb_hw/ntb_hw_intel.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ __FBSDID("$FreeBSD$");
#include <sys/module.h>
#include <sys/mutex.h>
#include <sys/pciio.h>
#include <sys/taskqueue.h>
#include <sys/tree.h>
#include <sys/queue.h>
#include <sys/rman.h>
#include <sys/sbuf.h>
Expand Down
2 changes: 2 additions & 0 deletions sys/dev/ntb/ntb_hw/ntb_hw_plx.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ __FBSDID("$FreeBSD$");
#include <sys/module.h>
#include <sys/rman.h>
#include <sys/sysctl.h>
#include <sys/taskqueue.h>
#include <sys/tree.h>
#include <vm/vm.h>
#include <vm/pmap.h>
#include <machine/bus.h>
Expand Down
10 changes: 5 additions & 5 deletions sys/x86/iommu/intel_ctx.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,18 +58,18 @@ __FBSDID("$FreeBSD$");
#include <vm/vm_page.h>
#include <vm/vm_pager.h>
#include <vm/vm_map.h>
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <dev/pci/pcireg.h>
#include <dev/pci/pcivar.h>
#include <machine/atomic.h>
#include <machine/bus.h>
#include <machine/md_var.h>
#include <machine/specialreg.h>
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <x86/include/busdma_impl.h>
#include <x86/iommu/intel_reg.h>
#include <dev/iommu/busdma_iommu.h>
#include <dev/pci/pcireg.h>
#include <x86/iommu/intel_reg.h>
#include <x86/iommu/intel_dmar.h>
#include <dev/pci/pcivar.h>

static MALLOC_DEFINE(M_DMAR_CTX, "dmar_ctx", "Intel DMAR Context");
static MALLOC_DEFINE(M_DMAR_DOMAIN, "dmar_dom", "Intel DMAR Domain");
Expand Down
16 changes: 8 additions & 8 deletions sys/x86/iommu/intel_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,23 +54,23 @@ __FBSDID("$FreeBSD$");
#include <sys/taskqueue.h>
#include <sys/tree.h>
#include <sys/vmem.h>
#include <machine/bus.h>
#include <machine/pci_cfgreg.h>
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <dev/acpica/acpivar.h>
#include <vm/vm.h>
#include <vm/vm_extern.h>
#include <vm/vm_kern.h>
#include <vm/vm_object.h>
#include <vm/vm_page.h>
#include <vm/vm_pager.h>
#include <vm/vm_map.h>
#include <x86/include/busdma_impl.h>
#include <x86/iommu/intel_reg.h>
#include <dev/iommu/busdma_iommu.h>
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <dev/acpica/acpivar.h>
#include <dev/pci/pcireg.h>
#include <dev/pci/pcivar.h>
#include <machine/bus.h>
#include <machine/pci_cfgreg.h>
#include <x86/include/busdma_impl.h>
#include <dev/iommu/busdma_iommu.h>
#include <x86/iommu/intel_reg.h>
#include <x86/iommu/intel_dmar.h>

#ifdef DEV_APIC
Expand Down
4 changes: 2 additions & 2 deletions sys/x86/iommu/intel_idpgtbl.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,15 @@ __FBSDID("$FreeBSD$");
#include <vm/vm_page.h>
#include <vm/vm_pager.h>
#include <vm/vm_map.h>
#include <dev/pci/pcireg.h>
#include <machine/atomic.h>
#include <machine/bus.h>
#include <machine/cpu.h>
#include <machine/md_var.h>
#include <machine/specialreg.h>
#include <x86/include/busdma_impl.h>
#include <x86/iommu/intel_reg.h>
#include <dev/iommu/busdma_iommu.h>
#include <dev/pci/pcireg.h>
#include <x86/iommu/intel_reg.h>
#include <x86/iommu/intel_dmar.h>

static int domain_unmap_buf_locked(struct dmar_domain *domain,
Expand Down
11 changes: 6 additions & 5 deletions sys/x86/iommu/intel_intrmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,24 +40,25 @@ __FBSDID("$FreeBSD$");
#include <sys/mutex.h>
#include <sys/rman.h>
#include <sys/rwlock.h>
#include <sys/sysctl.h>
#include <sys/taskqueue.h>
#include <sys/tree.h>
#include <sys/vmem.h>
#include <machine/bus.h>
#include <machine/intr_machdep.h>
#include <vm/vm.h>
#include <vm/vm_extern.h>
#include <vm/vm_kern.h>
#include <vm/vm_object.h>
#include <vm/vm_page.h>
#include <dev/pci/pcireg.h>
#include <dev/pci/pcivar.h>
#include <machine/bus.h>
#include <machine/intr_machdep.h>
#include <x86/include/apicreg.h>
#include <x86/include/apicvar.h>
#include <x86/include/busdma_impl.h>
#include <x86/iommu/intel_reg.h>
#include <dev/iommu/busdma_iommu.h>
#include <dev/pci/pcireg.h>
#include <x86/iommu/intel_reg.h>
#include <x86/iommu/intel_dmar.h>
#include <dev/pci/pcivar.h>
#include <x86/iommu/iommu_intrmap.h>

static struct dmar_unit *dmar_ir_find(device_t src, uint16_t *rid,
Expand Down
12 changes: 6 additions & 6 deletions sys/x86/iommu/intel_qi.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,20 +45,20 @@ __FBSDID("$FreeBSD$");
#include <sys/time.h>
#include <sys/tree.h>
#include <sys/vmem.h>
#include <machine/bus.h>
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <dev/acpica/acpivar.h>
#include <vm/vm.h>
#include <vm/vm_extern.h>
#include <vm/vm_kern.h>
#include <vm/vm_page.h>
#include <vm/vm_map.h>
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <dev/acpica/acpivar.h>
#include <dev/pci/pcireg.h>
#include <machine/bus.h>
#include <machine/cpu.h>
#include <x86/include/busdma_impl.h>
#include <x86/iommu/intel_reg.h>
#include <dev/iommu/busdma_iommu.h>
#include <dev/pci/pcireg.h>
#include <x86/iommu/intel_reg.h>
#include <x86/iommu/intel_dmar.h>

static bool
Expand Down
14 changes: 7 additions & 7 deletions sys/x86/iommu/intel_quirks.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,23 +46,23 @@ __FBSDID("$FreeBSD$");
#include <sys/taskqueue.h>
#include <sys/tree.h>
#include <sys/vmem.h>
#include <machine/bus.h>
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <dev/acpica/acpivar.h>
#include <vm/vm.h>
#include <vm/vm_extern.h>
#include <vm/vm_kern.h>
#include <vm/vm_object.h>
#include <vm/vm_page.h>
#include <vm/vm_pager.h>
#include <vm/vm_map.h>
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <dev/acpica/acpivar.h>
#include <dev/pci/pcireg.h>
#include <dev/pci/pcivar.h>
#include <machine/bus.h>
#include <x86/include/busdma_impl.h>
#include <x86/iommu/intel_reg.h>
#include <dev/iommu/busdma_iommu.h>
#include <dev/pci/pcireg.h>
#include <x86/iommu/intel_reg.h>
#include <x86/iommu/intel_dmar.h>
#include <dev/pci/pcivar.h>

typedef void (*dmar_quirk_cpu_fun)(struct dmar_unit *);

Expand Down
6 changes: 3 additions & 3 deletions sys/x86/iommu/intel_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,22 +51,22 @@ __FBSDID("$FreeBSD$");
#include <sys/time.h>
#include <sys/tree.h>
#include <sys/vmem.h>
#include <dev/pci/pcivar.h>
#include <vm/vm.h>
#include <vm/vm_extern.h>
#include <vm/vm_kern.h>
#include <vm/vm_object.h>
#include <vm/vm_page.h>
#include <vm/vm_map.h>
#include <vm/vm_pageout.h>
#include <dev/pci/pcireg.h>
#include <dev/pci/pcivar.h>
#include <machine/bus.h>
#include <machine/cpu.h>
#include <machine/intr_machdep.h>
#include <x86/include/apicvar.h>
#include <x86/include/busdma_impl.h>
#include <x86/iommu/intel_reg.h>
#include <dev/iommu/busdma_iommu.h>
#include <dev/pci/pcireg.h>
#include <x86/iommu/intel_reg.h>
#include <x86/iommu/intel_dmar.h>

u_int
Expand Down

0 comments on commit c8597a1

Please sign in to comment.