From fbca42cd9fd48cea19db3e2e7dc72c53dc1e206d Mon Sep 17 00:00:00 2001 From: ReactOS Portable Systems Group Date: Tue, 23 Jun 2009 06:32:11 +0000 Subject: [PATCH] - 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 --- reactos/ntoskrnl/include/internal/mm.h | 3 ++- reactos/ntoskrnl/mm/cont.c | 3 ++- reactos/ntoskrnl/mm/freelist.c | 7 ++++--- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/reactos/ntoskrnl/include/internal/mm.h b/reactos/ntoskrnl/include/internal/mm.h index 75524ebb8a9..ac090d5c483 100644 --- a/reactos/ntoskrnl/include/internal/mm.h +++ b/reactos/ntoskrnl/include/internal/mm.h @@ -1125,7 +1125,8 @@ MmGetContinuousPages( ULONG NumberOfBytes, PHYSICAL_ADDRESS LowestAcceptableAddress, PHYSICAL_ADDRESS HighestAcceptableAddress, - PHYSICAL_ADDRESS BoundaryAddressMultiple + PHYSICAL_ADDRESS BoundaryAddressMultiple, + BOOLEAN ZeroPages ); NTSTATUS diff --git a/reactos/ntoskrnl/mm/cont.c b/reactos/ntoskrnl/mm/cont.c index faeb8658aa0..577e1ca8ea9 100644 --- a/reactos/ntoskrnl/mm/cont.c +++ b/reactos/ntoskrnl/mm/cont.c @@ -103,7 +103,8 @@ MmAllocateContiguousMemorySpecifyCache(IN SIZE_T NumberOfBytes, PBase = MmGetContinuousPages(NumberOfBytes, LowestAcceptableAddress, HighestAcceptableAddress, - BoundaryAddressMultiple); + BoundaryAddressMultiple, + TRUE); if (PBase == 0) { MmLockAddressSpace(MmGetKernelAddressSpace()); diff --git a/reactos/ntoskrnl/mm/freelist.c b/reactos/ntoskrnl/mm/freelist.c index 6ee34130982..600a3079e41 100644 --- a/reactos/ntoskrnl/mm/freelist.c +++ b/reactos/ntoskrnl/mm/freelist.c @@ -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; }