IvtProcessDeviceExceptions

INT64 __fastcall IvtProcessDeviceExceptions(INT64 a1){
  unsigned int *v2; 
  int v3; 
  unsigned int i; 
  INT64 *ExceptionList; 
  INT64 j; 
  UINT64 v7; 
  INT64 ContextTable; 
  UINT64 v9; 
  INT64 v10; 
  UINT64 v11; 
  INT64 v12; 
  INT64 v13; 
  INT64 v14; 
  INT64 result[10]; 
  memset((INT64)result, 0i64);
  v2 = *(unsigned int **)(a1 + 296);
  v3 = 0;
  for( i = 0; i < *v2; ++i )
  {
    v3 = HalpIvtpInitializeReservedDomain(a1, (INT64)&v2[4 * i + 2]);
    if( v3 < 0 )
      break;
    v2 = *(unsigned int **)(a1 + 296);
  }
  if( v3 >= 0 )
  {
    ExceptionList = HalpIommuGetExceptionList();
    for( j = *ExceptionList; (INT64 *)j != ExceptionList; j = *(_QWORD *)j )
    {
      if( *(_DWORD *)(j + 16) == *(_DWORD *)(a1 + 212) )
      {
        memset((INT64)result, 0i64);
        v7 = *(_QWORD *)(j + 24);
        result[0] = 1i64;
        ContextTable = IvtAllocateContextTable(a1, v7);
        v3 = ContextTable;
        if( (int)ContextTable < 0 )
          return ContextTable;
        v11 = *(unsigned int *)(j + 24);
        if( (*(_DWORD *)(a1 + 184) & 0x1000000) != 0 )
        {
          LODWORD(v14) = 1;
          IvtUpdateExtendedContextEntry(a1, v11, v9, v10, (INT64)result, v13, v14, 0i64);
        }
        else
        {
          LODWORD(v12) = 1;
          IvtUpdateContextEntry(a1, v11, (INT64)result, v10, v12, 0i64);
        }
      }
    }
  }
  return(unsigned int)v3;
}

Referenced by:

IvtInitializeIommu