while (PointerPde <= LastPde)
{
/* Lock the PFN database */
- OldIrql = KeAcquireQueuedSpinLock(LockQueuePfnLock);
+ OldIrql = MiAcquirePfnLock();
/* Check if we don't already have this PDE mapped */
if (SystemMapPde->u.Hard.Valid == 0)
}
/* Release the lock and keep going with the next PDE */
- KeReleaseQueuedSpinLock(LockQueuePfnLock, OldIrql);
+ MiReleasePfnLock(OldIrql);
SystemMapPde++;
PointerPde++;
}
ASSERT(FailIfSystemViews == FALSE);
/* Lock the PFN database */
- OldIrql = KeAcquireQueuedSpinLock(LockQueuePfnLock);
+ OldIrql = MiAcquirePfnLock();
/* State not yet supported */
ASSERT(ControlArea->u.Flags.BeingPurged == 0);
ASSERT(ControlArea->NumberOfSectionReferences != 0);
/* Release the PFN lock and return success */
- KeReleaseQueuedSpinLock(LockQueuePfnLock, OldIrql);
+ MiReleasePfnLock(OldIrql);
return STATUS_SUCCESS;
}
LastPte = PointerPte + Segment->NonExtendedPtes;
/* Lock the PFN database */
- OldIrql = KeAcquireQueuedSpinLock(LockQueuePfnLock);
+ OldIrql = MiAcquirePfnLock();
/* Check if the master PTE is invalid */
PteForProto = MiAddressToPte(PointerPte);
}
/* Release the PFN lock */
- KeReleaseQueuedSpinLock(LockQueuePfnLock, OldIrql);
+ MiReleasePfnLock(OldIrql);
/* Free the structures */
ExFreePool(ControlArea);
IN KIRQL OldIrql)
{
BOOLEAN DeleteSegment = FALSE;
- ASSERT(KeGetCurrentIrql() == DISPATCH_LEVEL);
+ MI_ASSERT_PFN_LOCK_HELD();
/* Check if this is the last reference or view */
if (!(ControlArea->NumberOfMappedViews) &&
}
/* Release the PFN lock */
- KeReleaseQueuedSpinLock(LockQueuePfnLock, OldIrql);
+ MiReleasePfnLock(OldIrql);
/* Delete the segment if needed */
if (DeleteSegment)
KIRQL OldIrql;
/* Lock the PFN database */
- OldIrql = KeAcquireQueuedSpinLock(LockQueuePfnLock);
+ OldIrql = MiAcquirePfnLock();
/* Drop reference counts */
ControlArea->NumberOfMappedViews--;
MiUnlockProcessWorkingSetUnsafe(CurrentProcess, CurrentThread);
/* Lock the PFN database */
- OldIrql = KeAcquireQueuedSpinLock(LockQueuePfnLock);
+ OldIrql = MiAcquirePfnLock();
/* Remove references */
ControlArea->NumberOfMappedViews--;
ASSERT(MmAvailablePages >= 32);
/* Acquire the PFN lock and grab a zero page */
- OldIrql = KeAcquireQueuedSpinLock(LockQueuePfnLock);
+ OldIrql = MiAcquirePfnLock();
MI_SET_USAGE(MI_USAGE_PAGE_TABLE);
MI_SET_PROCESS2(PsGetCurrentProcess()->ImageFileName);
Color = (++MmSessionSpace->Color) & MmSecondaryColorMask;
MmSessionSpace->SessionPageDirectoryIndex);
/* And now release the lock */
- KeReleaseQueuedSpinLock(LockQueuePfnLock, OldIrql);
+ MiReleasePfnLock(OldIrql);
/* Get the PFN entry and make sure there's no event for it */
Pfn1 = MI_PFN_ELEMENT(PageFrameNumber);
ASSERT(KeGetCurrentIrql() <= APC_LEVEL);
- OldIrql = KeAcquireQueuedSpinLock(LockQueuePfnLock);
+ OldIrql = MiAcquirePfnLock();
ControlArea->u.Flags.DebugSymbolsLoaded |= 1;
ASSERT(OldIrql <= APC_LEVEL);
- KeReleaseQueuedSpinLock(LockQueuePfnLock, OldIrql);
+ MiReleasePfnLock(OldIrql);
ASSERT(KeGetCurrentIrql() <= APC_LEVEL);
}
PointerPte,
ProtectionMask,
PreviousPte.u.Hard.PageFrameNumber);
- OldIrql = KeAcquireQueuedSpinLock(LockQueuePfnLock);
+ OldIrql = MiAcquirePfnLock();
//
// We don't support I/O mappings in this path yet
//
// Release the PFN lock, we are done
//
- KeReleaseQueuedSpinLock(LockQueuePfnLock, OldIrql);
+ MiReleasePfnLock(OldIrql);
}
//
PointerPde = MiPteToPde(PointerPte);
/* Lock the PFN database and make sure this isn't a mapped file */
- OldIrql = KeAcquireQueuedSpinLock(LockQueuePfnLock);
+ OldIrql = MiAcquirePfnLock();
ASSERT(((Pfn1->u3.e1.PrototypePte) && (Pfn1->OriginalPte.u.Soft.Prototype)) == 0);
/* Mark the page as modified accordingly */
MiDecrementShareCount(Pfn1, PFN_FROM_PTE(&PteContents));
/* Release the PFN lock */
- KeReleaseQueuedSpinLock(LockQueuePfnLock, OldIrql);
+ MiReleasePfnLock(OldIrql);
}
else
{
KeFlushCurrentTb();
/* Acquire the PFN lock */
- OldIrql = KeAcquireQueuedSpinLock(LockQueuePfnLock);
+ OldIrql = MiAcquirePfnLock();
/* Decrement the accounting counters */
ControlArea->NumberOfUserReferences--;
}
/* Lock the PFN database while we play with the section pointers */
- OldIrql = KeAcquireQueuedSpinLock(LockQueuePfnLock);
+ OldIrql = MiAcquirePfnLock();
/* Image-file backed sections are not yet supported */
ASSERT((AllocationAttributes & SEC_IMAGE) == 0);
File->SectionObjectPointer->DataSectionObject = ControlArea;
/* We can release the PFN lock now */
- KeReleaseQueuedSpinLock(LockQueuePfnLock, OldIrql);
+ MiReleasePfnLock(OldIrql);
/* We don't support previously-mapped file */
ASSERT(NewSegment == NULL);
if (!NT_SUCCESS(Status))
{
/* Lock the PFN database while we play with the section pointers */
- OldIrql = KeAcquireQueuedSpinLock(LockQueuePfnLock);
+ OldIrql = MiAcquirePfnLock();
/* Reset the waiting-for-deletion event */
ASSERT(ControlArea->WaitingForDeletion == NULL);
ControlArea->u.Flags.BeingCreated = FALSE;
/* We can release the PFN lock now */
- KeReleaseQueuedSpinLock(LockQueuePfnLock, OldIrql);
+ MiReleasePfnLock(OldIrql);
/* Check if we locked and set the IRP */
if (FileLock)
ASSERT(File != NULL);
/* Acquire the PFN lock while we set control area flags */
- OldIrql = KeAcquireQueuedSpinLock(LockQueuePfnLock);
+ OldIrql = MiAcquirePfnLock();
/* We don't support this race condition yet, so assume no waiters */
ASSERT(ControlArea->WaitingForDeletion == NULL);
/* Take off the being created flag, and then release the lock */
ControlArea->u.Flags.BeingCreated = FALSE;
- KeReleaseQueuedSpinLock(LockQueuePfnLock, OldIrql);
+ MiReleasePfnLock(OldIrql);
}
/* Check if we locked the file earlier */
if (UserRefIncremented)
{
/* Acquire the PFN lock while we change counters */
- OldIrql = KeAcquireQueuedSpinLock(LockQueuePfnLock);
+ OldIrql = MiAcquirePfnLock();
/* Decrement the accounting counters */
ControlArea->NumberOfSectionReferences--;
if (ControlArea->u.Flags.BeingCreated == 1)
{
/* Acquire the PFN lock while we set control area flags */
- OldIrql = KeAcquireQueuedSpinLock(LockQueuePfnLock);
+ OldIrql = MiAcquirePfnLock();
/* Take off the being created flag, and then release the lock */
ControlArea->u.Flags.BeingCreated = 0;
NewSection->u.Flags.BeingCreated = 0;
- KeReleaseQueuedSpinLock(LockQueuePfnLock, OldIrql);
+ MiReleasePfnLock(OldIrql);
}
/* Migrate the attribute into a flag */
}
/* Lock the PFN database */
- OldIrql = KeAcquireQueuedSpinLock(LockQueuePfnLock);
+ OldIrql = MiAcquirePfnLock();
ASSERT(SectionObject->Segment);
ASSERT(SectionObject->Segment->ControlArea);