Author: tkreuzer
Date: Tue Nov 17 20:22:55 2009
New Revision: 44220
URL:
http://svn.reactos.org/svn/reactos?rev=44220&view=rev
Log:
[MM]
- MmCreateMemoryArea: the area type is a bitfield rather than an enum so use %lx instead
of %ld to DPRINT it, add 2 more DPRINTs on failure
- MiInitSystemMemoryAreas: fix calculation of memory area sizes for 64 bit
Modified:
branches/ros-amd64-bringup/reactos/ntoskrnl/include/internal/arm/mm.h
branches/ros-amd64-bringup/reactos/ntoskrnl/include/internal/i386/mm.h
branches/ros-amd64-bringup/reactos/ntoskrnl/mm/marea.c
branches/ros-amd64-bringup/reactos/ntoskrnl/mm/mminit.c
Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/include/internal/arm/mm.h
URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/ntosk…
==============================================================================
--- branches/ros-amd64-bringup/reactos/ntoskrnl/include/internal/arm/mm.h [iso-8859-1]
(original)
+++ branches/ros-amd64-bringup/reactos/ntoskrnl/include/internal/arm/mm.h [iso-8859-1] Tue
Nov 17 20:22:55 2009
@@ -178,6 +178,7 @@
#define PTE_TOP 0xC03FFFFF
#define PDE_BASE 0xC1000000
#define HYPER_SPACE 0xC1100000
+#define HYPER_SPACE_END 0xC07FFFFF
struct _EPROCESS;
PULONG MmGetPageDirectory(VOID);
Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/include/internal/i386/mm.h
URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/ntosk…
==============================================================================
--- branches/ros-amd64-bringup/reactos/ntoskrnl/include/internal/i386/mm.h [iso-8859-1]
(original)
+++ branches/ros-amd64-bringup/reactos/ntoskrnl/include/internal/i386/mm.h [iso-8859-1]
Tue Nov 17 20:22:55 2009
@@ -19,6 +19,7 @@
#define PDE_BASE 0xC0300000
#define PTE_TOP 0xC03FFFFF
#define HYPER_SPACE 0xC0400000
+#define HYPER_SPACE_END 0xC07FFFFF
/* Converting address to a corresponding PDE or PTE entry */
#define MiAddressToPde(x) \
Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/mm/marea.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/ntosk…
==============================================================================
--- branches/ros-amd64-bringup/reactos/ntoskrnl/mm/marea.c [iso-8859-1] (original)
+++ branches/ros-amd64-bringup/reactos/ntoskrnl/mm/marea.c [iso-8859-1] Tue Nov 17
20:22:55 2009
@@ -932,7 +932,7 @@
ULONG tmpLength;
PMEMORY_AREA MemoryArea;
- DPRINT("MmCreateMemoryArea(Type %d, BaseAddress %p, "
+ DPRINT("MmCreateMemoryArea(Type 0x%lx, BaseAddress %p, "
"*BaseAddress %p, Length %p, AllocationFlags %x, "
"FixedAddress %x, Result %p)\n",
Type, BaseAddress, *BaseAddress, Length, AllocationFlags,
@@ -968,6 +968,7 @@
if (MmGetAddressSpaceOwner(AddressSpace) &&
(ULONG_PTR)(*BaseAddress) + tmpLength > (ULONG_PTR)MmSystemRangeStart)
{
+ DPRINT("Memory area for user mode address space exceeds
MmSystemRangeStart\n");
return STATUS_ACCESS_VIOLATION;
}
@@ -1008,7 +1009,11 @@
TAG_MAREA);
}
- if (!MemoryArea) return STATUS_NO_MEMORY;
+ if (!MemoryArea)
+ {
+ DPRINT("Not enough memory.\n");
+ return STATUS_NO_MEMORY;
+ }
RtlZeroMemory(MemoryArea, sizeof(MEMORY_AREA));
MemoryArea->Type = Type;
Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/mm/mminit.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/ntosk…
==============================================================================
--- branches/ros-amd64-bringup/reactos/ntoskrnl/mm/mminit.c [iso-8859-1] (original)
+++ branches/ros-amd64-bringup/reactos/ntoskrnl/mm/mminit.c [iso-8859-1] Tue Nov 17
20:22:55 2009
@@ -84,7 +84,7 @@
Status = MmCreateMemoryArea(MmGetKernelAddressSpace(),
MEMORY_AREA_OWNED_BY_ARM3 | MEMORY_AREA_STATIC,
&BaseAddress,
- 4 * 1024 * 1024,
+ PTE_BASE - PTE_TOP + 1,
PAGE_READWRITE,
&MArea,
TRUE,
@@ -99,7 +99,7 @@
Status = MmCreateMemoryArea(MmGetKernelAddressSpace(),
MEMORY_AREA_OWNED_BY_ARM3 | MEMORY_AREA_STATIC,
&BaseAddress,
- 4 * 1024 * 1024,
+ HYPER_SPACE_END - HYPER_SPACE + 1,
PAGE_READWRITE,
&MArea,
TRUE,
@@ -144,8 +144,7 @@
Status = MmCreateMemoryArea(MmGetKernelAddressSpace(),
MEMORY_AREA_OWNED_BY_ARM3 | MEMORY_AREA_STATIC,
&BaseAddress,
- (ULONG_PTR)MmNonPagedPoolEnd -
- (ULONG_PTR)MmNonPagedSystemStart,
+ (MmNumberOfSystemPtes + 1) * PAGE_SIZE,
PAGE_READWRITE,
&MArea,
TRUE,