Home | Info | Community | Development | myReactOS | Contact Us
Definition at line 64 of file time.c.
Referenced by HalpClockInterrupt(), HalpClockInterruptHandler(), and KiInterruptDispatch3().
{ PKPRCB Prcb = KeGetCurrentPrcb(); ULARGE_INTEGER CurrentTime, InterruptTime; LONG OldTickOffset; /* Check if this tick is being skipped */ if (Prcb->SkipTick) { /* Handle it next time */ Prcb->SkipTick = FALSE; /* Increase interrupt count and end the interrupt */ Prcb->InterruptCount++; KiEndInterrupt(Irql, TrapFrame); } /* Add the increment time to the shared data */ InterruptTime.QuadPart = *(ULONGLONG*)&SharedUserData->InterruptTime; InterruptTime.QuadPart += Increment; KiWriteSystemTime(&SharedUserData->InterruptTime, InterruptTime); /* Check for timer expiration */ KiCheckForTimerExpiration(Prcb, TrapFrame, InterruptTime); /* Update the tick offset */ OldTickOffset = InterlockedExchangeAdd(&KiTickOffset, -(LONG)Increment); /* If the debugger is enabled, check for break-in request */ if (KdDebuggerEnabled && KdPollBreakIn()) { /* Break-in requested! */ DbgBreakPointWithStatus(DBG_STATUS_CONTROL_C); } /* Check for full tick */ if (OldTickOffset <= (LONG)Increment) { /* Update the system time */ CurrentTime.QuadPart = *(ULONGLONG*)&SharedUserData->SystemTime; CurrentTime.QuadPart += KeTimeAdjustment; KiWriteSystemTime(&SharedUserData->SystemTime, CurrentTime); /* Update the tick count */ CurrentTime.QuadPart = (*(ULONGLONG*)&KeTickCount) + 1; KiWriteSystemTime(&KeTickCount, CurrentTime); /* Update it in the shared user data */ KiWriteSystemTime(&SharedUserData->TickCount, CurrentTime); /* Check for expiration with the new tick count as well */ KiCheckForTimerExpiration(Prcb, TrapFrame, InterruptTime); /* Reset the tick offset */ KiTickOffset += KeMaximumIncrement; /* Update processor/thread runtime */ KeUpdateRunTime(TrapFrame, Irql); } else { /* Increase interrupt count only */ Prcb->InterruptCount++; } /* Disable interrupts and end the interrupt */ KiEndInterrupt(Irql, TrapFrame); }