KeSetSchedulingGroupCycleNotification

VOID __stdcall KeSetSchedulingGroupCycleNotification(_KSCHEDULING_GROUP *SchedulingGroup, _KDPC *Dpc, UINT64 CycleTime){
  unsigned __int8 CurrentIrql; 
  _KPRCB **v6; 
  _KSCB *PerProcessor; 
  _KPRCB *v8; 
  UINT64 SpinCount; 
  _KDPC *v10; 
  __int64 v11; 

  v10 = Dpc;
  SchedulingGroup->NotificationCycles = 0i64;
  if( CycleTime )
  {
    CurrentIrql = KeGetCurrentIrql();
    __writecr8(2ui64);
    if( (_DWORD)KeNumberProcessors_0 )
    {
      v6 = &KiProcessorBlock;
      v11 = (unsigned int)KeNumberProcessors_0;
      PerProcessor = SchedulingGroup->PerProcessor;
      do
      {
        LODWORD(SpinCount) = 0;
        v8 = *v6;
        while( _interlockedbittestandset64((volatile signed __int32 *)&v8->PrcbLock, 0i64) )
        {
          do
            KeYieldProcessorEx(&SpinCount);
          while( v8->PrcbLock );
        }
        PerProcessor->LastReportedCycles = PerProcessor->GenerationCycles;
        _InterlockedAnd64((volatile signed __int64 *)&v8->PrcbLock, 0i64);
        ++v6;
        ++PerProcessor;
        --v11;
      }
      while( v11 );
    }
    SchedulingGroup->NotificationDpc = v10;
    _InterlockedExchange64(&SchedulingGroup->NotificationCycles, CycleTime);
    __writecr8(CurrentIrql);
  }
}

Referenced by:

NtSetInformationJobObject