HalpTimerInitializeSystemWatchdog

NTSTATUS __stdcall HalpTimerInitializeSystemWatchdog(){
  unsigned int *v0; 
  UINT64 v1; 
  bool v2; 
  unsigned __int64 v3; 
  UINT64 v4; 
  _KINTERRUPT_POLARITY v5; 
  NTSTATUS result; 
  signed __int32 v7[8]; 
  _KINTERRUPT_MODE v8; 
  UINT64 v9; 
  __int64 v10; 
  __int64 v11; 
  UINT8 v12; 
  INT64 v13; 
  _KINTERRUPT **v14; 
  INT64 v15[2]; 
  int v16; 
  UINT64 v17; 
  _KINTERRUPT *v18; 

  v0 = (unsigned int *)HalpWatchdogTimer;
  v18 = 0i64;
  v17 = 0i64;
  HalpTimerGetClockRates((__int64)HalpWatchdogTimer, &v17, &v16);
  v1 = v17;
  if( v17 > 0xB2D05E00 )
    v1 = 3000000000i64;
  v17 = v1;
  qword_140C4A330 = v1;
  v2 = (v0[56] & 0x80000) == 0;
  qword_140C4A340 = v1 >> 2;
  if( v2 )
    goto LABEL_7;
  v14 = &v18;
  v3 = 0i64;
  LODWORD(v13) = 5;
  if( KeActiveProcessors.Count )
    v3 = KeActiveProcessors.Bitmap[0];
  v12 = 15;
  v11 = 0i64;
  v10 = 0i64;
  v4 = v0[22];
  v9 = (UINT64)HalpTimerWatchdogPreResetInterrupt;
  v8 = v0[24];
  v5 = v0[23];
  v15[1] = 0i64;
  v15[0] = v3;
  result = HalpInterruptConnect(
             (INT64)v15,
             v4,
             0xF0ui64,
             0xFu,
             v5,
             v8,
             (UINT64)HalpTimerWatchdogPreResetInterrupt,
             0i64,
             0i64,
             0xFu,
             v13,
             v14);
  if( result >= 0 )
  {
LABEL_7:
    _InterlockedOr(v7, 0);
    off_140C008C8[0] = (__int64(__fastcall *)())HalpTimerWatchdogStop;
    off_140C008B8[0] = (__int64(__fastcall *)())HalpTimerWatchdogStart;
    off_140C008D0[0] = (__int64(__fastcall *)())HalpTimerWatchdogGeneratedLastReset;
    off_140C008D8[0] = (__int64(__fastcall *)())HalpTimerWatchdogTriggerSystemReset;
    off_140C00968[0] = (__int64(__fastcall *)())HalpTimerWatchdogQueryDueTime;
    _InterlockedOr(v7, 0);
    HalpTimerWatchdogStart();
    _InterlockedOr(v7, 0);
    off_140C008C0[0] = (__int64(__fastcall *)())HalpTimerWatchdogResetCountdown;
    return 0;
  }
  return result;
}

Referenced by:

No references.