mirror of
https://github.com/reactos/reactos.git
synced 2025-05-25 12:14:32 +00:00
[NTOS]: MiRosTakeOverPebTebRanges now creates a small ~1MB ARM3 memory range on top of the ReactOS per-process VA. This does a couple of things: First of all, it changes the default PEB address to another static address. Still not dynamic like it will be soon, but at least it changes it a bit so we can test if anything breaks due to that. It also likewise changes the addresses of the TEBs (Shifted down by 1MB, basically). Finally, it blocks off that part of address space, which nobody should be using now, to see if anyone does indeed touch it.
[NTOS]: Knowing if this change causes issues will help later in determining regressions due to TEB/PEBs mapped as VADs by ARM3, and regressions simply due to the change in VA layout. [NTOS]: When implemented, the VAD mapping for PEB/TEB will only use that ~1MB, which yes, will limit ReactOS processes to each have only 256 threads. That is obviously a temporary limitation, one I doubt we'll even hit, but I'm putting it out here so you know. svn path=/trunk/; revision=48176
This commit is contained in:
parent
d403f0ffd4
commit
c30930d3ec
2 changed files with 36 additions and 4 deletions
|
@ -25,6 +25,29 @@ MiCreatePebOrTeb(PEPROCESS Process,
|
|||
|
||||
/* PRIVATE FUNCTIONS **********************************************************/
|
||||
|
||||
VOID
|
||||
NTAPI
|
||||
MiRosTakeOverPebTebRanges(IN PEPROCESS Process)
|
||||
{
|
||||
NTSTATUS Status;
|
||||
PMEMORY_AREA MemoryArea;
|
||||
PHYSICAL_ADDRESS BoundaryAddressMultiple;
|
||||
PVOID AllocatedBase = (PVOID)MI_LOWEST_VAD_ADDRESS;
|
||||
BoundaryAddressMultiple.QuadPart = 0;
|
||||
|
||||
Status = MmCreateMemoryArea(&Process->Vm,
|
||||
MEMORY_AREA_OWNED_BY_ARM3,
|
||||
&AllocatedBase,
|
||||
((ULONG_PTR)MM_HIGHEST_VAD_ADDRESS - 1) -
|
||||
(ULONG_PTR)MI_LOWEST_VAD_ADDRESS,
|
||||
PAGE_READWRITE,
|
||||
&MemoryArea,
|
||||
TRUE,
|
||||
0,
|
||||
BoundaryAddressMultiple);
|
||||
ASSERT(NT_SUCCESS(Status));
|
||||
}
|
||||
|
||||
VOID
|
||||
NTAPI
|
||||
MmDeleteKernelStack(IN PVOID StackBase,
|
||||
|
@ -394,7 +417,7 @@ MmCreatePeb(IN PEPROCESS Process,
|
|||
//
|
||||
Peb = MiCreatePebOrTeb(Process,
|
||||
(PVOID)((ULONG_PTR)MM_HIGHEST_VAD_ADDRESS + 1));
|
||||
ASSERT(Peb == (PVOID)0x7FFDF000);
|
||||
if (!Peb) return STATUS_INSUFFICIENT_RESOURCES;
|
||||
|
||||
//
|
||||
// Map NLS Tables
|
||||
|
|
|
@ -13,6 +13,8 @@
|
|||
#define NDEBUG
|
||||
#include <debug.h>
|
||||
|
||||
VOID NTAPI MiRosTakeOverPebTebRanges(IN PEPROCESS Process);
|
||||
|
||||
/* FUNCTIONS *****************************************************************/
|
||||
|
||||
PVOID
|
||||
|
@ -111,6 +113,9 @@ MmInitializeHandBuiltProcess2(IN PEPROCESS Process)
|
|||
FALSE,
|
||||
0,
|
||||
BoundaryAddressMultiple);
|
||||
|
||||
/* Lock the VAD, ARM3-owned ranges away */
|
||||
MiRosTakeOverPebTebRanges(Process);
|
||||
return Status;
|
||||
}
|
||||
|
||||
|
@ -192,7 +197,10 @@ MmInitializeProcessAddressSpace(IN PEPROCESS Process,
|
|||
{
|
||||
DPRINT1("Failed to create Shared User Data\n");
|
||||
goto exit;
|
||||
}
|
||||
}
|
||||
|
||||
/* Lock the VAD, ARM3-owned ranges away */
|
||||
MiRosTakeOverPebTebRanges(Process);
|
||||
|
||||
/* The process now has an address space */
|
||||
Process->HasAddressSpace = TRUE;
|
||||
|
@ -319,6 +327,7 @@ MmDeleteProcessAddressSpace(PEPROCESS Process)
|
|||
|
||||
case MEMORY_AREA_SHARED_DATA:
|
||||
case MEMORY_AREA_NO_ACCESS:
|
||||
case MEMORY_AREA_OWNED_BY_ARM3:
|
||||
MmFreeMemoryArea(&Process->Vm,
|
||||
MemoryArea,
|
||||
NULL,
|
||||
|
|
Loading…
Reference in a new issue