[NTOSKRNL]

- Revert the hack in r47514
- The ASSERT is there to make sure the PFN lock is held
- Fix the issue properly by holding the PFN lock while initializing

svn path=/trunk/; revision=47516
This commit is contained in:
Cameron Gutman 2010-06-01 20:06:53 +00:00
parent b5781444a5
commit 59aacb176f
2 changed files with 8 additions and 1 deletions

View file

@ -59,7 +59,7 @@ MiInsertInListTail(IN PMMPFNLIST ListHead,
{
PFN_NUMBER OldBlink, EntryIndex = MiGetPfnEntryIndex(Entry);
ASSERT(KeGetCurrentIrql() <= DISPATCH_LEVEL);
ASSERT(KeGetCurrentIrql() == DISPATCH_LEVEL);
ASSERT_LIST_INVARIANT(ListHead);
/* Get the back link */

View file

@ -457,12 +457,16 @@ MmInitializePageList(VOID)
PMEMORY_ALLOCATION_DESCRIPTOR Md;
PLIST_ENTRY NextEntry;
ULONG NrSystemPages = 0;
KIRQL OldIrql;
/* This is what a used page looks like */
RtlZeroMemory(&UsedPage, sizeof(UsedPage));
UsedPage.u3.e1.PageLocation = ActiveAndValid;
UsedPage.u3.e2.ReferenceCount = 1;
/* Lock PFN database */
OldIrql = KeAcquireQueuedSpinLock(LockQueuePfnLock);
/* Loop the memory descriptors */
for (NextEntry = KeLoaderBlock->MemoryDescriptorListHead.Flink;
NextEntry != &KeLoaderBlock->MemoryDescriptorListHead;
@ -518,6 +522,9 @@ MmInitializePageList(VOID)
MmPfnDatabase[0][i] = UsedPage;
NrSystemPages++;
}
/* Release the PFN database lock */
KeReleaseQueuedSpinLock(LockQueuePfnLock, OldIrql);
KeInitializeEvent(&ZeroPageThreadEvent, NotificationEvent, TRUE);
DPRINT("Pages: %x %x\n", MmAvailablePages, NrSystemPages);