Author: ros-arm-bringup
Date: Tue Jun 23 10:32:11 2009
New Revision: 41572

URL: http://svn.reactos.org/svn/reactos?rev=41572&view=rev
Log:
- 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.


Modified:
    trunk/reactos/ntoskrnl/include/internal/mm.h
    trunk/reactos/ntoskrnl/mm/cont.c
    trunk/reactos/ntoskrnl/mm/freelist.c

Modified: trunk/reactos/ntoskrnl/include/internal/mm.h
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/mm.h?rev=41572&r1=41571&r2=41572&view=diff
==============================================================================
--- trunk/reactos/ntoskrnl/include/internal/mm.h [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/include/internal/mm.h [iso-8859-1] Tue Jun 23 
10:32:11 2009
@@ -1125,7 +1125,8 @@
     ULONG NumberOfBytes,
     PHYSICAL_ADDRESS LowestAcceptableAddress,
     PHYSICAL_ADDRESS HighestAcceptableAddress,
-    PHYSICAL_ADDRESS BoundaryAddressMultiple
+    PHYSICAL_ADDRESS BoundaryAddressMultiple,
+    BOOLEAN ZeroPages
 );
 
 NTSTATUS

Modified: trunk/reactos/ntoskrnl/mm/cont.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/cont.c?rev=41572&r1=41571&r2=41572&view=diff
==============================================================================
--- trunk/reactos/ntoskrnl/mm/cont.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/mm/cont.c [iso-8859-1] Tue Jun 23 10:32:11 2009
@@ -103,7 +103,8 @@
    PBase = MmGetContinuousPages(NumberOfBytes,
                                 LowestAcceptableAddress,
                                 HighestAcceptableAddress,
-                                BoundaryAddressMultiple);
+                                BoundaryAddressMultiple,
+                                TRUE);
    if (PBase == 0)
    {
       MmLockAddressSpace(MmGetKernelAddressSpace());

Modified: trunk/reactos/ntoskrnl/mm/freelist.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/freelist.c?rev=41572&r1=41571&r2=41572&view=diff
==============================================================================
--- trunk/reactos/ntoskrnl/mm/freelist.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/mm/freelist.c [iso-8859-1] Tue Jun 23 10:32:11 2009
@@ -138,7 +138,8 @@
 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 @@
          {
             if (MiGetPfnEntry(i)->Flags.Zero == 0)
             {
-              MiZeroPage(i);
+                if (ZeroPages) MiZeroPage(i);
             }
             else
             {
@@ -727,7 +728,7 @@
              /* 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;
          }
 

Reply via email to