ReactOS  0.4.14-dev-342-gdc047f9
mmtypes.h
Go to the documentation of this file.
1 /*++ NDK Version: 0095
2 
3 Copyright (c) Alex Ionescu. All rights reserved.
4 
5 Header Name:
6 
7  mmtypes.h (X86)
8 
9 Abstract:
10 
11  i386 Type definitions for the Memory Manager
12 
13 Author:
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
23 extern "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
53 C_ASSERT(PAGE_SIZE == (1 << PAGE_SHIFT));
58 #endif
59 
60 //
61 // PAE SEG0 Base?
62 //
63 #define KSEG0_BASE_PAE 0xE0000000
64 
65 //
66 // Page Table Entry Definitions
67 //
68 typedef struct _HARDWARE_PTE_X86
69 {
84 
85 typedef struct _MMPTE_SOFTWARE
86 {
87  ULONG Valid:1;
89  ULONG Protection:5;
90  ULONG Prototype:1;
91  ULONG Transition:1;
94 
95 typedef struct _MMPTE_TRANSITION
96 {
97  ULONG Valid:1;
99  ULONG Owner:1;
102  ULONG Protection:5;
103  ULONG Prototype:1;
104  ULONG Transition:1;
107 
108 typedef struct _MMPTE_PROTOTYPE
109 {
110  ULONG Valid:1;
112  ULONG ReadOnly:1;
114  ULONG Prototype:1;
117 
118 typedef struct _MMPTE_SUBSECTION
119 {
120  ULONG Valid:1;
122  ULONG Protection:5;
123  ULONG Prototype:1;
125  ULONG WhichPool:1;
127 
128 typedef struct _MMPTE_LIST
129 {
130  ULONG Valid:1;
131  ULONG OneEntry:1;
132  ULONG filler0:8;
133  ULONG Prototype:1;
135  ULONG NextEntry:20;
136 } MMPTE_LIST;
137 
138 #ifndef CONFIG_SMP
139 
140 typedef struct _MMPTE_HARDWARE
141 {
142  ULONG Valid:1;
144  ULONG Owner:1;
152  ULONG Prototype:1;
156 
157 #else
158 
159 typedef struct _MMPTE_HARDWARE
160 {
161  ULONG Valid:1;
162  ULONG Writable:1;
163  ULONG Owner:1;
166  ULONG Accessed:1;
167  ULONG Dirty:1;
168  ULONG LargePage:1;
169  ULONG Global:1;
170  ULONG CopyOnWrite:1;
171  ULONG Prototype:1;
172  ULONG Write:1;
175 
176 #endif
177 
178 //
179 // Use the right PTE structure
180 //
181 #define HARDWARE_PTE HARDWARE_PTE_X86
182 #define PHARDWARE_PTE PHARDWARE_PTE_X86
183 
184 typedef struct _MMPTE
185 {
186  union
187  {
188  ULONG_PTR Long;
196  } u;
197 } MMPTE, *PMMPTE,
198  MMPDE, *PMMPDE;
199 
200 #ifdef __cplusplus
201 }; // extern "C"
202 #endif
203 
204 #endif
#define PAGE_SHIFT
Definition: mmtypes.h:34
ULONG64 Write
Definition: mmtypes.h:170
#define PAGE_SIZE
Definition: mmtypes.h:33
ULONG64 Valid
Definition: mmtypes.h:117
#define MM_ALLOCATION_GRANULARITY_SHIFT
Definition: mmtypes.h:36
ULONG64 NextEntry
Definition: mmtypes.h:145
ULONG reserved
Definition: mmtypes.h:81
ULONG PageFrameNumber
Definition: mmtypes.h:82
ULONG filler1
Definition: mmtypes.h:134
ULONG ProtoAddressHigh
Definition: mmtypes.h:145
struct _MMPTE_TRANSITION MMPTE_TRANSITION
ULONG64 OneEntry
Definition: mmtypes.h:139
struct _HARDWARE_PTE_X86 HARDWARE_PTE_X86
ULONG WriteThrough
Definition: mmtypes.h:145
struct _MMPTE_HARDWARE * PMMPTE_HARDWARE
ULONG64 Protection
Definition: mmtypes.h:130
ULONG64 PageFrameNumber
Definition: mmtypes.h:107
HARDWARE_PTE Flush
Definition: mmtypes.h:216
ULONG64 Transition
Definition: mmtypes.h:105
union _MMPTE::@2254 u
ULONG Global
Definition: mmtypes.h:150
ULONG64 Valid
Definition: mmtypes.h:128
ULONG64 Global
Definition: mmtypes.h:166
ULONG LargePage
Definition: mmtypes.h:149
uint32_t ULONG_PTR
Definition: typedefs.h:63
ULONG64 Dirty
Definition: mmtypes.h:164
struct _MMPTE_SUBSECTION MMPTE_SUBSECTION
#define MM_ALLOCATION_GRANULARITY
Definition: mmtypes.h:35
ULONG64 Owner
Definition: mmtypes.h:160
ULONG64 Valid
Definition: mmtypes.h:138
ULONG64 WriteThrough
Definition: mmtypes.h:161
ULONG64 filler0
Definition: mmtypes.h:140
struct _MMPTE * PMMPDE
struct _MMPTE MMPDE
ULONG64 Protection
Definition: mmtypes.h:88
ULONG CacheDisable
Definition: mmtypes.h:101
ULONG CopyOnWrite
Definition: mmtypes.h:79
ULONG WriteThrough
Definition: mmtypes.h:73
MMPTE_TRANSITION Trans
Definition: mmtypes.h:220
MMPTE_LIST List
Definition: mmtypes.h:222
ULONG64 Prototype
Definition: mmtypes.h:131
ULONG64 Valid
Definition: mmtypes.h:150
ULONG CacheDisable
Definition: mmtypes.h:146
struct _MMPTE * PMMPTE
ULONG64 PageFileLow
Definition: mmtypes.h:87
ULONG64 CopyOnWrite
Definition: mmtypes.h:167
ULONG64 Prototype
Definition: mmtypes.h:104
ULONG64 CacheDisable
Definition: mmtypes.h:162
struct _MMPTE_SOFTWARE MMPTE_SOFTWARE
ULONG64 PageFileHigh
Definition: mmtypes.h:93
ULONG64 Prototype
Definition: mmtypes.h:89
ULONG64 Valid
Definition: mmtypes.h:86
ULONG LargePage
Definition: mmtypes.h:77
struct _MMPTE_LIST MMPTE_LIST
ULONG CopyOnWrite
Definition: mmtypes.h:151
ULONG_PTR Long
Definition: mmtypes.h:215
MMPTE_HARDWARE Hard
Definition: mmtypes.h:217
ULONG SubsectionAddressLow
Definition: mmtypes.h:151
ULONG64 Valid
Definition: mmtypes.h:98
ULONG Accessed
Definition: mmtypes.h:75
struct _MMPTE_PROTOTYPE MMPTE_PROTOTYPE
ULONG64 Transition
Definition: mmtypes.h:90
ULONG CacheDisable
Definition: mmtypes.h:74
ULONG SubsectionAddressHigh
Definition: mmtypes.h:154
C_ASSERT(sizeof(HARDWARE_PDE_ARMV6)==sizeof(ULONG))
MMPTE_SOFTWARE Soft
Definition: mmtypes.h:219
struct _MMPTE MMPTE
ULONG WhichPool
Definition: mmtypes.h:113
ULONG64 Prototype
Definition: mmtypes.h:121
ULONG64 ReadOnly
Definition: mmtypes.h:119
ULONG reserved
Definition: mmtypes.h:153
ULONG Prototype
Definition: mmtypes.h:80
unsigned int ULONG
Definition: retypes.h:1
ULONG ProtoAddressLow
Definition: mmtypes.h:142
ULONG64 LargePage
Definition: mmtypes.h:165
ULONG64 PageFrameNumber
Definition: mmtypes.h:171
struct _MMPTE_HARDWARE MMPTE_HARDWARE
MMPTE_SUBSECTION Subsect
Definition: mmtypes.h:221
struct _HARDWARE_PTE_X86 * PHARDWARE_PTE_X86
ULONG64 Owner
Definition: mmtypes.h:100
ULONG64 Prototype
Definition: mmtypes.h:142
ULONG WriteThrough
Definition: mmtypes.h:100
ULONG64 Protection
Definition: mmtypes.h:103
MMPTE_PROTOTYPE Proto
Definition: mmtypes.h:218
ULONG64 Accessed
Definition: mmtypes.h:163
ULONG Accessed
Definition: mmtypes.h:147
ULONG64 Prototype
Definition: mmtypes.h:168