[CMAKE]
[reactos.git] / ntoskrnl / mm / ARM3 / mmsup.c
1 /*
2 * PROJECT: ReactOS Kernel
3 * LICENSE: BSD - See COPYING.ARM in the top level directory
4 * FILE: ntoskrnl/mm/ARM3/mmsup.c
5 * PURPOSE: ARM Memory Manager Support Routines
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Ā³::MMSUP"
16 #define MODULE_INVOLVED_IN_ARM3
17 #include "../ARM3/miarm.h"
18
19 /* PUBLIC FUNCTIONS ***********************************************************/
20
21 /*
22 * @unimplemented
23 */
24 NTSTATUS
25 NTAPI
26 MmMapUserAddressesToPage(IN PVOID BaseAddress,
27 IN SIZE_T NumberOfBytes,
28 IN PVOID PageAddress)
29 {
30 UNIMPLEMENTED;
31 return STATUS_NOT_IMPLEMENTED;
32 }
33
34 /*
35 * @unimplemented
36 */
37 NTSTATUS
38 NTAPI
39 MmAdjustWorkingSetSize(IN SIZE_T WorkingSetMinimumInBytes,
40 IN SIZE_T WorkingSetMaximumInBytes,
41 IN ULONG SystemCache,
42 IN BOOLEAN IncreaseOkay)
43 {
44 UNIMPLEMENTED;
45 return STATUS_NOT_IMPLEMENTED;
46 }
47
48 /*
49 * @unimplemented
50 */
51 BOOLEAN
52 NTAPI
53 MmSetAddressRangeModified(IN PVOID Address,
54 IN SIZE_T Length)
55 {
56 UNIMPLEMENTED;
57 return FALSE;
58 }
59
60 /*
61 * @implemented
62 */
63 BOOLEAN
64 NTAPI
65 MmIsAddressValid(IN PVOID VirtualAddress)
66 {
67 #if _MI_PAGING_LEVELS >= 4
68 /* Check if the PXE is valid */
69 if (MiAddressToPxe(VirtualAddress)->u.Hard.Valid == 0) return FALSE;
70 #endif
71
72 #if _MI_PAGING_LEVELS >= 3
73 /* Check if the PPE is valid */
74 if (MiAddressToPpe(VirtualAddress)->u.Hard.Valid == 0) return FALSE;
75 #endif
76
77 #if _MI_PAGING_LEVELS >= 2
78 /* Check if the PDE is valid */
79 if (MiAddressToPde(VirtualAddress)->u.Hard.Valid == 0) return FALSE;
80 #endif
81
82 /* Check if the PTE is valid */
83 if (MiAddressToPte(VirtualAddress)->u.Hard.Valid == 0) return FALSE;
84
85 /* This address is valid now, but it will only stay so if the caller holds
86 * the PFN lock */
87 return TRUE;
88 }
89
90 /*
91 * @unimplemented
92 */
93 BOOLEAN
94 NTAPI
95 MmIsNonPagedSystemAddressValid(IN PVOID VirtualAddress)
96 {
97 DPRINT1("WARNING: %s returns bogus result\n", __FUNCTION__);
98 return MmIsAddressValid(VirtualAddress);
99 }
100
101 /*
102 * @unimplemented
103 */
104 NTSTATUS
105 NTAPI
106 MmSetBankedSection(IN HANDLE ProcessHandle,
107 IN PVOID VirtualAddress,
108 IN ULONG BankLength,
109 IN BOOLEAN ReadWriteBank,
110 IN PVOID BankRoutine,
111 IN PVOID Context)
112 {
113 UNIMPLEMENTED;
114 return STATUS_NOT_IMPLEMENTED;
115 }
116
117 /*
118 * @implemented
119 */
120 BOOLEAN
121 NTAPI
122 MmIsRecursiveIoFault(VOID)
123 {
124 PETHREAD Thread = PsGetCurrentThread();
125
126 //
127 // If any of these is true, this is a recursive fault
128 //
129 return ((Thread->DisablePageFaultClustering) | (Thread->ForwardClusterOnly));
130 }
131
132 /*
133 * @implemented
134 */
135 BOOLEAN
136 NTAPI
137 MmIsThisAnNtAsSystem(VOID)
138 {
139 /* Return if this is a server system */
140 return MmProductType;
141 }
142
143 /*
144 * @implemented
145 */
146 MM_SYSTEMSIZE
147 NTAPI
148 MmQuerySystemSize(VOID)
149 {
150 /* Return the low, medium or high memory system type */
151 return MmSystemSize;
152 }
153
154 /* EOF */