HalpInterruptServiceActiveBoth

INT64 __fastcall HalpInterruptServiceActiveBoth(INT64 a1){
  __int64 v1; 
  unsigned int v2; 
  _DWORD *LinesForGsiRange; 
  _DWORD *v4; 
  ULONG_PTR *v5; 
  unsigned __int64 v6; 
  INT64 result; 
  __int64 v8; 
  v1 = *(_QWORD *)(a1 + 160);
  v8 = 0i64;
  v2 = *(_DWORD *)(v1 + 64);
  LinesForGsiRange = HalpInterruptFindLinesForGsiRange(v2, v2 + 1);
  LODWORD(v8) = LinesForGsiRange[4];
  HIDWORD(v8) = v2 + LinesForGsiRange[5] - LinesForGsiRange[7];
  v4 = (_DWORD *)(*((_QWORD *)LinesForGsiRange + 5) + 56i64 * (v2 - LinesForGsiRange[7]));
  v5 = HalpInterruptLookupController(v8);
  v6 = (unsigned __int8)HalpAcquireHighLevelLock(&HalpInterruptLock);
  if( *v4 == 1 )
  {
    *v4 = 2;
  }
  else if( *v4 == 2 )
  {
    *v4 = 1;
  }
  if( (int)HalpInterruptSetLineStateInternal((__int64)v5, (__int64)&v8, (__int64)v4) < 0 )
    KeBugCheckEx(0x5Cu, 0x205ui64, *((int *)v5 + 54), (ULONG_PTR)v5, SHIDWORD(v8));
  KxReleaseSpinLock(&HalpInterruptLock);
  result = (unsigned int)KiIrqlFlags;
  __writecr8(v6);
  return result;
}

Referenced by:

HalPerformEndOfInterrupt