summaryrefslogtreecommitdiffstats
path: root/private/ntos/mm/mips/datamips.c
blob: 1ca65a4757e00e1f8d3d98a4a16e41c2626f03c1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
/*++

Copyright (c) 1990  Microsoft Corporation

Module Name:

   datamips.c

Abstract:

    This module contains the private hardware specific global storage for
    the memory management subsystem.

Author:

    Lou Perazzoli (loup) 27-Mar-1990

Revision History:

--*/

#include "mi.h"

//
// A zero Pte.
//

MMPTE ZeroPte = { 0 };

//
// A kernel zero PTE.
//

#ifdef R3000
MMPTE ZeroKernelPte = { 0 };
#endif //R3000

#ifdef R4000
MMPTE ZeroKernelPte = { MM_PTE_GLOBAL_MASK };
#endif //R4000

#ifdef R3000
MMPTE ValidKernelPte = { MM_PTE_VALID_MASK |
                         MM_PTE_WRITE_MASK |
                         MM_PTE_DIRTY_MASK |
                         MM_PTE_GLOBAL_MASK };
#endif //R3000

#ifdef R4000
MMPTE ValidKernelPte = { MM_PTE_VALID_MASK |
                         MM_PTE_CACHE_ENABLE_MASK |
                         MM_PTE_WRITE_MASK |
                         MM_PTE_DIRTY_MASK |
                         MM_PTE_GLOBAL_MASK };
#endif //R4000


MMPTE ValidUserPte =   { MM_PTE_VALID_MASK |
                         MM_PTE_WRITE_MASK |
                         MM_PTE_CACHE_ENABLE_MASK |
                         MM_PTE_DIRTY_MASK };

MMPTE ValidPtePte =   { MM_PTE_VALID_MASK |
                        MM_PTE_WRITE_MASK |
                        MM_PTE_CACHE_ENABLE_MASK |
                        MM_PTE_DIRTY_MASK };

MMPTE ValidPdePde =   { MM_PTE_VALID_MASK |
                        MM_PTE_WRITE_MASK |
                        MM_PTE_CACHE_ENABLE_MASK |
                        MM_PTE_DIRTY_MASK };

MMPTE ValidKernelPde =   { MM_PTE_VALID_MASK |
                           MM_PTE_WRITE_MASK |
                           MM_PTE_CACHE_ENABLE_MASK |
                           MM_PTE_DIRTY_MASK |
                           MM_PTE_GLOBAL_MASK };

#ifdef R3000
MMPTE DemandZeroPde = { MM_READWRITE << 4 };
#endif //R3000

#ifdef R4000
MMPTE DemandZeroPde = { MM_READWRITE << 3 };
#endif //R4000

#ifdef R3000
MMPTE DemandZeroPte = { MM_READWRITE << 4 };
#endif //R3000


#ifdef R4000
MMPTE DemandZeroPte = { MM_READWRITE << 3 };
#endif //R4000

#ifdef R3000
MMPTE TransitionPde = { 0x2 | (MM_READWRITE << 4) };
#endif //R3000

#ifdef R4000
MMPTE TransitionPde = { MM_PTE_TRANSITION_MASK | (MM_READWRITE << 3) };
#endif //R4000

#ifdef R3000
MMPTE PrototypePte = { 0xFFFFF000 | (MM_READWRITE << 4) | MM_PTE_PROTOTYPE_MASK };
#endif //R3000

#ifdef R4000
MMPTE PrototypePte = { 0xFFFFF000 | (MM_READWRITE << 3) | MM_PTE_PROTOTYPE_MASK };
#endif //R4000

//
// PTE which generates an access violation when referenced.
//

#ifdef R3000
MMPTE NoAccessPte = {MM_NOACCESS << 4};
#endif //R3000

#ifdef R4000
MMPTE NoAccessPte = {MM_NOACCESS << 3};
#endif //R4000


//
// Pool start and end.
//

PVOID MmNonPagedPoolStart;

PVOID MmNonPagedPoolEnd = ((PVOID)MM_NONPAGED_POOL_END);

PVOID MmPagedPoolStart =  (PVOID)0xE1000000;

PVOID MmPagedPoolEnd;


//
// Color tables for free and zeroed pages.
//

MMPFNLIST MmFreePagesByPrimaryColor[2][MM_MAXIMUM_NUMBER_OF_COLORS];

PMMCOLOR_TABLES MmFreePagesByColor[2];

MMPFNLIST MmStandbyPageListByColor[MM_MAXIMUM_NUMBER_OF_COLORS] = {
                             0, StandbyPageList, MM_EMPTY_LIST, MM_EMPTY_LIST,
                             0, StandbyPageList, MM_EMPTY_LIST, MM_EMPTY_LIST,
                             0, StandbyPageList, MM_EMPTY_LIST, MM_EMPTY_LIST,
                             0, StandbyPageList, MM_EMPTY_LIST, MM_EMPTY_LIST,
                             0, StandbyPageList, MM_EMPTY_LIST, MM_EMPTY_LIST,
                             0, StandbyPageList, MM_EMPTY_LIST, MM_EMPTY_LIST,
                             0, StandbyPageList, MM_EMPTY_LIST, MM_EMPTY_LIST,
                             0, StandbyPageList, MM_EMPTY_LIST, MM_EMPTY_LIST
                            };


//
// Color tables for modified pages destined for the paging file.
//

MMPFNLIST MmModifiedPageListByColor[MM_MAXIMUM_NUMBER_OF_COLORS] = {
                            0, ModifiedPageList, MM_EMPTY_LIST, MM_EMPTY_LIST,
                            0, ModifiedPageList, MM_EMPTY_LIST, MM_EMPTY_LIST,
                            0, ModifiedPageList, MM_EMPTY_LIST, MM_EMPTY_LIST,
                            0, ModifiedPageList, MM_EMPTY_LIST, MM_EMPTY_LIST,
                            0, ModifiedPageList, MM_EMPTY_LIST, MM_EMPTY_LIST,
                            0, ModifiedPageList, MM_EMPTY_LIST, MM_EMPTY_LIST,
                            0, ModifiedPageList, MM_EMPTY_LIST, MM_EMPTY_LIST,
                            0, ModifiedPageList, MM_EMPTY_LIST, MM_EMPTY_LIST};

ULONG MmSecondaryColorMask;

//
// Count of the number of modified pages destined for the paging file.
//

ULONG MmTotalPagesForPagingFile;


//
// PTE reserved for mapping physical data for debugger.
//

PMMPTE MmDebugPte = (MiGetPteAddress((PVOID)MM_NONPAGED_POOL_END));

//
// 17 PTEs reserved for mapping MDLs (64k max) + 1 to ensure g-bits right.
//

PMMPTE MmCrashDumpPte = (MiGetPteAddress((PVOID)MM_NONPAGED_POOL_END));