ReactOS 0.4.16-dev-226-g79f2289
mmtypes.h
Go to the documentation of this file.
1/*++ NDK Version: 0095
2
3Copyright (c) Alex Ionescu. All rights reserved.
4
5Header Name:
6
7 mmtypes.h (X86)
8
9Abstract:
10
11 i386 Type definitions for the Memory Manager
12
13Author:
14
15 Alex Ionescu (alex.ionescu@reactos.com) 06-Oct-2004
16
17--*/
18
19#ifndef _I386_MMTYPES_H
20#define _I386_MMTYPES_H
21
22#ifdef __cplusplus
23extern "C" {
24#endif
25
26//
27// Dependencies
28//
29
30//
31// Page-related Macros
32//
33#define PAGE_SIZE 0x1000
34#define PAGE_SHIFT 12L
35#define MM_ALLOCATION_GRANULARITY 0x10000
36#define MM_ALLOCATION_GRANULARITY_SHIFT 16L
37#define MM_PAGE_FRAME_NUMBER_SIZE 20
38
39//
40// User space range limit
41//
42#define MI_HIGHEST_USER_ADDRESS (PVOID)0x7FFEFFFF
43
44//
45// Address of the shared user page
46//
47#define MM_SHARED_USER_DATA_VA 0x7FFE0000
48
49//
50// Sanity checks for Paging Macros
51//
52#ifdef C_ASSERT
58#endif
59
60//
61// PAE SEG0 Base?
62//
63#define KSEG0_BASE_PAE 0xE0000000
64
65//
66// Page Table Entry Definitions
67//
68#if !defined(_X86PAE_)
69
70typedef struct _HARDWARE_PTE_X86
71{
86
87typedef struct _MMPTE_SOFTWARE
88{
89 ULONG Valid:1;
96
97typedef struct _MMPTE_TRANSITION
98{
99 ULONG Valid:1;
101 ULONG Owner:1;
109
110typedef struct _MMPTE_PROTOTYPE
111{
112 ULONG Valid:1;
114 ULONG ReadOnly:1;
119
120typedef struct _MMPTE_SUBSECTION
121{
122 ULONG Valid:1;
129
130typedef struct _MMPTE_LIST
131{
132 ULONG Valid:1;
133 ULONG OneEntry:1;
134 ULONG filler0:8;
137 ULONG NextEntry:20;
139
140typedef struct _MMPTE_HARDWARE
141{
142 ULONG Valid:1;
143#ifndef CONFIG_SMP
145#else
146 ULONG Writable:1;
147#endif
148 ULONG Owner:1;
157#ifndef CONFIG_SMP
159#else
160 ULONG Write:1;
161#endif
164
165#else
166
167typedef struct _HARDWARE_PTE_X86
168{
169 union
170 {
171 struct
172 {
184 ULONGLONG reserved0:1;
186 ULONGLONG reserved1:25;
187 ULONGLONG NoExecute:1;
188 };
189 struct
190 {
191 ULONG LowPart;
192 ULONG HighPart;
193 };
194 };
196
197typedef struct _MMPTE_SOFTWARE
198{
204 ULONGLONG Unused:20;
207
208typedef struct _MMPTE_TRANSITION
209{
219 ULONGLONG Unused:26;
221
222typedef struct _MMPTE_PROTOTYPE
223{
230 ULONGLONG Unused:16;
233
234typedef struct _MMPTE_SUBSECTION
235{
243
244typedef struct _MMPTE_LIST
245{
252} MMPTE_LIST;
253
254typedef struct _MMPTE_HARDWARE
255{
257#ifndef CONFIG_SMP
259#else
261#endif
271#ifndef CONFIG_SMP
272 ULONGLONG reserved0:1;
273#else
275#endif
279
280#endif
281
282//
283// Use the right PTE structure
284//
285#define HARDWARE_PTE HARDWARE_PTE_X86
286#define PHARDWARE_PTE PHARDWARE_PTE_X86
287
288typedef struct _MMPTE
289{
290 union
291 {
292#if !defined(_X86PAE_)
294#else
296 struct
297 {
298 ULONG LowPart;
299 ULONG HighPart;
300 } HighLow;
301#endif
309 } u;
312
313#if !defined(_X86PAE_)
314C_ASSERT(sizeof(MMPTE) == sizeof(ULONG));
315#else
316C_ASSERT(sizeof(MMPTE) == sizeof(ULONGLONG));
317#endif
318
319#ifdef __cplusplus
320}; // extern "C"
321#endif
322
323#endif
#define C_ASSERT(e)
Definition: intsafe.h:73
#define Unused(x)
Definition: atlwin.h:28
ULONG const BOOLEAN const _Out_ PBOOLEAN Writable
Definition: mmc.h:77
#define MM_ALLOCATION_GRANULARITY_SHIFT
Definition: mmtypes.h:37
struct _MMPTE_HARDWARE MMPTE_HARDWARE
struct _MMPTE_LIST MMPTE_LIST
struct _MMPTE_SUBSECTION MMPTE_SUBSECTION
struct _MMPTE MMPDE
struct _MMPTE_SOFTWARE MMPTE_SOFTWARE
struct _MMPTE_HARDWARE * PMMPTE_HARDWARE
struct _MMPTE * PMMPTE
#define PAGE_SIZE
Definition: mmtypes.h:34
#define PAGE_SHIFT
Definition: mmtypes.h:35
struct _MMPTE_TRANSITION MMPTE_TRANSITION
#define MM_ALLOCATION_GRANULARITY
Definition: mmtypes.h:36
struct _MMPTE MMPTE
struct _MMPTE_PROTOTYPE MMPTE_PROTOTYPE
struct _MMPTE * PMMPDE
struct _HARDWARE_PTE_X86 HARDWARE_PTE_X86
struct _HARDWARE_PTE_X86 * PHARDWARE_PTE_X86
ULONG Accessed
Definition: mmtypes.h:77
ULONG reserved
Definition: mmtypes.h:83
ULONG PageFrameNumber
Definition: mmtypes.h:84
ULONG LargePage
Definition: mmtypes.h:79
ULONG CacheDisable
Definition: mmtypes.h:76
ULONG CopyOnWrite
Definition: mmtypes.h:81
ULONG Prototype
Definition: mmtypes.h:82
ULONG WriteThrough
Definition: mmtypes.h:75
ULONG64 Dirty
Definition: mmtypes.h:164
ULONG64 LargePage
Definition: mmtypes.h:165
ULONG64 Accessed
Definition: mmtypes.h:163
ULONG64 CacheDisable
Definition: mmtypes.h:162
ULONG64 Valid
Definition: mmtypes.h:150
ULONG64 WriteThrough
Definition: mmtypes.h:161
ULONG CacheDisable
Definition: mmtypes.h:150
ULONG CopyOnWrite
Definition: mmtypes.h:155
ULONG64 Write
Definition: mmtypes.h:170
ULONG64 Prototype
Definition: mmtypes.h:168
ULONG64 Owner
Definition: mmtypes.h:160
ULONG64 Global
Definition: mmtypes.h:166
ULONG reserved
Definition: mmtypes.h:158
ULONG Global
Definition: mmtypes.h:154
ULONG WriteThrough
Definition: mmtypes.h:149
ULONG LargePage
Definition: mmtypes.h:153
ULONG Accessed
Definition: mmtypes.h:151
ULONG64 PageFrameNumber
Definition: mmtypes.h:171
ULONG64 reserved1
Definition: mmtypes.h:172
ULONG64 CopyOnWrite
Definition: mmtypes.h:167
ULONG64 Prototype
Definition: mmtypes.h:142
ULONG filler1
Definition: mmtypes.h:136
ULONG64 OneEntry
Definition: mmtypes.h:139
ULONG64 filler0
Definition: mmtypes.h:140
ULONG64 Valid
Definition: mmtypes.h:138
ULONG64 filler1
Definition: mmtypes.h:144
ULONG64 NextEntry
Definition: mmtypes.h:145
ULONG ProtoAddressHigh
Definition: mmtypes.h:145
ULONG64 Valid
Definition: mmtypes.h:117
ULONG ProtoAddressLow
Definition: mmtypes.h:142
ULONG64 Unused1
Definition: mmtypes.h:120
ULONG64 ReadOnly
Definition: mmtypes.h:119
ULONG64 Protection
Definition: mmtypes.h:122
ULONG64 Prototype
Definition: mmtypes.h:121
ULONG64 Unused0
Definition: mmtypes.h:118
ULONG WhichPool
Definition: mmtypes.h:115
LONG64 ProtoAddress
Definition: mmtypes.h:123
ULONG64 Valid
Definition: mmtypes.h:86
ULONG64 Transition
Definition: mmtypes.h:90
ULONG64 Protection
Definition: mmtypes.h:88
ULONG64 Prototype
Definition: mmtypes.h:89
ULONG64 PageFileHigh
Definition: mmtypes.h:93
ULONG64 PageFileLow
Definition: mmtypes.h:87
ULONG64 Unused0
Definition: mmtypes.h:129
LONG64 SubsectionAddress
Definition: mmtypes.h:133
ULONG64 Protection
Definition: mmtypes.h:130
ULONG64 Prototype
Definition: mmtypes.h:131
ULONG SubsectionAddressHigh
Definition: mmtypes.h:154
ULONG SubsectionAddressLow
Definition: mmtypes.h:151
ULONG64 Unused1
Definition: mmtypes.h:132
ULONG64 Valid
Definition: mmtypes.h:128
ULONG64 Unused
Definition: mmtypes.h:108
ULONG64 WriteThrough
Definition: mmtypes.h:101
ULONG64 Protection
Definition: mmtypes.h:103
ULONG64 Owner
Definition: mmtypes.h:100
ULONG WriteThrough
Definition: mmtypes.h:102
ULONG64 Prototype
Definition: mmtypes.h:104
ULONG64 Transition
Definition: mmtypes.h:105
ULONG CacheDisable
Definition: mmtypes.h:103
ULONG64 CacheDisable
Definition: mmtypes.h:102
ULONG64 Write
Definition: mmtypes.h:99
ULONG64 PageFrameNumber
Definition: mmtypes.h:107
ULONG64 Valid
Definition: mmtypes.h:98
ULONG Long
Definition: mmtypes.h:293
union _MMPTE::@2333 u
MMPTE_LIST List
Definition: mmtypes.h:222
MMPTE_SUBSECTION Subsect
Definition: mmtypes.h:221
MMPTE_TRANSITION Trans
Definition: mmtypes.h:220
MMPTE_PROTOTYPE Proto
Definition: mmtypes.h:218
MMPTE_SOFTWARE Soft
Definition: mmtypes.h:219
HARDWARE_PTE Flush
Definition: mmtypes.h:216
MMPTE_HARDWARE Hard
Definition: mmtypes.h:217
ULONG_PTR Long
Definition: mmtypes.h:215
uint32_t ULONG
Definition: typedefs.h:59
uint64_t ULONGLONG
Definition: typedefs.h:67