KiAcquire/ReleaseSpinLock adaption

svn path=/trunk/; revision=7760
This commit is contained in:
Gunnar Dalsnes 2004-01-18 22:42:50 +00:00
parent f3c9b196a6
commit d6b70d802e

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.29 2003/12/30 18:52:04 fireball Exp $ /* $Id: dpc.c,v 1.30 2004/01/18 22:42:50 gdalsnes Exp $
* *
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
@ -100,7 +100,7 @@ KiDispatchInterrupt(VOID)
} }
KeRaiseIrql(HIGH_LEVEL, &oldlvl); KeRaiseIrql(HIGH_LEVEL, &oldlvl);
KeAcquireSpinLockAtDpcLevel(&DpcQueueLock); KiAcquireSpinLock(&DpcQueueLock);
while (!IsListEmpty(&DpcQueueHead)) while (!IsListEmpty(&DpcQueueHead))
{ {
@ -111,16 +111,16 @@ KiDispatchInterrupt(VOID)
current = CONTAINING_RECORD(current_entry,KDPC,DpcListEntry); current = CONTAINING_RECORD(current_entry,KDPC,DpcListEntry);
current->Lock=FALSE; current->Lock=FALSE;
KeReleaseSpinLockFromDpcLevel(&DpcQueueLock); KiReleaseSpinLock(&DpcQueueLock);
KeLowerIrql(oldlvl); KeLowerIrql(oldlvl);
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); KiAcquireSpinLock(&DpcQueueLock);
} }
KeReleaseSpinLockFromDpcLevel(&DpcQueueLock); KiReleaseSpinLock(&DpcQueueLock);
KeLowerIrql(oldlvl); KeLowerIrql(oldlvl);
} }
@ -141,7 +141,7 @@ KeRemoveQueueDpc (PKDPC Dpc)
BOOLEAN WasInQueue; BOOLEAN WasInQueue;
KeRaiseIrql(HIGH_LEVEL, &oldIrql); KeRaiseIrql(HIGH_LEVEL, &oldIrql);
KeAcquireSpinLockAtDpcLevel(&DpcQueueLock); KiAcquireSpinLock(&DpcQueueLock);
WasInQueue = Dpc->Lock ? TRUE : FALSE; WasInQueue = Dpc->Lock ? TRUE : FALSE;
if (WasInQueue) if (WasInQueue)
{ {
@ -152,7 +152,7 @@ KeRemoveQueueDpc (PKDPC Dpc)
assert(DpcQueueSize || IsListEmpty(&DpcQueueHead)); assert(DpcQueueSize || IsListEmpty(&DpcQueueHead));
KeReleaseSpinLockFromDpcLevel(&DpcQueueLock); KiReleaseSpinLock(&DpcQueueLock);
KeLowerIrql(oldIrql); KeLowerIrql(oldIrql);
return WasInQueue; return WasInQueue;
@ -190,13 +190,13 @@ KeInsertQueueDpc (PKDPC Dpc,
return(FALSE); return(FALSE);
} }
KeRaiseIrql(HIGH_LEVEL, &oldlvl); KeRaiseIrql(HIGH_LEVEL, &oldlvl);
KeAcquireSpinLockAtDpcLevel(&DpcQueueLock); KiAcquireSpinLock(&DpcQueueLock);
assert(DpcQueueSize || IsListEmpty(&DpcQueueHead)); assert(DpcQueueSize || IsListEmpty(&DpcQueueHead));
InsertHeadList(&DpcQueueHead,&Dpc->DpcListEntry); InsertHeadList(&DpcQueueHead,&Dpc->DpcListEntry);
DPRINT("Dpc->DpcListEntry.Flink %x\n", Dpc->DpcListEntry.Flink); DPRINT("Dpc->DpcListEntry.Flink %x\n", Dpc->DpcListEntry.Flink);
DpcQueueSize++; DpcQueueSize++;
Dpc->Lock=(PULONG)1; Dpc->Lock=(PULONG)1;
KeReleaseSpinLockFromDpcLevel(&DpcQueueLock); KiReleaseSpinLock(&DpcQueueLock);
KeLowerIrql(oldlvl); KeLowerIrql(oldlvl);
DPRINT("DpcQueueHead.Flink %x\n",DpcQueueHead.Flink); DPRINT("DpcQueueHead.Flink %x\n",DpcQueueHead.Flink);
DPRINT("Leaving KeInsertQueueDpc()\n",0); DPRINT("Leaving KeInsertQueueDpc()\n",0);