mirror of
https://github.com/reactos/reactos.git
synced 2025-07-15 20:04:03 +00:00
[NTOS]
- As a side effect to 45140 one of the "non-used debug features", breaking in with WinDbg, would no longer work. Add this back, as well as the DPC timeout debug check and support for skipping ticks. svn path=/trunk/; revision=56194
This commit is contained in:
parent
a5326360ca
commit
014b23b9a1
1 changed files with 44 additions and 0 deletions
|
@ -69,6 +69,17 @@ KeUpdateSystemTime(IN PKTRAP_FRAME TrapFrame,
|
||||||
ULARGE_INTEGER CurrentTime, InterruptTime;
|
ULARGE_INTEGER CurrentTime, InterruptTime;
|
||||||
LONG OldTickOffset;
|
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 */
|
/* Add the increment time to the shared data */
|
||||||
InterruptTime.QuadPart = *(ULONGLONG*)&SharedUserData->InterruptTime;
|
InterruptTime.QuadPart = *(ULONGLONG*)&SharedUserData->InterruptTime;
|
||||||
InterruptTime.QuadPart += Increment;
|
InterruptTime.QuadPart += Increment;
|
||||||
|
@ -80,6 +91,13 @@ KeUpdateSystemTime(IN PKTRAP_FRAME TrapFrame,
|
||||||
/* Update the tick offset */
|
/* Update the tick offset */
|
||||||
OldTickOffset = InterlockedExchangeAdd(&KiTickOffset, -(LONG)Increment);
|
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 */
|
/* Check for full tick */
|
||||||
if (OldTickOffset <= (LONG)Increment)
|
if (OldTickOffset <= (LONG)Increment)
|
||||||
{
|
{
|
||||||
|
@ -122,6 +140,14 @@ KeUpdateRunTime(IN PKTRAP_FRAME TrapFrame,
|
||||||
PKTHREAD Thread = KeGetCurrentThread();
|
PKTHREAD Thread = KeGetCurrentThread();
|
||||||
PKPRCB Prcb = KeGetCurrentPrcb();
|
PKPRCB Prcb = KeGetCurrentPrcb();
|
||||||
|
|
||||||
|
/* Check if this tick is being skipped */
|
||||||
|
if (Prcb->SkipTick)
|
||||||
|
{
|
||||||
|
/* Handle it next time */
|
||||||
|
Prcb->SkipTick = FALSE;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/* Increase interrupt count */
|
/* Increase interrupt count */
|
||||||
Prcb->InterruptCount++;
|
Prcb->InterruptCount++;
|
||||||
|
|
||||||
|
@ -154,6 +180,24 @@ KeUpdateRunTime(IN PKTRAP_FRAME TrapFrame,
|
||||||
{
|
{
|
||||||
/* Handle being in a DPC */
|
/* Handle being in a DPC */
|
||||||
Prcb->DpcTime++;
|
Prcb->DpcTime++;
|
||||||
|
|
||||||
|
#if DBG
|
||||||
|
/* Update the DPC time */
|
||||||
|
Prcb->DebugDpcTime++;
|
||||||
|
|
||||||
|
/* Check if we have timed out */
|
||||||
|
if (Prcb->DebugDpcTime == KiDPCTimeout);
|
||||||
|
{
|
||||||
|
/* We did! */
|
||||||
|
DbgPrint("*** DPC routine > 1 sec --- This is not a break in KeUpdateSystemTime\n");
|
||||||
|
|
||||||
|
/* Break if debugger is enabled */
|
||||||
|
if (KdDebuggerEnabled) DbgBreakPoint();
|
||||||
|
|
||||||
|
/* Clear state */
|
||||||
|
Prcb->DebugDpcTime = 0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue