- Do not zero out MC_SYSTEM pages if they are "early pages" either. This could cause...
authorReactOS Portable Systems Group <ros-arm-bringup@svn.reactos.org>
Tue, 23 Jun 2009 06:32:11 +0000 (06:32 +0000)
committerReactOS Portable Systems Group <ros-arm-bringup@svn.reactos.org>
Tue, 23 Jun 2009 06:32:11 +0000 (06:32 +0000)
- 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
reactos/ntoskrnl/mm/cont.c
reactos/ntoskrnl/mm/freelist.c

index 75524eb..ac090d5 100644 (file)
@@ -1125,7 +1125,8 @@ MmGetContinuousPages(
     ULONG NumberOfBytes,
     PHYSICAL_ADDRESS LowestAcceptableAddress,
     PHYSICAL_ADDRESS HighestAcceptableAddress,
-    PHYSICAL_ADDRESS BoundaryAddressMultiple
+    PHYSICAL_ADDRESS BoundaryAddressMultiple,
+    BOOLEAN ZeroPages
 );
 
 NTSTATUS
index faeb865..577e1ca 100644 (file)
@@ -103,7 +103,8 @@ MmAllocateContiguousMemorySpecifyCache(IN SIZE_T NumberOfBytes,
    PBase = MmGetContinuousPages(NumberOfBytes,
                                 LowestAcceptableAddress,
                                 HighestAcceptableAddress,
-                                BoundaryAddressMultiple);
+                                BoundaryAddressMultiple,
+                                TRUE);
    if (PBase == 0)
    {
       MmLockAddressSpace(MmGetKernelAddressSpace());
index 6ee3413..600a307 100644 (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;
          }