- Do not zero out MC_SYSTEM pages if they are "early pages" either. This could cause issues on certain systems where mapping the PFN database required "early pages", and they were zeroed before hyperspace was ready.

- Add a new flag to MmGetContigousPages to specify if these pages should be zeroed or not. Allows the nonpaged pool pages not to get automatically zeroed when allocated (the NP pool allocator can do this by itself later). This allows initial nonpaged pool to be allocated before hyperspace is ready.


svn path=/trunk/; revision=41572
This commit is contained in:
ReactOS Portable Systems Group 2009-06-23 06:32:11 +00:00
parent bb161e9df2
commit fbca42cd9f
3 changed files with 8 additions and 5 deletions

View file

@ -1125,7 +1125,8 @@ MmGetContinuousPages(
ULONG NumberOfBytes,
PHYSICAL_ADDRESS LowestAcceptableAddress,
PHYSICAL_ADDRESS HighestAcceptableAddress,
PHYSICAL_ADDRESS BoundaryAddressMultiple
PHYSICAL_ADDRESS BoundaryAddressMultiple,
BOOLEAN ZeroPages
);
NTSTATUS

View file

@ -103,7 +103,8 @@ MmAllocateContiguousMemorySpecifyCache(IN SIZE_T NumberOfBytes,
PBase = MmGetContinuousPages(NumberOfBytes,
LowestAcceptableAddress,
HighestAcceptableAddress,
BoundaryAddressMultiple);
BoundaryAddressMultiple,
TRUE);
if (PBase == 0)
{
MmLockAddressSpace(MmGetKernelAddressSpace());

View file

@ -138,7 +138,8 @@ NTAPI
MmGetContinuousPages(ULONG NumberOfBytes,
PHYSICAL_ADDRESS LowestAcceptableAddress,
PHYSICAL_ADDRESS HighestAcceptableAddress,
PHYSICAL_ADDRESS BoundaryAddressMultiple)
PHYSICAL_ADDRESS BoundaryAddressMultiple,
BOOLEAN ZeroPages)
{
ULONG NrPages;
ULONG i, j;
@ -222,7 +223,7 @@ MmGetContinuousPages(ULONG NumberOfBytes,
{
if (MiGetPfnEntry(i)->Flags.Zero == 0)
{
MiZeroPage(i);
if (ZeroPages) MiZeroPage(i);
}
else
{
@ -727,7 +728,7 @@ MmAllocPage(ULONG Consumer, SWAPENTRY SwapEntry)
/* Allocate an early page -- we'll account for it later */
KeReleaseQueuedSpinLock(LockQueuePfnLock, oldIrql);
PfnOffset = MmAllocEarlyPage();
MiZeroPage(PfnOffset);
if (Consumer != MC_SYSTEM) MiZeroPage(PfnOffset);
return PfnOffset;
}