Merge 36852, 37322, 37333, 37334, 43428, 43451, 44259, 46404 from amd64 branch.
[reactos.git] / reactos / ntoskrnl / mm / ARM3 / ncache.c
index 15701be..348ba55 100644 (file)
@@ -23,7 +23,7 @@
  */
 PVOID
 NTAPI
-MmAllocateNonCachedMemory(IN ULONG NumberOfBytes)
+MmAllocateNonCachedMemory(IN SIZE_T NumberOfBytes)
 {
     PFN_NUMBER PageCount, MdlPageCount, PageFrameIndex;
     PHYSICAL_ADDRESS LowAddress, HighAddress, SkipBytes;
@@ -108,7 +108,7 @@ MmAllocateNonCachedMemory(IN ULONG NumberOfBytes)
     //
     // Setup the template PTE
     //
-    TempPte = HyperTemplatePte;
+    TempPte = ValidKernelPte;
     
     //
     // Now check what kind of caching we should use
@@ -154,9 +154,7 @@ MmAllocateNonCachedMemory(IN ULONG NumberOfBytes)
         // Set the PFN in the page and write it
         //
         TempPte.u.Hard.PageFrameNumber = PageFrameIndex;
-        ASSERT(PointerPte->u.Hard.Valid == 0);
-        ASSERT(TempPte.u.Hard.Valid == 1);
-        *PointerPte++ = TempPte;
+        MI_WRITE_VALID_PTE(PointerPte++, TempPte);
     } while (--PageCount);
     
     //
@@ -172,7 +170,7 @@ MmAllocateNonCachedMemory(IN ULONG NumberOfBytes)
 VOID
 NTAPI
 MmFreeNonCachedMemory(IN PVOID BaseAddress,
-                      IN SIZE_T NumberOfBytes)
+                      IN ULONG NumberOfBytes)
 {
     PMDL Mdl;
     PMMPTE PointerPte;