- Initialize nonpaged pool expansion system PTEs (MiInitializeSystemPtes):

- Just supports expansion space for now, not system space.
  - Very basic initialization of the accounting structures required.
  - Sets up the first two system PTE clusters for the space (the first contains the linkage, the second contains the sizage).
  - Called from MiInitializeArmPool.


svn path=/trunk/; revision=41528
This commit is contained in:
ReactOS Portable Systems Group 2009-06-22 08:51:28 +00:00
parent e980bd998f
commit e5cc98dbc4
4 changed files with 95 additions and 0 deletions

View file

@ -11,6 +11,13 @@
#define MI_MAX_NONPAGED_POOL_SIZE (128 * 1024 * 1024)
#define MI_MAX_FREE_PAGE_LISTS 4
typedef enum _MMSYSTEM_PTE_POOL_TYPE
{
SystemPteSpace,
NonPagedPoolExpansion,
MaximumPtePoolTypes
} MMSYSTEM_PTE_POOL_TYPE;
extern MMPTE HyperTemplatePte;
extern ULONG MmSizeOfNonPagedPoolInBytes;
@ -24,4 +31,12 @@ MiInitializeArmPool(
VOID
);
VOID
NTAPI
MiInitializeSystemPtes(
IN PMMPTE StartingPte,
IN ULONG NumberOfPtes,
IN MMSYSTEM_PTE_POOL_TYPE PoolType
);
/* EOF */

View file

@ -120,6 +120,9 @@ MiInitializeArmPool(VOID)
// guard page on top so make sure to skip it. The bottom guard page will be
// guaranteed by the fact our size is off by one.
//
MiInitializeSystemPtes(PointerPte + 1,
MiExpansionPoolPagesInitialCharge,
NonPagedPoolExpansion);
}
/* EOF */

View file

@ -0,0 +1,76 @@
/*
* PROJECT: ReactOS Kernel
* LICENSE: BSD - See COPYING.ARM in the top level directory
* FILE: ntoskrnl/mm/ARM3/syspte.c
* PURPOSE: ARM Memory Manager System PTE Allocator
* PROGRAMMERS: ReactOS Portable Systems Group
*/
/* INCLUDES *******************************************************************/
#include <ntoskrnl.h>
#define NDEBUG
#include <debug.h>
#line 15 "ARM³::SYSPTE"
#define MODULE_INVOLVED_IN_ARM3
#include "../ARM3/miarm.h"
/* GLOBALS ********************************************************************/
PMMPTE MmSystemPteBase;
PMMPTE MmSystemPtesStart[MaximumPtePoolTypes];
PMMPTE MmSystemPtesEnd[MaximumPtePoolTypes];
MMPTE MmFirstFreeSystemPte[MaximumPtePoolTypes];
ULONG MmTotalFreeSystemPtes[MaximumPtePoolTypes];
/* PRIVATE FUNCTIONS **********************************************************/
VOID
NTAPI
MiInitializeSystemPtes(IN PMMPTE StartingPte,
IN ULONG NumberOfPtes,
IN MMSYSTEM_PTE_POOL_TYPE PoolType)
{
//
// Sanity checks
//
ASSERT(NumberOfPtes >= 1);
ASSERT(PoolType == NonPagedPoolExpansion);
//
// Set the starting and ending PTE addresses for this space
//
MmSystemPteBase = (PVOID)PAGETABLE_MAP;
MmSystemPtesStart[PoolType] = StartingPte;
MmSystemPtesEnd[PoolType] = StartingPte + NumberOfPtes - 1;
DPRINT1("System PTE space for %d starting at: %p and ending at: %p\n",
PoolType, MmSystemPtesStart[PoolType], MmSystemPtesEnd[PoolType]);
//
// Clear all the PTEs to start with
//
RtlZeroMemory(StartingPte, NumberOfPtes * sizeof(MMPTE));
//
// Make the first entry free and link it
//
StartingPte->u.List.NextEntry = -1;
MmFirstFreeSystemPte[PoolType].u.Long = 0;
MmFirstFreeSystemPte[PoolType].u.List.NextEntry = StartingPte -
MmSystemPteBase;
//
// The second entry stores the size of this PTE space
//
StartingPte++;
StartingPte->u.Long = 0;
StartingPte->u.List.NextEntry = NumberOfPtes;
//
// We also keep a global for it
//
MmTotalFreeSystemPtes[PoolType] = NumberOfPtes;
}
/* EOF */

View file

@ -362,6 +362,7 @@
<directory name="ARM3">
<file>init.c</file>
<file>pool.c</file>
<file>syspte.c</file>
</directory>
<file>anonmem.c</file>
<file>balance.c</file>