mirror of
https://github.com/reactos/reactos.git
synced 2025-01-03 21:09:19 +00:00
[NTOSKRNL]
Move MmMapMemoryArea to Cc and rename it to CcRosMapVacb svn path=/trunk/; revision=64583
This commit is contained in:
parent
e5ad24bf5e
commit
f82e8687b6
3 changed files with 36 additions and 41 deletions
|
@ -578,6 +578,41 @@ CcRosUnmapVacb (
|
|||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
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 (
|
||||
|
@ -719,7 +754,7 @@ CcRosCreateVacb (
|
|||
}
|
||||
#endif
|
||||
|
||||
MmMapMemoryArea(current->BaseAddress, VACB_MAPPING_GRANULARITY,
|
||||
CcRosMapVacb(current->BaseAddress, VACB_MAPPING_GRANULARITY,
|
||||
MC_CACHE, PAGE_READWRITE);
|
||||
|
||||
return STATUS_SUCCESS;
|
||||
|
|
|
@ -538,13 +538,6 @@ MmFindGap(
|
|||
BOOLEAN TopDown
|
||||
);
|
||||
|
||||
VOID
|
||||
NTAPI
|
||||
MmMapMemoryArea(PVOID BaseAddress,
|
||||
SIZE_T Length,
|
||||
ULONG Consumer,
|
||||
ULONG Protection);
|
||||
|
||||
VOID
|
||||
NTAPI
|
||||
MiRosCheckMemoryAreas(
|
||||
|
|
|
@ -1081,39 +1081,6 @@ MmCreateMemoryArea(PMMSUPPORT AddressSpace,
|
|||
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
|
||||
|
|
Loading…
Reference in a new issue