Add iommu_get_ctx_domain() that allows to get iommu domain for a given

iommu context.

Submitted by:	andrew
Sponsored by:	Innovate DSbD
This commit is contained in:
Ruslan Bukin 2020-10-14 14:12:15 +00:00
parent 066e1d1af3
commit f5cafae199
2 changed files with 8 additions and 0 deletions

View file

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

View file

@ -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)
{