Author: tkreuzer
Date: Tue Nov 10 05:19:43 2009
New Revision: 44073
URL:
http://svn.reactos.org/svn/reactos?rev=44073&view=rev
Log:
[MM]
Implement MmIsAddressValid for amd64.
Modified:
branches/ros-amd64-bringup/reactos/ntoskrnl/mm/ARM3/mmsup.c
branches/ros-amd64-bringup/reactos/ntoskrnl/mm/amd64/page.c
Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/mm/ARM3/mmsup.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/ntosk…
==============================================================================
--- branches/ros-amd64-bringup/reactos/ntoskrnl/mm/ARM3/mmsup.c [iso-8859-1] (original)
+++ branches/ros-amd64-bringup/reactos/ntoskrnl/mm/ARM3/mmsup.c [iso-8859-1] Tue Nov 10
05:19:43 2009
@@ -62,6 +62,7 @@
return FALSE;
}
+#ifndef _M_AMD64
/*
* @implemented
*/
@@ -87,6 +88,7 @@
//
return TRUE;
}
+#endif
/*
* @unimplemented
Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/mm/amd64/page.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/ntosk…
==============================================================================
--- branches/ros-amd64-bringup/reactos/ntoskrnl/mm/amd64/page.c [iso-8859-1] (original)
+++ branches/ros-amd64-bringup/reactos/ntoskrnl/mm/amd64/page.c [iso-8859-1] Tue Nov 10
05:19:43 2009
@@ -96,12 +96,12 @@
/* Get the PPE */
Pte = MiAddressToPpe(Address);
- if (Pte->u.Hard.Valid)
+ if (!Pte->u.Hard.Valid)
return NULL;
/* Get the PDE */
Pte = MiAddressToPde(Address);
- if (Pte->u.Hard.Valid)
+ if (!Pte->u.Hard.Valid)
return NULL;
/* Get the PTE */
@@ -542,5 +542,16 @@
return 0;
}
+BOOLEAN
+NTAPI
+MmIsAddressValid(IN PVOID VirtualAddress)
+{
+ /* Check all four page table levels */
+ return (MiAddressToPxe(VirtualAddress)->u.Hard.Valid != 0 &&
+ MiAddressToPpe(VirtualAddress)->u.Hard.Valid != 0 &&
+ MiAddressToPde(VirtualAddress)->u.Hard.Valid != 0 &&
+ MiAddressToPte(VirtualAddress)->u.Hard.Valid != 0);
+}
+
/* EOF */