xref: /reactos/ntoskrnl/mm/ARM3/largepag.c (revision 5c7ce447)
1 /*
2  * PROJECT:         ReactOS Kernel
3  * LICENSE:         BSD - See COPYING.ARM in the top level directory
4  * FILE:            ntoskrnl/mm/ARM3/largepag.c
5  * PURPOSE:         ARM Memory Manager Large Page Support
6  * PROGRAMMERS:     ReactOS Portable Systems Group
7  */
8 
9 /* INCLUDES *******************************************************************/
10 
11 #include <ntoskrnl.h>
12 #define NDEBUG
13 #include <debug.h>
14 
15 #define MODULE_INVOLVED_IN_ARM3
16 #include <mm/ARM3/miarm.h>
17 
18 /* GLOBALS ********************************************************************/
19 
20 LIST_ENTRY MmProcessList;
21 PMMPTE MiLargePageHyperPte;
22 ULONG MiLargePageRangeIndex;
23 MI_LARGE_PAGE_RANGES MiLargePageRanges[64];
24 WCHAR MmLargePageDriverBuffer[512] = {0};
25 ULONG MmLargePageDriverBufferLength = -1;
26 LIST_ENTRY MiLargePageDriverList;
27 BOOLEAN MiLargePageAllDrivers;
28 
29 /* FUNCTIONS ******************************************************************/
30 
31 CODE_SEG("INIT")
32 VOID
33 NTAPI
MiInitializeLargePageSupport(VOID)34 MiInitializeLargePageSupport(VOID)
35 {
36 #if _MI_PAGING_LEVELS > 2
37     DPRINT1("MiInitializeLargePageSupport: PAE/x64 Not Implemented\n");
38     //ASSERT(FALSE);
39 #else
40     /* Initialize the large-page hyperspace PTE used for initial mapping */
41     MiLargePageHyperPte = MiReserveSystemPtes(1, SystemPteSpace);
42     ASSERT(MiLargePageHyperPte);
43     MiLargePageHyperPte->u.Long = 0;
44 
45     /* Initialize the process tracking list, and insert the system process */
46     InitializeListHead(&MmProcessList);
47     InsertTailList(&MmProcessList, &PsGetCurrentProcess()->MmProcessLinks);
48 #endif
49 }
50 
51 CODE_SEG("INIT")
52 VOID
53 NTAPI
MiSyncCachedRanges(VOID)54 MiSyncCachedRanges(VOID)
55 {
56     ULONG i;
57 
58     /* Scan every range */
59     for (i = 0; i < MiLargePageRangeIndex; i++)
60     {
61         UNIMPLEMENTED_DBGBREAK("No support for large pages\n");
62     }
63 }
64 
65 CODE_SEG("INIT")
66 VOID
67 NTAPI
MiInitializeDriverLargePageList(VOID)68 MiInitializeDriverLargePageList(VOID)
69 {
70     PWCHAR p, pp;
71 
72     /* Initialize the list */
73     InitializeListHead(&MiLargePageDriverList);
74 
75     /* Bail out if there's nothing */
76     if (MmLargePageDriverBufferLength == 0xFFFFFFFF) return;
77 
78     /* Loop from start to finish */
79     p = MmLargePageDriverBuffer;
80     pp = MmLargePageDriverBuffer + (MmLargePageDriverBufferLength / sizeof(WCHAR));
81     while (p < pp)
82     {
83         /* Skip whitespaces */
84         if ((*p == L' ') || (*p == L'\n') || (*p == L'\r') || (*p == L'\t'))
85         {
86             /* Skip the character */
87             p++;
88             continue;
89         }
90 
91         /* A star means everything */
92         if (*p == L'*')
93         {
94             /* No need to keep going */
95             MiLargePageAllDrivers = TRUE;
96             break;
97         }
98 
99         DPRINT1("Large page drivers not supported\n");
100         ASSERT(FALSE);
101     }
102 }
103 
104 /* EOF */
105