Author: sir_richard
Date: Sun Jun 6 16:15:18 2010
New Revision: 47623
URL:
http://svn.reactos.org/svn/reactos?rev=47623&view=rev
Log:
[NTOS]: A PFN entry is not necessarily physical only if it is higher than
MmHighestPhysicalPage. It can also be physical if it lies in a memory hole within the
min-max physical page range. We can detect this by using our PFN Bitmap. So replace all
"Is this an I/O mapping?" checks with a check on whether or not the PFN Database
entry is NULL (which will check for us both of these statements). This ought to be a
macro...
Modified:
trunk/reactos/ntoskrnl/mm/ARM3/iosup.c
trunk/reactos/ntoskrnl/mm/ARM3/mdlsup.c
trunk/reactos/ntoskrnl/mm/mmdbg.c
Modified: trunk/reactos/ntoskrnl/mm/ARM3/iosup.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/iosup.c?r…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/ARM3/iosup.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/mm/ARM3/iosup.c [iso-8859-1] Sun Jun 6 16:15:18 2010
@@ -90,8 +90,8 @@
// 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 @@
//
// Is this an I/O mapping?
//
- if (Pfn > MmHighestPhysicalPage)
+ if (!MiGetPfnEntry(Pfn))
{
//
// Destroy the PTE
Modified: trunk/reactos/ntoskrnl/mm/ARM3/mdlsup.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/mdlsup.c?…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/ARM3/mdlsup.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/mm/ARM3/mdlsup.c [iso-8859-1] Sun Jun 6 16:15:18 2010
@@ -129,7 +129,7 @@
//
// Check if this is an I/O mapping
//
- if (Pfn > MmHighestPhysicalPage) Mdl->MdlFlags |= MDL_IO_SPACE;
+ if (!MiGetPfnEntry(Pfn)) Mdl->MdlFlags |= MDL_IO_SPACE;
}
/*
Modified: trunk/reactos/ntoskrnl/mm/mmdbg.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/mmdbg.c?rev=47…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/mmdbg.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/mm/mmdbg.c [iso-8859-1] Sun Jun 6 16:15:18 2010
@@ -85,10 +85,8 @@
//
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