mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 13:45:50 +00:00
- 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:
parent
e980bd998f
commit
e5cc98dbc4
4 changed files with 95 additions and 0 deletions
|
@ -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 */
|
||||
|
|
|
@ -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 */
|
||||
|
|
76
reactos/ntoskrnl/mm/ARM3/syspte.c
Normal file
76
reactos/ntoskrnl/mm/ARM3/syspte.c
Normal 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 */
|
|
@ -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>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue