Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/iommu/busdma_iommu.c
Show First 20 Lines • Show All 63 Lines • ▼ Show 20 Lines | |||||
#include <machine/md_var.h> | #include <machine/md_var.h> | ||||
#if defined(__amd64__) || defined(__i386__) | #if defined(__amd64__) || defined(__i386__) | ||||
#include <machine/specialreg.h> | #include <machine/specialreg.h> | ||||
#include <x86/include/busdma_impl.h> | #include <x86/include/busdma_impl.h> | ||||
#include <x86/iommu/intel_reg.h> | #include <x86/iommu/intel_reg.h> | ||||
#include <dev/iommu/busdma_iommu.h> | #include <dev/iommu/busdma_iommu.h> | ||||
#include <dev/iommu/iommu.h> | #include <dev/iommu/iommu.h> | ||||
#include <x86/iommu/intel_dmar.h> | #include <x86/iommu/intel_dmar.h> | ||||
#elif defined(__aarch64__) | |||||
#include <dev/iommu/busdma_iommu.h> | |||||
#include <arm64/iommu/iommu.h> | |||||
#endif | #endif | ||||
/* | /* | ||||
* busdma_iommu.c, the implementation of the busdma(9) interface using | * busdma_iommu.c, the implementation of the busdma(9) interface using | ||||
* IOMMU units from Intel VT-d. | * IOMMU units from Intel VT-d. | ||||
*/ | */ | ||||
static bool | static bool | ||||
▲ Show 20 Lines • Show All 798 Lines • ▼ Show 20 Lines | |||||
*/ | */ | ||||
static void | static void | ||||
iommu_bus_dmamap_unload(bus_dma_tag_t dmat, bus_dmamap_t map1) | iommu_bus_dmamap_unload(bus_dma_tag_t dmat, bus_dmamap_t map1) | ||||
{ | { | ||||
struct bus_dma_tag_iommu *tag; | struct bus_dma_tag_iommu *tag; | ||||
struct bus_dmamap_iommu *map; | struct bus_dmamap_iommu *map; | ||||
struct iommu_ctx *ctx; | struct iommu_ctx *ctx; | ||||
struct iommu_domain *domain; | struct iommu_domain *domain; | ||||
#if defined(__amd64__) | #if defined(__amd64__) || defined(__aarch64__) | ||||
andrew: Why not `#if !defined(__i386__)` | |||||
brAuthorUnsubmitted Done Inline ActionsThanks. Fixed. br: Thanks. Fixed. | |||||
struct iommu_map_entries_tailq entries; | struct iommu_map_entries_tailq entries; | ||||
#endif | #endif | ||||
tag = (struct bus_dma_tag_iommu *)dmat; | tag = (struct bus_dma_tag_iommu *)dmat; | ||||
map = (struct bus_dmamap_iommu *)map1; | map = (struct bus_dmamap_iommu *)map1; | ||||
ctx = tag->ctx; | ctx = tag->ctx; | ||||
domain = ctx->domain; | domain = ctx->domain; | ||||
atomic_add_long(&ctx->unloads, 1); | atomic_add_long(&ctx->unloads, 1); | ||||
▲ Show 20 Lines • Show All 176 Lines • Show Last 20 Lines |
Why not #if !defined(__i386__)