[NTOS]: Reimplement MmCreateProcessAddressSpace in ARM3. Basically the same as before...
[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 /* 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 //
68 // Just check the Valid bit in the Address' PDE and PTE
69 //
70 if ((MiAddressToPde(VirtualAddress)->u.Hard.Valid == 0) ||
71 (MiAddressToPte(VirtualAddress)->u.Hard.Valid == 0))
72 {
73 //
74 // Attempting to access this page is guranteed to result in a page fault
75 //
76 return FALSE;
77 }
78
79 //
80 // This address is valid now, but it will only stay so if the caller holds
81 // the PFN lock
82 //
83 return TRUE;
84 }
85
86 /*
87 * @unimplemented
88 */
89 BOOLEAN
90 NTAPI
91 MmIsNonPagedSystemAddressValid(IN PVOID VirtualAddress)
92 {
93 DPRINT1("WARNING: %s returns bogus result\n", __FUNCTION__);
94 return MmIsAddressValid(VirtualAddress);
95 }
96
97 /*
98 * @unimplemented
99 */
100 NTSTATUS
101 NTAPI
102 MmSetBankedSection(IN HANDLE ProcessHandle,
103 IN PVOID VirtualAddress,
104 IN ULONG BankLength,
105 IN BOOLEAN ReadWriteBank,
106 IN PVOID BankRoutine,
107 IN PVOID Context)
108 {
109 UNIMPLEMENTED;
110 return STATUS_NOT_IMPLEMENTED;
111 }
112
113 /*
114 * @implemented
115 */
116 BOOLEAN
117 NTAPI
118 MmIsRecursiveIoFault(VOID)
119 {
120 PETHREAD Thread = PsGetCurrentThread();
121
122 //
123 // If any of these is true, this is a recursive fault
124 //
125 return ((Thread->DisablePageFaultClustering) | (Thread->ForwardClusterOnly));
126 }
127
128 /*
129 * @implemented
130 */
131 BOOLEAN
132 NTAPI
133 MmIsThisAnNtAsSystem(VOID)
134 {
135 /* Return if this is a server system */
136 return MmProductType;
137 }
138
139 /*
140 * @implemented
141 */
142 MM_SYSTEMSIZE
143 NTAPI
144 MmQuerySystemSize(VOID)
145 {
146 /* Return the low, medium or high memory system type */
147 return MmSystemSize;
148 }
149
150 /* EOF */