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