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

Function domain_alloc_pgtbl

freebsd/x86/iommu/intel_idpgtbl.c:702–722  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

700}
701
702int
703domain_alloc_pgtbl(struct dmar_domain *domain)
704{
705 vm_page_t m;
706
707 KASSERT(domain->pgtbl_obj == NULL,
708 ("already initialized %p", domain));
709
710 domain->pgtbl_obj = vm_pager_allocate(OBJT_PHYS, NULL,
711 IDX_TO_OFF(pglvl_max_pages(domain->pglvl)), 0, 0, NULL);
712 DMAR_DOMAIN_PGLOCK(domain);
713 m = dmar_pgalloc(domain->pgtbl_obj, 0, IOMMU_PGF_WAITOK |
714 IOMMU_PGF_ZERO | IOMMU_PGF_OBJL);
715 /* No implicit free of the top level page table page. */
716 m->ref_count = 1;
717 DMAR_DOMAIN_PGUNLOCK(domain);
718 DMAR_LOCK(domain->dmar);
719 domain->iodom.flags |= IOMMU_DOMAIN_PGTBL_INITED;
720 DMAR_UNLOCK(domain->dmar);
721 return (0);
722}
723
724void
725domain_free_pgtbl(struct dmar_domain *domain)

Callers 1

dmar_domain_allocFunction · 0.85

Calls 3

vm_pager_allocateFunction · 0.85
pglvl_max_pagesFunction · 0.85
dmar_pgallocFunction · 0.85

Tested by

no test coverage detected