[NTOS]: A PFN entry is not necessarily physical only if it is higher than MmHighestPh...
authorSir Richard <sir_richard@svn.reactos.org>
Sun, 6 Jun 2010 14:15:18 +0000 (14:15 +0000)
committerSir Richard <sir_richard@svn.reactos.org>
Sun, 6 Jun 2010 14:15:18 +0000 (14:15 +0000)
svn path=/trunk/; revision=47623

reactos/ntoskrnl/mm/ARM3/iosup.c
reactos/ntoskrnl/mm/ARM3/mdlsup.c
reactos/ntoskrnl/mm/mmdbg.c

index 1a17450..5d8cb2e 100644 (file)
@@ -90,8 +90,8 @@ MmMapIoSpace(IN PHYSICAL_ADDRESS PhysicalAddress,
     // Also translate the cache attribute
     //
     Pfn = (PFN_NUMBER)(PhysicalAddress.QuadPart >> PAGE_SHIFT);
-    IsIoMapping = (Pfn > MmHighestPhysicalPage) ? TRUE : FALSE;
-    if (!IsIoMapping) Pfn1 = MiGetPfnEntry(Pfn);
+    Pfn1 = MiGetPfnEntry(Pfn);
+    IsIoMapping = (Pfn1 == NULL) ? TRUE : FALSE;
     CacheAttribute = MiPlatformCacheAttributes[IsIoMapping][CacheType];
     
     //
@@ -219,7 +219,7 @@ MmUnmapIoSpace(IN PVOID BaseAddress,
     //
     // Is this an I/O mapping?
     //
-    if (Pfn > MmHighestPhysicalPage)
+    if (!MiGetPfnEntry(Pfn))
     {
         //
         // Destroy the PTE
index 1b95448..078de3d 100644 (file)
@@ -129,7 +129,7 @@ MmBuildMdlForNonPagedPool(IN PMDL Mdl)
     //
     // Check if this is an I/O mapping
     //
-    if (Pfn > MmHighestPhysicalPage) Mdl->MdlFlags |= MDL_IO_SPACE;
+    if (!MiGetPfnEntry(Pfn)) Mdl->MdlFlags |= MDL_IO_SPACE;
 }
 
 /*
index fd11099..313516b 100644 (file)
@@ -85,10 +85,8 @@ MiDbgTranslatePhysicalAddress(IN ULONG64 PhysicalAddress,
     //
     Pfn = (PFN_NUMBER)(PhysicalAddress >> PAGE_SHIFT);
 
-    //
-    // Check if this could be an I/O mapping
-    //
-    if (Pfn > MmHighestPhysicalPage)
+    /* Check if this could be an I/O mapping */
+    if (!MiGetPfnEntry(Pfn))
     {
         //
         // FIXME: We don't support this yet