[NTOS]: Remove SwapEntry parameter from MmAllocPage since it was always zero.

[NTOS]: Store SwapEntry as WsIndex. We can do this now since Flink is only used when the page is in a list (meaning it's not active, ie. free or zero), and non-active pages don't have a swap entry.

svn path=/trunk/; revision=45635
This commit is contained in:
Sir Richard
2010-02-20 14:47:23 +00:00
parent 6118ff6a3c
commit 60f00192eb
8 changed files with 13 additions and 19 deletions
+1 -2
View File
@@ -1339,8 +1339,7 @@ MmSetDirtyPage(
PFN_TYPE
NTAPI
MmAllocPage(
ULONG Consumer,
SWAPENTRY SavedSwapEntry
ULONG Consumer
);
LONG
+1 -1
View File
@@ -547,7 +547,7 @@ MiInitMachineDependent(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
//
// Allocate a page for it and create it
//
PageFrameIndex = MmAllocPage(MC_SYSTEM, 0);
PageFrameIndex = MmAllocPage(MC_SYSTEM);
TempPde.u.Hard.PageFrameNumber = PageFrameIndex;
TempPde.u.Hard.Global = FALSE; // Hyperspace is local!
ASSERT(StartPde->u.Hard.Valid == 0);
+1 -1
View File
@@ -1251,7 +1251,7 @@ MiBuildPagedPool(VOID)
//
// Allocate a page and map the first paged pool PDE
//
PageFrameIndex = MmAllocPage(MC_NPPOOL, 0);
PageFrameIndex = MmAllocPage(MC_NPPOOL);
TempPte.u.Hard.PageFrameNumber = PageFrameIndex;
ASSERT(PointerPde->u.Hard.Valid == 0);
ASSERT(TempPte.u.Hard.Valid == 1);
+1 -1
View File
@@ -97,7 +97,7 @@ MiResolveDemandZeroFault(IN PVOID Address,
//
// Get a page
//
PageFrameNumber = MmAllocPage(MC_PPOOL, 0);
PageFrameNumber = MmAllocPage(MC_PPOOL);
DPRINT("New pool page: %lx\n", PageFrameNumber);
//
+2 -2
View File
@@ -236,7 +236,7 @@ MiAllocatePoolPages(IN POOL_TYPE PoolType,
//
// Request a paged pool page and write the PFN for it
//
PageFrameNumber = MmAllocPage(MC_PPOOL, 0);
PageFrameNumber = MmAllocPage(MC_PPOOL);
TempPte.u.Hard.PageFrameNumber = PageFrameNumber;
//
@@ -499,7 +499,7 @@ MiAllocatePoolPages(IN POOL_TYPE PoolType,
//
// Allocate a page
//
PageFrameNumber = MmAllocPage(MC_NPPOOL, 0);
PageFrameNumber = MmAllocPage(MC_NPPOOL);
//
// Get the PFN entry for it
+2 -2
View File
@@ -158,7 +158,7 @@ MmCreateKernelStack(IN BOOLEAN GuiStack,
//
// Get a page
//
PageFrameIndex = MmAllocPage(MC_NPPOOL, 0);
PageFrameIndex = MmAllocPage(MC_NPPOOL);
TempPte.u.Hard.PageFrameNumber = PageFrameIndex;
//
@@ -257,7 +257,7 @@ MmGrowKernelStackEx(IN PVOID StackPointer,
//
// Get a page
//
PageFrameIndex = MmAllocPage(MC_NPPOOL, 0);
PageFrameIndex = MmAllocPage(MC_NPPOOL);
TempPte.u.Hard.PageFrameNumber = PageFrameIndex;
//
+2 -2
View File
@@ -260,7 +260,7 @@ MmRequestPageMemoryConsumer(ULONG Consumer, BOOLEAN CanWait,
if ((Consumer == MC_NPPOOL) || (Consumer == MC_SYSTEM) || MiIsBalancerThread())
{
OldIrql = KeAcquireQueuedSpinLock(LockQueuePfnLock);
Page = MmAllocPage(Consumer, 0);
Page = MmAllocPage(Consumer);
KeReleaseQueuedSpinLock(LockQueuePfnLock, OldIrql);
if (Page == 0)
{
@@ -326,7 +326,7 @@ MmRequestPageMemoryConsumer(ULONG Consumer, BOOLEAN CanWait,
* Actually allocate the page.
*/
OldIrql = KeAcquireQueuedSpinLock(LockQueuePfnLock);
Page = MmAllocPage(Consumer, 0);
Page = MmAllocPage(Consumer);
KeReleaseQueuedSpinLock(LockQueuePfnLock, OldIrql);
if (Page == 0)
{
+3 -8
View File
@@ -30,7 +30,6 @@
// REACTOS NT
//
#define RmapListHead AweReferenceCount
#define SavedSwapEntry u4.EntireFrame
#define PHYSICAL_PAGE MMPFN
#define PPHYSICAL_PAGE PMMPFN
@@ -255,7 +254,6 @@ MiFindContiguousPages(IN PFN_NUMBER LowestPfn,
//
MiRemoveFromList(Pfn1);
Pfn1->u3.e2.ReferenceCount = 1;
Pfn1->SavedSwapEntry = 0;
//
// Check if it was already zeroed
@@ -448,7 +446,6 @@ MiAllocatePagesForMdl(IN PHYSICAL_ADDRESS LowAddress,
Pfn1->u3.e1.StartOfAllocation = 1;
Pfn1->u3.e1.EndOfAllocation = 1;
Pfn1->u3.e2.ReferenceCount = 1;
Pfn1->SavedSwapEntry = 0;
//
// Decrease available pages
@@ -497,7 +494,6 @@ MiAllocatePagesForMdl(IN PHYSICAL_ADDRESS LowAddress,
Pfn1->u3.e2.ReferenceCount = 1;
Pfn1->u3.e1.StartOfAllocation = 1;
Pfn1->u3.e1.EndOfAllocation = 1;
Pfn1->SavedSwapEntry = 0;
//
// Decrease available pages
@@ -747,7 +743,7 @@ MmSetSavedSwapEntryPage(PFN_TYPE Pfn, SWAPENTRY SwapEntry)
KIRQL oldIrql;
oldIrql = KeAcquireQueuedSpinLock(LockQueuePfnLock);
MiGetPfnEntry(Pfn)->SavedSwapEntry = SwapEntry;
MiGetPfnEntry(Pfn)->u1.WsIndex = SwapEntry;
KeReleaseQueuedSpinLock(LockQueuePfnLock, oldIrql);
}
@@ -759,7 +755,7 @@ MmGetSavedSwapEntryPage(PFN_TYPE Pfn)
KIRQL oldIrql;
oldIrql = KeAcquireQueuedSpinLock(LockQueuePfnLock);
SwapEntry = MiGetPfnEntry(Pfn)->SavedSwapEntry;
SwapEntry = MiGetPfnEntry(Pfn)->u1.WsIndex;
KeReleaseQueuedSpinLock(LockQueuePfnLock, oldIrql);
return(SwapEntry);
@@ -845,7 +841,7 @@ MmDereferencePage(PFN_TYPE Pfn)
PFN_TYPE
NTAPI
MmAllocPage(ULONG Type, SWAPENTRY SwapEntry)
MmAllocPage(ULONG Type)
{
PFN_TYPE PfnOffset;
PPHYSICAL_PAGE PageDescriptor;
@@ -876,7 +872,6 @@ MmAllocPage(ULONG Type, SWAPENTRY SwapEntry)
}
PageDescriptor->u3.e2.ReferenceCount = 1;
PageDescriptor->SavedSwapEntry = SwapEntry;
MmAvailablePages--;