mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-09-03 04:13:31 +00:00
[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...
svn path=/trunk/; revision=47623
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user