diff --git a/sys/dev/iommu/iommu.h b/sys/dev/iommu/iommu.h index 04b8bf8ce62..cf4aad1e44f 100644 --- a/sys/dev/iommu/iommu.h +++ b/sys/dev/iommu/iommu.h @@ -234,6 +234,7 @@ int bus_dma_iommu_load_ident(bus_dma_tag_t dmat, bus_dmamap_t map, bus_dma_tag_t iommu_get_dma_tag(device_t dev, device_t child); struct iommu_ctx *iommu_get_dev_ctx(device_t dev); +struct iommu_domain *iommu_get_ctx_domain(struct iommu_ctx *ctx); SYSCTL_DECL(_hw_iommu); diff --git a/sys/dev/iommu/iommu_gas.c b/sys/dev/iommu/iommu_gas.c index d6a09d852bf..02b82946b4a 100644 --- a/sys/dev/iommu/iommu_gas.c +++ b/sys/dev/iommu/iommu_gas.c @@ -208,6 +208,13 @@ iommu_gas_rb_remove(struct iommu_domain *domain, struct iommu_map_entry *entry) RB_REMOVE(iommu_gas_entries_tree, &domain->rb_root, entry); } +struct iommu_domain * +iommu_get_ctx_domain(struct iommu_ctx *ctx) +{ + + return (ctx->domain); +} + void iommu_gas_init_domain(struct iommu_domain *domain) {