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