HalpIommuAllocateAndZeroPageTable

INT64 __fastcall HalpIommuAllocateAndZeroPageTable(INT64 a1, UINT64 a2, INT64 a3){
  __int64 v3; 
  __int64 v4; 
  unsigned int v5; 
  UINT64 v6; 
  void *v7; 
  v3 = 1i64 << *(_DWORD *)(a1 + 4i64 * (unsigned int)a2 + 36);
  v4 = *(unsigned int *)(a1 + 28);
  v5 = ((1 << v4) + 8) * v3;
  if( !a3 )
  {
    v7 = (void *)HalpMmAllocCtxAlloc(v4, v5);
    if( v7 )
      goto LABEL_4;
    return 0i64;
  }
  v6 = HalpAllocPhysicalMemory((_LOADER_PARAMETER_BLOCK *)a3, 0i64);
  if( !v6 )
    return 0i64;
  v7 = HalMapIoSpace((LARGE_INTEGER)v6, v5, MmCached);
LABEL_4:
  memset((INT64)v7, 0i64);
  if( !HalpIommuPageTableCacheCoherent )
    KeInvalidateRangeAllCachesNoIpi(v7, v5);
  return(INT64)v7;
}

Referenced by:

HalpIommuInitializeDmarPageTable
HalpIommuMapLogical
HalpIommuMapLogicalRange