- Don't use Kf* and Kef* in portable code.

svn path=/trunk/; revision=41965
This commit is contained in:
Stefan Ginsberg
2009-07-15 10:22:05 +00:00
parent 163b140789
commit bee032b26c
5 changed files with 42 additions and 42 deletions

View File

@@ -83,9 +83,9 @@ NdisAcquireReadWriteLock(
if (Lock->Context != PsGetCurrentThread()) {
/* Wait for the exclusive lock to be released. */
Lock->RefCount[KeGetCurrentProcessorNumber()].RefCount--;
KefAcquireSpinLockAtDpcLevel(&Lock->SpinLock);
KeAcquireSpinLockAtDpcLevel(&Lock->SpinLock);
Lock->RefCount[KeGetCurrentProcessorNumber()].RefCount++;
KefReleaseSpinLockFromDpcLevel(&Lock->SpinLock);
KeReleaseSpinLockFromDpcLevel(&Lock->SpinLock);
}
}
}
@@ -124,7 +124,7 @@ NdisReleaseReadWriteLock(
case 4: /* Exclusive write lock */
Lock->Context = NULL;
LockState->LockState = -1;
KfReleaseSpinLock(&Lock->SpinLock, LockState->OldIrql);
KeReleaseSpinLock(&Lock->SpinLock, LockState->OldIrql);
return;
}
}

View File

@@ -77,7 +77,7 @@ VideoPortAcquireSpinLockAtDpcLevel(
IN PSPIN_LOCK SpinLock)
{
TRACE_(VIDEOPRT, "VideoPortAcquireSpinLockAtDpcLevel\n");
KefAcquireSpinLockAtDpcLevel((PKSPIN_LOCK)SpinLock);
KeAcquireSpinLockAtDpcLevel((PKSPIN_LOCK)SpinLock);
}
/*
@@ -104,5 +104,5 @@ VideoPortReleaseSpinLockFromDpcLevel(
IN PSPIN_LOCK SpinLock)
{
TRACE_(VIDEOPRT, "VideoPortReleaseSpinLockFromDpcLevel\n");
KefReleaseSpinLockFromDpcLevel((PKSPIN_LOCK)SpinLock);
KeReleaseSpinLockFromDpcLevel((PKSPIN_LOCK)SpinLock);
}

View File

@@ -1045,12 +1045,12 @@ VideoPortSynchronizeExecution(
case VpHighPriority:
OldIrql = KeGetCurrentIrql();
if (OldIrql < SYNCH_LEVEL)
OldIrql = KfRaiseIrql(SYNCH_LEVEL);
KeRaiseIrql(SYNCH_LEVEL, &OldIrql);
Ret = (*SynchronizeRoutine)(Context);
if (OldIrql < SYNCH_LEVEL)
KfLowerIrql(OldIrql);
KeLowerIrql(OldIrql);
break;
default:

View File

@@ -578,7 +578,7 @@ KiRetireDpcList(IN PKPRCB Prcb)
while (DpcData->DpcQueueDepth != 0)
{
/* Lock the DPC data and get the DPC entry*/
KefAcquireSpinLockAtDpcLevel(&DpcData->DpcLock);
KeAcquireSpinLockAtDpcLevel(&DpcData->DpcLock);
DpcEntry = ListHead->Flink;
/* Make sure we have an entry */
@@ -602,7 +602,7 @@ KiRetireDpcList(IN PKPRCB Prcb)
Prcb->DebugDpcTime = 0;
/* Release the lock */
KefReleaseSpinLockFromDpcLevel(&DpcData->DpcLock);
KeReleaseSpinLockFromDpcLevel(&DpcData->DpcLock);
/* Re-enable interrupts */
_enable();
@@ -623,7 +623,7 @@ KiRetireDpcList(IN PKPRCB Prcb)
ASSERT(DpcData->DpcQueueDepth == 0);
/* Release DPC Lock */
KefReleaseSpinLockFromDpcLevel(&DpcData->DpcLock);
KeReleaseSpinLockFromDpcLevel(&DpcData->DpcLock);
}
}

View File

@@ -86,6 +86,38 @@ KeReleaseQueuedSpinLockFromDpcLevel(IN PKSPIN_LOCK_QUEUE LockHandle)
/* PUBLIC FUNCTIONS **********************************************************/
/*
* @implemented
*/
KIRQL
NTAPI
KeAcquireInterruptSpinLock(IN PKINTERRUPT Interrupt)
{
KIRQL OldIrql;
/* Raise IRQL */
KeRaiseIrql(Interrupt->SynchronizeIrql, &OldIrql);
/* Acquire spinlock on MP */
KeAcquireSpinLockAtDpcLevel(Interrupt->ActualLock);
return OldIrql;
}
/*
* @implemented
*/
VOID
NTAPI
KeReleaseInterruptSpinLock(IN PKINTERRUPT Interrupt,
IN KIRQL OldIrql)
{
/* Release lock on MP */
KeReleaseSpinLockFromDpcLevel(Interrupt->ActualLock);
/* Lower IRQL */
KeLowerIrql(OldIrql);
}
/*
* @implemented
*/
@@ -228,38 +260,6 @@ KeReleaseInStackQueuedSpinLockFromDpcLevel(IN PKLOCK_QUEUE_HANDLE LockHandle)
#endif
}
/*
* @implemented
*/
KIRQL
NTAPI
KeAcquireInterruptSpinLock(IN PKINTERRUPT Interrupt)
{
KIRQL OldIrql;
/* Raise IRQL */
KeRaiseIrql(Interrupt->SynchronizeIrql, &OldIrql);
/* Acquire spinlock on MP */
KefAcquireSpinLockAtDpcLevel(Interrupt->ActualLock);
return OldIrql;
}
/*
* @implemented
*/
VOID
NTAPI
KeReleaseInterruptSpinLock(IN PKINTERRUPT Interrupt,
IN KIRQL OldIrql)
{
/* Release lock on MP */
KefReleaseSpinLockFromDpcLevel(Interrupt->ActualLock);
/* Lower IRQL */
KeLowerIrql(OldIrql);
}
/*
* @unimplemented
*/