mirror of
https://github.com/reactos/reactos.git
synced 2024-09-27 21:16:34 +00:00
[NTOS:MM] Remove dead code
This commit is contained in:
parent
c6d08c4828
commit
be6a6b806a
|
@ -598,9 +598,6 @@ MiRemoveZeroPage(IN ULONG Color)
|
|||
return PageIndex;
|
||||
}
|
||||
|
||||
/* HACK for keeping legacy Mm alive */
|
||||
extern BOOLEAN MmRosNotifyAvailablePage(PFN_NUMBER PageFrameIndex);
|
||||
|
||||
VOID
|
||||
NTAPI
|
||||
MiInsertPageInFreeList(IN PFN_NUMBER PageFrameIndex)
|
||||
|
@ -628,13 +625,6 @@ MiInsertPageInFreeList(IN PFN_NUMBER PageFrameIndex)
|
|||
ASSERT(Pfn1->u4.VerifierAllocation == 0);
|
||||
ASSERT(Pfn1->u3.e2.ReferenceCount == 0);
|
||||
|
||||
/* HACK HACK HACK : Feed the page to legacy Mm */
|
||||
if (MmRosNotifyAvailablePage(PageFrameIndex))
|
||||
{
|
||||
DPRINT1("Legacy Mm eating ARM3 page!.\n");
|
||||
return;
|
||||
}
|
||||
|
||||
/* Get the free page list and increment its count */
|
||||
ListHead = &MmFreePageListHead;
|
||||
ASSERT_LIST_INVARIANT(ListHead);
|
||||
|
|
|
@ -29,10 +29,7 @@ MM_ALLOCATION_REQUEST, *PMM_ALLOCATION_REQUEST;
|
|||
|
||||
MM_MEMORY_CONSUMER MiMemoryConsumers[MC_MAXIMUM];
|
||||
static ULONG MiMinimumAvailablePages;
|
||||
static LIST_ENTRY AllocationListHead;
|
||||
static KSPIN_LOCK AllocationListLock;
|
||||
static ULONG MiMinimumPagesPerRun;
|
||||
|
||||
static CLIENT_ID MiBalancerThreadId;
|
||||
static HANDLE MiBalancerThreadHandle = NULL;
|
||||
static KEVENT MiBalancerEvent;
|
||||
|
@ -48,8 +45,6 @@ NTAPI
|
|||
MmInitializeBalancer(ULONG NrAvailablePages, ULONG NrSystemPages)
|
||||
{
|
||||
memset(MiMemoryConsumers, 0, sizeof(MiMemoryConsumers));
|
||||
InitializeListHead(&AllocationListHead);
|
||||
KeInitializeSpinLock(&AllocationListLock);
|
||||
|
||||
/* Set up targets. */
|
||||
MiMinimumAvailablePages = 256;
|
||||
|
@ -350,46 +345,6 @@ MiBalancerThread(PVOID Unused)
|
|||
}
|
||||
}
|
||||
|
||||
BOOLEAN MmRosNotifyAvailablePage(PFN_NUMBER Page)
|
||||
{
|
||||
PLIST_ENTRY Entry;
|
||||
PMM_ALLOCATION_REQUEST Request;
|
||||
PMMPFN Pfn1;
|
||||
|
||||
/* Make sure the PFN lock is held */
|
||||
MI_ASSERT_PFN_LOCK_HELD();
|
||||
|
||||
if (!MiMinimumAvailablePages)
|
||||
{
|
||||
/* Dirty way to know if we were initialized. */
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
Entry = ExInterlockedRemoveHeadList(&AllocationListHead, &AllocationListLock);
|
||||
if (!Entry)
|
||||
return FALSE;
|
||||
|
||||
Request = CONTAINING_RECORD(Entry, MM_ALLOCATION_REQUEST, ListEntry);
|
||||
MiZeroPhysicalPage(Page);
|
||||
Request->Page = Page;
|
||||
|
||||
Pfn1 = MiGetPfnEntry(Page);
|
||||
ASSERT(Pfn1->u3.e2.ReferenceCount == 0);
|
||||
Pfn1->u3.e2.ReferenceCount = 1;
|
||||
Pfn1->u3.e1.PageLocation = ActiveAndValid;
|
||||
|
||||
/* This marks the PFN as a ReactOS PFN */
|
||||
Pfn1->u4.AweAllocation = TRUE;
|
||||
|
||||
/* Allocate the extra ReactOS Data and zero it out */
|
||||
Pfn1->u1.SwapEntry = 0;
|
||||
Pfn1->RmapListHead = NULL;
|
||||
|
||||
KeSetEvent(&Request->Event, IO_NO_INCREMENT, FALSE);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
CODE_SEG("INIT")
|
||||
VOID
|
||||
NTAPI
|
||||
|
|
Loading…
Reference in a new issue