[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
PFN_TYPE
NTAPI
MmAllocPage(
- ULONG Consumer,
- SWAPENTRY SavedSwapEntry
+ ULONG Consumer
);
LONG
//
// 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);
//
// 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);
//
// Get a page
//
- PageFrameNumber = MmAllocPage(MC_PPOOL, 0);
+ PageFrameNumber = MmAllocPage(MC_PPOOL);
DPRINT("New pool page: %lx\n", PageFrameNumber);
//
//
// 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;
//
//
// Allocate a page
//
- PageFrameNumber = MmAllocPage(MC_NPPOOL, 0);
+ PageFrameNumber = MmAllocPage(MC_NPPOOL);
//
// Get the PFN entry for it
//
// Get a page
//
- PageFrameIndex = MmAllocPage(MC_NPPOOL, 0);
+ PageFrameIndex = MmAllocPage(MC_NPPOOL);
TempPte.u.Hard.PageFrameNumber = PageFrameIndex;
//
//
// Get a page
//
- PageFrameIndex = MmAllocPage(MC_NPPOOL, 0);
+ PageFrameIndex = MmAllocPage(MC_NPPOOL);
TempPte.u.Hard.PageFrameNumber = PageFrameIndex;
//
if ((Consumer == MC_NPPOOL) || (Consumer == MC_SYSTEM) || MiIsBalancerThread())
{
OldIrql = KeAcquireQueuedSpinLock(LockQueuePfnLock);
- Page = MmAllocPage(Consumer, 0);
+ Page = MmAllocPage(Consumer);
KeReleaseQueuedSpinLock(LockQueuePfnLock, OldIrql);
if (Page == 0)
{
* Actually allocate the page.
*/
OldIrql = KeAcquireQueuedSpinLock(LockQueuePfnLock);
- Page = MmAllocPage(Consumer, 0);
+ Page = MmAllocPage(Consumer);
KeReleaseQueuedSpinLock(LockQueuePfnLock, OldIrql);
if (Page == 0)
{
// REACTOS NT
//
#define RmapListHead AweReferenceCount
-#define SavedSwapEntry u4.EntireFrame
#define PHYSICAL_PAGE MMPFN
#define PPHYSICAL_PAGE PMMPFN
//
MiRemoveFromList(Pfn1);
Pfn1->u3.e2.ReferenceCount = 1;
- Pfn1->SavedSwapEntry = 0;
//
// Check if it was already zeroed
Pfn1->u3.e1.StartOfAllocation = 1;
Pfn1->u3.e1.EndOfAllocation = 1;
Pfn1->u3.e2.ReferenceCount = 1;
- Pfn1->SavedSwapEntry = 0;
//
// Decrease available pages
Pfn1->u3.e2.ReferenceCount = 1;
Pfn1->u3.e1.StartOfAllocation = 1;
Pfn1->u3.e1.EndOfAllocation = 1;
- Pfn1->SavedSwapEntry = 0;
//
// Decrease available pages
KIRQL oldIrql;
oldIrql = KeAcquireQueuedSpinLock(LockQueuePfnLock);
- MiGetPfnEntry(Pfn)->SavedSwapEntry = SwapEntry;
+ MiGetPfnEntry(Pfn)->u1.WsIndex = SwapEntry;
KeReleaseQueuedSpinLock(LockQueuePfnLock, oldIrql);
}
KIRQL oldIrql;
oldIrql = KeAcquireQueuedSpinLock(LockQueuePfnLock);
- SwapEntry = MiGetPfnEntry(Pfn)->SavedSwapEntry;
+ SwapEntry = MiGetPfnEntry(Pfn)->u1.WsIndex;
KeReleaseQueuedSpinLock(LockQueuePfnLock, oldIrql);
return(SwapEntry);
PFN_TYPE
NTAPI
-MmAllocPage(ULONG Type, SWAPENTRY SwapEntry)
+MmAllocPage(ULONG Type)
{
PFN_TYPE PfnOffset;
PPHYSICAL_PAGE PageDescriptor;
}
PageDescriptor->u3.e2.ReferenceCount = 1;
- PageDescriptor->SavedSwapEntry = SwapEntry;
MmAvailablePages--;