One would expect that a function called "MmIsUsablePage" would return whether a not...
authorReactOS Portable Systems Group <ros-arm-bringup@svn.reactos.org>
Thu, 14 Feb 2008 20:30:31 +0000 (20:30 +0000)
committerReactOS Portable Systems Group <ros-arm-bringup@svn.reactos.org>
Thu, 14 Feb 2008 20:30:31 +0000 (20:30 +0000)
Renamed the function to MmIsPageInUse, and only return TRUE if the page is in use. Like the name says.

svn path=/trunk/; revision=32364

reactos/ntoskrnl/include/internal/mm.h
reactos/ntoskrnl/mm/freelist.c
reactos/ntoskrnl/mm/i386/page.c

index b355289..b0ba0ba 100644 (file)
@@ -1145,7 +1145,7 @@ MmGetReferenceCountPage(PFN_TYPE Page);
 
 BOOLEAN
 NTAPI
-MmIsUsablePage(PFN_TYPE Page);
+MmIsPageInUse(PFN_TYPE Page);
 
 VOID
 NTAPI
index e347958..1a5a8c0 100644 (file)
@@ -640,23 +640,17 @@ MmGetReferenceCountPage(PFN_TYPE Pfn)
 
 BOOLEAN
 NTAPI
-MmIsUsablePage(PFN_TYPE Pfn)
+MmIsPageInUse(PFN_TYPE Pfn)
 {
 
-   DPRINT("MmIsUsablePage(PhysicalAddress %x)\n", Pfn << PAGE_SHIFT);
+   DPRINT("MmIsPageInUse(PhysicalAddress %x)\n", Pfn << PAGE_SHIFT);
 
    if (Pfn == 0 || Pfn >= MmPageArraySize)
    {
       KEBUGCHECK(0);
    }
-
-   if (MmPageArray[Pfn].Flags.Type != MM_PHYSICAL_PAGE_USED &&
-         MmPageArray[Pfn].Flags.Type != MM_PHYSICAL_PAGE_BIOS)
-   {
-      return(FALSE);
-   }
-
-   return(TRUE);
+    
+   return (MmPageArray[Pfn].Flags.Type == MM_PHYSICAL_PAGE_USED);
 }
 
 VOID
index 73a453f..182abac 100644 (file)
@@ -1941,18 +1941,10 @@ MmCreateVirtualMapping(PEPROCESS Process,
 
    for (i = 0; i < PageCount; i++)
    {
-      if (!MmIsUsablePage(Pages[i]))
+      if (!MmIsPageInUse(Pages[i]))
       {
-          /* Is this an attempt to map KUSER_SHARED_DATA? */
-         if ((Address == (PVOID)0x7FFE0000) && (PageCount == 1) && (Pages[0] == 2))
-         {
-            // allow
-         }
-         else
-         {
-            DPRINT1("Page at address %x not usable\n", PFN_TO_PTE(Pages[i]));
-            KEBUGCHECK(0);
-         }
+         DPRINT1("Page at address %x not in use\n", PFN_TO_PTE(Pages[i]));
+         KEBUGCHECK(0);
       }
    }