Lines Matching refs:iodom

83 iommu_domain_unmap_buf(struct iommu_domain *iodom, iommu_gaddr_t base,  in iommu_domain_unmap_buf()  argument
89 iommu = iodom->iommu; in iommu_domain_unmap_buf()
91 error = IOMMU_UNMAP(iommu->dev, iodom, base, size); in iommu_domain_unmap_buf()
97 iommu_domain_map_buf(struct iommu_domain *iodom, iommu_gaddr_t base, in iommu_domain_map_buf() argument
115 iommu = iodom->iommu; in iommu_domain_map_buf()
117 error = IOMMU_MAP(iommu->dev, iodom, va, ma, size, prot); in iommu_domain_map_buf()
130 struct iommu_domain *iodom; in iommu_domain_alloc() local
132 iodom = IOMMU_DOMAIN_ALLOC(iommu->dev, iommu); in iommu_domain_alloc()
133 if (iodom == NULL) in iommu_domain_alloc()
136 KASSERT(iodom->end != 0, ("domain end is not set")); in iommu_domain_alloc()
138 iommu_domain_init(iommu, iodom, &domain_map_ops); in iommu_domain_alloc()
139 iodom->iommu = iommu; in iommu_domain_alloc()
140 iommu_gas_init_domain(iodom); in iommu_domain_alloc()
142 return (iodom); in iommu_domain_alloc()
146 iommu_domain_free(struct iommu_domain *iodom) in iommu_domain_free() argument
150 iommu = iodom->iommu; in iommu_domain_free()
154 if ((iodom->flags & IOMMU_DOMAIN_GAS_INITED) != 0) { in iommu_domain_free()
155 IOMMU_DOMAIN_LOCK(iodom); in iommu_domain_free()
156 iommu_gas_fini_domain(iodom); in iommu_domain_free()
157 IOMMU_DOMAIN_UNLOCK(iodom); in iommu_domain_free()
160 iommu_domain_fini(iodom); in iommu_domain_free()
162 IOMMU_DOMAIN_FREE(iommu->dev, iodom); in iommu_domain_free()
169 iommu_tag_init(struct iommu_domain *iodom, struct bus_dma_tag_iommu *t) in iommu_tag_init() argument
173 maxaddr = MIN(iodom->end, BUS_SPACE_MAXADDR); in iommu_tag_init()
186 iommu_ctx_alloc(device_t requester, struct iommu_domain *iodom, bool disabled) in iommu_ctx_alloc() argument
191 iommu = iodom->iommu; in iommu_ctx_alloc()
193 ioctx = IOMMU_CTX_ALLOC(iommu->dev, iodom, requester, disabled); in iommu_ctx_alloc()
197 ioctx->domain = iodom; in iommu_ctx_alloc()
206 struct iommu_domain *iodom; in iommu_ctx_init() local
210 iodom = ioctx->domain; in iommu_ctx_init()
211 iommu = iodom->iommu; in iommu_ctx_init()
221 tag->ctx->domain = iodom; in iommu_ctx_init()
223 iommu_tag_init(iodom, tag); in iommu_ctx_init()
251 struct iommu_domain *iodom; in iommu_get_ctx_ofw() local
304 iodom = iommu_domain_alloc(iommu); in iommu_get_ctx_ofw()
305 if (iodom == NULL) { in iommu_get_ctx_ofw()
310 ioctx = iommu_ctx_alloc(dev, iodom, false); in iommu_get_ctx_ofw()
312 iommu_domain_free(iodom); in iommu_get_ctx_ofw()
316 ioctx->domain = iodom; in iommu_get_ctx_ofw()
327 iommu_domain_free(iodom); in iommu_get_ctx_ofw()
339 struct iommu_domain *iodom; in iommu_get_ctx() local
355 iodom = iommu_domain_alloc(iommu); in iommu_get_ctx()
356 if (iodom == NULL) in iommu_get_ctx()
359 ioctx = iommu_ctx_alloc(requester, iodom, disabled); in iommu_get_ctx()
361 iommu_domain_free(iodom); in iommu_get_ctx()
368 iommu_domain_free(iodom); in iommu_get_ctx()
393 struct iommu_domain *iodom; in iommu_free_ctx() local
396 iodom = ioctx->domain; in iommu_free_ctx()
397 iommu = iodom->iommu; in iommu_free_ctx()
404 error = iommu_domain_free(iodom); in iommu_free_ctx()
421 iommu_domain_unload(struct iommu_domain *iodom, in iommu_domain_unload() argument
429 ("not mapped entry %p %p", iodom, entry)); in iommu_domain_unload()
430 error = iodom->ops->unmap(iodom, entry->start, entry->end - in iommu_domain_unload()
432 KASSERT(error == 0, ("unmap %p error %d", iodom, error)); in iommu_domain_unload()