FreeBSD/sys/x86/iommu/intel_utils.c
/*
 * Calculate the total amount of page table pages needed to map the
 * whole bus address space on the context with the selected agaw.
 */
Calculate the total amount of page table pages needed to map the
whole bus address space on the context with the selected agaw.
Calculate the total amount of page table pages needed to map the whole bus address space on the context with the selected agaw .
vm_pindex_t
pglvl_max_pages(int pglvl)
{
	vm_pindex_t res;
	int i;
	for (res = 0, i = pglvl; i > 0; i--) {
		res *= DMAR_NPTEPG;
		res++;
	}
	return (res);
}
vm_pindex_t pglvl_max_pages ( int pglvl ) { vm_pindex_t res ; int i ; for ( res = 0 , i = pglvl ; i > 0 ; i -- ) { res *= DMAR_NPTEPG ; res ++ ; } return ( res ) ; }
Calculate the total amount of page table pages needed to map the
 whole bus address space on the context with the selected agaw.
Calculate the total amount of page table pages needed to map the whole bus address space on the context with the selected agaw .