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