- Fixed the delivering of pending dpcs in KiDispatchInterrupt.

- Raise the irql before acquiring the lock in KeRemoveQueueDpc.

svn path=/trunk/; revision=4910
This commit is contained in:
Hartmut Birr 2003-06-16 19:18:14 +00:00
parent c4bb72e4ce
commit 5ce7ebb682

View file

@ -18,7 +18,7 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
/* $Id: dpc.c,v 1.24 2002/09/08 10:23:28 chorns Exp $ /* $Id: dpc.c,v 1.25 2003/06/16 19:18:14 hbirr Exp $
* *
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
@ -95,33 +95,22 @@ KiDispatchInterrupt(VOID)
KeRaiseIrql(HIGH_LEVEL, &oldlvl); KeRaiseIrql(HIGH_LEVEL, &oldlvl);
KeAcquireSpinLockAtDpcLevel(&DpcQueueLock); KeAcquireSpinLockAtDpcLevel(&DpcQueueLock);
current_entry = RemoveHeadList(&DpcQueueHead);
if (current_entry != &DpcQueueHead) while (!IsListEmpty(&DpcQueueHead))
{ {
current_entry = RemoveHeadList(&DpcQueueHead);
DpcQueueSize--; DpcQueueSize--;
}
KeReleaseSpinLockFromDpcLevel(&DpcQueueLock);
current = CONTAINING_RECORD(current_entry,KDPC,DpcListEntry); current = CONTAINING_RECORD(current_entry,KDPC,DpcListEntry);
current->Lock=FALSE; current->Lock=FALSE;
KeLowerIrql(oldlvl); KeReleaseSpinLock(&DpcQueueLock, oldlvl);
while (current_entry!=(&DpcQueueHead))
{
current->DeferredRoutine(current,current->DeferredContext, current->DeferredRoutine(current,current->DeferredContext,
current->SystemArgument1, current->SystemArgument1,
current->SystemArgument2); current->SystemArgument2);
KeRaiseIrql(HIGH_LEVEL, &oldlvl); KeRaiseIrql(HIGH_LEVEL, &oldlvl);
KeAcquireSpinLockAtDpcLevel(&DpcQueueLock); KeAcquireSpinLockAtDpcLevel(&DpcQueueLock);
current_entry = RemoveHeadList(&DpcQueueHead);
if (current_entry != &DpcQueueHead)
{
DpcQueueSize--;
}
KeReleaseSpinLockFromDpcLevel(&DpcQueueLock);
current = CONTAINING_RECORD(current_entry,KDPC,DpcListEntry);
current->Lock=FALSE;
KeLowerIrql(oldlvl);
} }
KeReleaseSpinLock(&DpcQueueLock, oldlvl);
} }
BOOLEAN STDCALL BOOLEAN STDCALL
@ -136,8 +125,8 @@ KeRemoveQueueDpc (PKDPC Dpc)
{ {
KIRQL oldIrql; KIRQL oldIrql;
KeAcquireSpinLockAtDpcLevel(&DpcQueueLock);
KeRaiseIrql(HIGH_LEVEL, &oldIrql); KeRaiseIrql(HIGH_LEVEL, &oldIrql);
KeAcquireSpinLockAtDpcLevel(&DpcQueueLock);
if (!Dpc->Lock) if (!Dpc->Lock)
{ {
KeReleaseSpinLock(&DpcQueueLock, oldIrql); KeReleaseSpinLock(&DpcQueueLock, oldIrql);