Author: ion
Date: Sun Jan 28 19:23:52 2007
New Revision: 25656
URL:
http://svn.reactos.org/svn/reactos?rev=25656&view=rev
Log:
- Merge Arty's Mm Page Referencing patch. I was able to complete first-stage setup
(albeit only on the second try) and booting to second stage (after three tries). There are
still freelist.c bugchecks but this patch is defintely a step in the right direction.
Modified:
trunk/reactos/ntoskrnl/mm/freelist.c
Modified: trunk/reactos/ntoskrnl/mm/freelist.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/freelist.c?rev…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/freelist.c (original)
+++ trunk/reactos/ntoskrnl/mm/freelist.c Sun Jan 28 19:23:52 2007
@@ -479,7 +479,9 @@
MmPageArray[j].Flags.Type = MM_PHYSICAL_PAGE_USED;
MmPageArray[j].Flags.Zero = 0;
MmPageArray[j].Flags.Consumer = MC_NPPOOL;
- MmPageArray[j].ReferenceCount = 1;
+ /* Reference count 2, because we're having ReferenceCount track
+ MapCount as well. */
+ MmPageArray[j].ReferenceCount = 2;
MmPageArray[j].MapCount = 1;
InsertTailList(&UsedPageListHeads[MC_NPPOOL],
&MmPageArray[j].ListEntry);
@@ -519,7 +521,7 @@
MmPageArray[i].Flags.Type = MM_PHYSICAL_PAGE_USED;
MmPageArray[i].Flags.Zero = 0;
MmPageArray[i].Flags.Consumer = MC_NPPOOL;
- MmPageArray[i].ReferenceCount = 1;
+ MmPageArray[i].ReferenceCount = 2;
MmPageArray[i].MapCount = 1;
InsertTailList(&UsedPageListHeads[MC_NPPOOL],
&MmPageArray[i].ListEntry);
@@ -588,6 +590,7 @@
KEBUGCHECK(0);
}
MmPageArray[Pfn].MapCount++;
+ MmPageArray[Pfn].ReferenceCount++;
KeReleaseSpinLock(&PageListLock, oldIrql);
}
}
@@ -612,6 +615,7 @@
KEBUGCHECK(0);
}
MmPageArray[Pfn].MapCount--;
+ MmPageArray[Pfn].ReferenceCount--;
KeReleaseSpinLock(&PageListLock, oldIrql);
}
}