MCPcopy Create free account
hub / github.com/F-Stack/f-stack / dmar_domain_destroy

Function dmar_domain_destroy

freebsd/x86/iommu/intel_ctx.c:486–516  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

484}
485
486static void
487dmar_domain_destroy(struct dmar_domain *domain)
488{
489 struct iommu_domain *iodom;
490 struct dmar_unit *dmar;
491
492 iodom = DOM2IODOM(domain);
493
494 KASSERT(TAILQ_EMPTY(&domain->iodom.unload_entries),
495 ("unfinished unloads %p", domain));
496 KASSERT(LIST_EMPTY(&domain->contexts),
497 ("destroying dom %p with contexts", domain));
498 KASSERT(domain->ctx_cnt == 0,
499 ("destroying dom %p with ctx_cnt %d", domain, domain->ctx_cnt));
500 KASSERT(domain->refs == 0,
501 ("destroying dom %p with refs %d", domain, domain->refs));
502 if ((domain->iodom.flags & IOMMU_DOMAIN_GAS_INITED) != 0) {
503 DMAR_DOMAIN_LOCK(domain);
504 iommu_gas_fini_domain(iodom);
505 DMAR_DOMAIN_UNLOCK(domain);
506 }
507 if ((domain->iodom.flags & IOMMU_DOMAIN_PGTBL_INITED) != 0) {
508 if (domain->pgtbl_obj != NULL)
509 DMAR_DOMAIN_PGLOCK(domain);
510 domain_free_pgtbl(domain);
511 }
512 iommu_domain_fini(iodom);
513 dmar = DOM2DMAR(domain);
514 free_unr(dmar->domids, domain->domain);
515 free(domain, M_DMAR_DOMAIN);
516}
517
518static struct dmar_ctx *
519dmar_get_ctx_for_dev1(struct dmar_unit *dmar, device_t dev, uint16_t rid,

Callers 3

dmar_domain_allocFunction · 0.85
dmar_get_ctx_for_dev1Function · 0.85
dmar_unref_domain_lockedFunction · 0.85

Calls 3

domain_free_pgtblFunction · 0.85
free_unrFunction · 0.85
freeFunction · 0.50

Tested by

no test coverage detected