[NTOS:KE/x64] Ignore DPCs from the idle loop

This is handled in the idle loop itself. The idle loop must not be preempted from a DPC.
This commit is contained in:
Timo Kreuzer 2024-12-10 17:30:36 +02:00
parent e9ef091f0e
commit 2559827ffa
2 changed files with 11 additions and 0 deletions

View file

@ -154,8 +154,12 @@ KiIdleLoop(VOID)
}
else
{
Prcb->IdleHalt = 1;
/* Continue staying idle. Note the HAL returns with interrupts on */
Prcb->PowerState.IdleFunction(&Prcb->PowerState);
Prcb->IdleHalt = 0;
}
}
}

View file

@ -36,6 +36,12 @@ KiDpcInterruptHandler(VOID)
/* Send an EOI */
KiSendEOI();
/* Ignore idle halt DPC interrupts */
if (Prcb->IdleHalt)
{
goto Exit;
}
/* Check for pending timers, pending DPCs, or pending ready threads */
if ((Prcb->DpcData[0].DpcQueueDepth) ||
(Prcb->TimerRequest) ||
@ -79,6 +85,7 @@ KiDpcInterruptHandler(VOID)
KiSwapContext(APC_LEVEL, OldThread);
}
Exit:
/* Disable interrupts and go back to old irql */
_disable();
KeLowerIrql(OldIrql);