Author: tkreuzer
Date: Wed Oct 8 00:30:15 2014
New Revision: 64583
URL:
http://svn.reactos.org/svn/reactos?rev=64583&view=rev
Log:
[NTOSKRNL]
Move MmMapMemoryArea to Cc and rename it to CcRosMapVacb
Modified:
trunk/reactos/ntoskrnl/cc/view.c
trunk/reactos/ntoskrnl/include/internal/mm.h
trunk/reactos/ntoskrnl/mm/marea.c
Modified: trunk/reactos/ntoskrnl/cc/view.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/cc/view.c?rev=645…
==============================================================================
--- trunk/reactos/ntoskrnl/cc/view.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/cc/view.c [iso-8859-1] Wed Oct 8 00:30:15 2014
@@ -579,6 +579,41 @@
}
static
+VOID
+CcRosMapVacb(PVOID BaseAddress,
+ SIZE_T Length,
+ ULONG Consumer,
+ ULONG Protection)
+{
+ ULONG i;
+ NTSTATUS Status;
+
+ ASSERT(((ULONG_PTR)BaseAddress % PAGE_SIZE) == 0);
+
+ for (i = 0; i < PAGE_ROUND_UP(Length) / PAGE_SIZE; i++)
+ {
+ PFN_NUMBER Page;
+
+ Status = MmRequestPageMemoryConsumer(Consumer, TRUE, &Page);
+ if (!NT_SUCCESS(Status))
+ {
+ DPRINT1("Unable to allocate page\n");
+ KeBugCheck(MEMORY_MANAGEMENT);
+ }
+ Status = MmCreateVirtualMapping (NULL,
+ (PVOID)((ULONG_PTR)BaseAddress + (i *
PAGE_SIZE)),
+ Protection,
+ &Page,
+ 1);
+ if (!NT_SUCCESS(Status))
+ {
+ DPRINT1("Unable to create virtual mapping\n");
+ KeBugCheck(MEMORY_MANAGEMENT);
+ }
+ }
+}
+
+static
NTSTATUS
CcRosCreateVacb (
PROS_SHARED_CACHE_MAP SharedCacheMap,
@@ -719,7 +754,7 @@
}
#endif
- MmMapMemoryArea(current->BaseAddress, VACB_MAPPING_GRANULARITY,
+ CcRosMapVacb(current->BaseAddress, VACB_MAPPING_GRANULARITY,
MC_CACHE, PAGE_READWRITE);
return STATUS_SUCCESS;
Modified: trunk/reactos/ntoskrnl/include/internal/mm.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
==============================================================================
--- trunk/reactos/ntoskrnl/include/internal/mm.h [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/include/internal/mm.h [iso-8859-1] Wed Oct 8 00:30:15 2014
@@ -540,13 +540,6 @@
VOID
NTAPI
-MmMapMemoryArea(PVOID BaseAddress,
- SIZE_T Length,
- ULONG Consumer,
- ULONG Protection);
-
-VOID
-NTAPI
MiRosCheckMemoryAreas(
PMMSUPPORT AddressSpace);
Modified: trunk/reactos/ntoskrnl/mm/marea.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/marea.c?rev=64…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/marea.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/mm/marea.c [iso-8859-1] Wed Oct 8 00:30:15 2014
@@ -1081,39 +1081,6 @@
return STATUS_SUCCESS;
}
-VOID NTAPI
-MmMapMemoryArea(PVOID BaseAddress,
- SIZE_T Length,
- ULONG Consumer,
- ULONG Protection)
-{
- ULONG i;
- NTSTATUS Status;
-
- ASSERT(((ULONG_PTR)BaseAddress % PAGE_SIZE) == 0);
-
- for (i = 0; i < PAGE_ROUND_UP(Length) / PAGE_SIZE; i++)
- {
- PFN_NUMBER Page;
-
- Status = MmRequestPageMemoryConsumer(Consumer, TRUE, &Page);
- if (!NT_SUCCESS(Status))
- {
- DPRINT1("Unable to allocate page\n");
- KeBugCheck(MEMORY_MANAGEMENT);
- }
- Status = MmCreateVirtualMapping (NULL,
- (PVOID)((ULONG_PTR)BaseAddress + (i *
PAGE_SIZE)),
- Protection,
- &Page,
- 1);
- if (!NT_SUCCESS(Status))
- {
- DPRINT1("Unable to create virtual mapping\n");
- KeBugCheck(MEMORY_MANAGEMENT);
- }
- }
-}
VOID
NTAPI