Fixed bug.

svn path=/trunk/; revision=1210
This commit is contained in:
David Welch 2000-06-25 17:41:01 +00:00
parent 6e00280f38
commit fcf9dcd627

View file

@ -83,7 +83,12 @@ PVOID MmInitializePageList(PVOID FirstPhysKernelAddress,
MmPageArray = (PHYSICAL_PAGE *)LastKernelAddress;
DPRINT("Reserved %d\n", Reserved);
LastKernelAddress = PAGE_ROUND_UP(LastKernelAddress);
LastKernelAddress = ((ULONG)LastKernelAddress + (Reserved * PAGESIZE));
LastPhysKernelAddress = (PVOID)PAGE_ROUND_UP(LastPhysKernelAddress);
LastPhysKernelAddress = LastPhysKernelAddress + (Reserved * PAGESIZE);
MiNrFreePages = 0;
MiNrUsedPages = 0;
@ -103,8 +108,8 @@ PVOID MmInitializePageList(PVOID FirstPhysKernelAddress,
&MmPageArray[i].ListEntry);
}
MiNrUsedPages = MiNrUsedPages +
(((0xa0000) / PAGESIZE) - i);
for (; i<(0xa0000 / PAGESIZE); i++)
((((ULONG)LastPhysKernelAddress) / PAGESIZE) - i);
for (; i<((ULONG)LastKernelAddress / PAGESIZE); i++)
{
MmPageArray[i].Flags = PHYSICAL_PAGE_INUSE;
MmPageArray[i].ReferenceCount = 1;
@ -114,6 +119,18 @@ PVOID MmInitializePageList(PVOID FirstPhysKernelAddress,
InsertTailList(&UsedPageListHead,
&MmPageArray[i].ListEntry);
}
MiNrFreePages = MiNrFreePages +
((0xa0000/PAGESIZE) - i);
for (; i<(0xa0000/PAGESIZE); i++)
{
MmPageArray[i].Flags = PHYSICAL_PAGE_FREE;
MmPageArray[i].ReferenceCount = 0;
KeInitializeEvent(&MmPageArray[i].Event,
NotificationEvent,
FALSE);
InsertTailList(&FreePageListHead,
&MmPageArray[i].ListEntry);
}
for (; i<(0x100000 / PAGESIZE); i++)
{
MmPageArray[i].Flags = PHYSICAL_PAGE_BIOS;
@ -185,9 +202,7 @@ PVOID MmInitializePageList(PVOID FirstPhysKernelAddress,
InsertTailList(&FreePageListHead,
&MmPageArray[i].ListEntry);
}
DPRINT("\nMmInitializePageList() = %x\n",
LastKernelAddress + Reserved * PAGESIZE);
return((PVOID)(LastKernelAddress + Reserved * PAGESIZE));
return((PVOID)LastKernelAddress);
}
VOID MmReferencePage(PVOID PhysicalAddress)