2010-04-20 22:47:51 +00:00
|
|
|
/*
|
|
|
|
* PROJECT: ReactOS Kernel
|
|
|
|
* LICENSE: BSD - See COPYING.ARM in the top level directory
|
|
|
|
* FILE: ntoskrnl/mm/ARM3/largepag.c
|
|
|
|
* PURPOSE: ARM Memory Manager Large Page Support
|
|
|
|
* PROGRAMMERS: ReactOS Portable Systems Group
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* INCLUDES *******************************************************************/
|
|
|
|
|
|
|
|
#include <ntoskrnl.h>
|
|
|
|
#define NDEBUG
|
|
|
|
#include <debug.h>
|
|
|
|
|
|
|
|
#define MODULE_INVOLVED_IN_ARM3
|
2014-11-10 16:26:55 +00:00
|
|
|
#include <mm/ARM3/miarm.h>
|
2010-04-20 22:47:51 +00:00
|
|
|
|
|
|
|
/* GLOBALS ********************************************************************/
|
|
|
|
|
|
|
|
LIST_ENTRY MmProcessList;
|
|
|
|
PMMPTE MiLargePageHyperPte;
|
|
|
|
ULONG MiLargePageRangeIndex;
|
|
|
|
MI_LARGE_PAGE_RANGES MiLargePageRanges[64];
|
|
|
|
WCHAR MmLargePageDriverBuffer[512] = {0};
|
|
|
|
ULONG MmLargePageDriverBufferLength = -1;
|
|
|
|
LIST_ENTRY MiLargePageDriverList;
|
|
|
|
BOOLEAN MiLargePageAllDrivers;
|
|
|
|
|
|
|
|
/* FUNCTIONS ******************************************************************/
|
|
|
|
|
2018-12-30 11:19:11 +00:00
|
|
|
INIT_FUNCTION
|
2010-04-20 22:47:51 +00:00
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
MiInitializeLargePageSupport(VOID)
|
|
|
|
{
|
|
|
|
#if _MI_PAGING_LEVELS > 2
|
2011-09-30 09:30:52 +00:00
|
|
|
DPRINT1("MiInitializeLargePageSupport: PAE/x64 Not Implemented\n");
|
|
|
|
//ASSERT(FALSE);
|
2010-04-20 22:47:51 +00:00
|
|
|
#else
|
|
|
|
/* Initialize the large-page hyperspace PTE used for initial mapping */
|
|
|
|
MiLargePageHyperPte = MiReserveSystemPtes(1, SystemPteSpace);
|
|
|
|
ASSERT(MiLargePageHyperPte);
|
|
|
|
MiLargePageHyperPte->u.Long = 0;
|
|
|
|
|
|
|
|
/* Initialize the process tracking list, and insert the system process */
|
|
|
|
InitializeListHead(&MmProcessList);
|
|
|
|
InsertTailList(&MmProcessList, &PsGetCurrentProcess()->MmProcessLinks);
|
2010-12-26 15:23:03 +00:00
|
|
|
#endif
|
2010-04-20 22:47:51 +00:00
|
|
|
}
|
|
|
|
|
2018-12-30 11:19:11 +00:00
|
|
|
INIT_FUNCTION
|
2010-04-20 22:47:51 +00:00
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
MiSyncCachedRanges(VOID)
|
|
|
|
{
|
|
|
|
ULONG i;
|
|
|
|
|
|
|
|
/* Scan every range */
|
|
|
|
for (i = 0; i < MiLargePageRangeIndex; i++)
|
|
|
|
{
|
2013-01-06 18:47:39 +00:00
|
|
|
UNIMPLEMENTED_DBGBREAK("No support for large pages\n");
|
2010-04-20 22:47:51 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-12-30 11:19:11 +00:00
|
|
|
INIT_FUNCTION
|
2010-04-20 22:47:51 +00:00
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
MiInitializeDriverLargePageList(VOID)
|
|
|
|
{
|
|
|
|
PWCHAR p, pp;
|
|
|
|
|
|
|
|
/* Initialize the list */
|
|
|
|
InitializeListHead(&MiLargePageDriverList);
|
|
|
|
|
|
|
|
/* Bail out if there's nothing */
|
|
|
|
if (MmLargePageDriverBufferLength == 0xFFFFFFFF) return;
|
|
|
|
|
|
|
|
/* Loop from start to finish */
|
|
|
|
p = MmLargePageDriverBuffer;
|
|
|
|
pp = MmLargePageDriverBuffer + (MmLargePageDriverBufferLength / sizeof(WCHAR));
|
|
|
|
while (p < pp)
|
|
|
|
{
|
|
|
|
/* Skip whitespaces */
|
|
|
|
if ((*p == L' ') || (*p == L'\n') || (*p == L'\r') || (*p == L'\t'))
|
|
|
|
{
|
|
|
|
/* Skip the character */
|
|
|
|
p++;
|
|
|
|
continue;
|
|
|
|
}
|
2010-12-26 15:23:03 +00:00
|
|
|
|
2010-04-20 22:47:51 +00:00
|
|
|
/* A star means everything */
|
|
|
|
if (*p == L'*')
|
|
|
|
{
|
|
|
|
/* No need to keep going */
|
|
|
|
MiLargePageAllDrivers = TRUE;
|
|
|
|
break;
|
|
|
|
}
|
2010-12-26 15:23:03 +00:00
|
|
|
|
2010-04-20 22:47:51 +00:00
|
|
|
DPRINT1("Large page drivers not supported\n");
|
|
|
|
ASSERT(FALSE);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* EOF */
|