[ros-diffs] [ros-arm-bringup] 34667: - We need to call MmMarkPageMapped for virtual mappings, except for those created thgouh MmCreateVirtualMappingForKernel (even though the other versions of the call can still do kernel mappings). - Refactored the virtual mapping function to support this. MmUnmapIoSpace now works properly.

ros-arm-bringup at svn.reactos.org ros-arm-bringup at svn.reactos.org
Tue Jul 22 11:31:13 CEST 2008


Author: ros-arm-bringup
Date: Tue Jul 22 04:31:13 2008
New Revision: 34667

URL: http://svn.reactos.org/svn/reactos?rev=34667&view=rev
Log:
- We need to call MmMarkPageMapped for virtual mappings, except for those created thgouh MmCreateVirtualMappingForKernel (even though the other versions of the call can still do kernel mappings).
- Refactored the virtual mapping function to support this. MmUnmapIoSpace now works properly.

Modified:
    trunk/reactos/ntoskrnl/mm/arm/stubs.c

Modified: trunk/reactos/ntoskrnl/mm/arm/stubs.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/arm/stubs.c?rev=34667&r1=34666&r2=34667&view=diff
==============================================================================
--- trunk/reactos/ntoskrnl/mm/arm/stubs.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/mm/arm/stubs.c [iso-8859-1] Tue Jul 22 04:31:13 2008
@@ -480,10 +480,11 @@
 
 NTSTATUS
 NTAPI
-MmCreateVirtualMappingForKernel(IN PVOID Address,
-                                IN ULONG Protection,
-                                IN PPFN_NUMBER Pages,
-                                IN ULONG PageCount)
+MmCreateVirtualMappingInternal(IN PVOID Address,
+                               IN ULONG Protection,
+                               IN PPFN_NUMBER Pages,
+                               IN ULONG PageCount,
+                               IN BOOLEAN MarkAsMapped)
 {
     PMMPTE PointerPte, LastPte, PointerPde, LastPde;
     MMPTE TempPte, TempPde;
@@ -560,6 +561,11 @@
     while (PointerPte <= LastPte)
     {
         //
+        // Mark it as mapped
+        //
+        if (MarkAsMapped) MmMarkPageMapped(*Pages);
+
+        //
         // Set the PFN
         //
         TempPte.u.Hard.L2.Small.BaseAddress = *Pages++;
@@ -594,6 +600,24 @@
     //
     UNIMPLEMENTED;
     return 0;
+}
+
+
+NTSTATUS
+NTAPI
+MmCreateVirtualMappingForKernel(IN PVOID Address,
+                                IN ULONG Protection,
+                                IN PPFN_NUMBER Pages,
+                                IN ULONG PageCount)
+{
+    //
+    // Call the internal version
+    //
+    return MmCreateVirtualMappingInternal(Address,
+                                          Protection,
+                                          Pages,
+                                          PageCount,
+                                          FALSE);
 }
 
 NTSTATUS
@@ -610,12 +634,13 @@
     if (!(Process) || (Process == PsGetCurrentProcess()))
     {
         //
-        // Call the kernel version
-        //
-        return MmCreateVirtualMappingForKernel(Address,
-                                               Protection,
-                                               Pages,
-                                               PageCount);
+        // Call the internal version
+        //
+        return MmCreateVirtualMappingInternal(Address,
+                                              Protection,
+                                              Pages,
+                                              PageCount,
+                                              TRUE);
     }
     
     //



More information about the Ros-diffs mailing list