6#define _MI_PAGING_LEVELS 4
7#define _MI_HAS_NO_EXECUTE 1
10#define MI_USER_PROBE_ADDRESS (PVOID)0x000007FFFFFF0000ULL
11#define MI_DEFAULT_SYSTEM_RANGE_START (PVOID)0xFFFF080000000000ULL
12#define MI_REAL_SYSTEM_RANGE_START 0xFFFF800000000000ULL
14#define HYPER_SPACE 0xFFFFF70000000000ULL
15#define HYPER_SPACE_END 0xFFFFF77FFFFFFFFFULL
17#define MI_SYSTEM_CACHE_WS_START 0xFFFFF78000001000ULL
19#define MM_SYSTEM_SPACE_START 0xFFFFF88000000000ULL
20#define MI_DEBUG_MAPPING (PVOID)0xFFFFF89FFFFFF000ULL
21#define MI_PAGED_POOL_START (PVOID)0xFFFFF8A000000000ULL
25#define MI_SESSION_SPACE_END 0xFFFFF98000000000ULL
26#define MI_SYSTEM_CACHE_START 0xFFFFF98000000000ULL
27#define MI_SYSTEM_CACHE_END 0xFFFFFA7FFFFFFFFFULL
28#define MI_PFN_DATABASE 0xFFFFFA8000000000ULL
29#define MI_NONPAGED_POOL_END (PVOID)0xFFFFFFFFFFBFFFFFULL
31#define MI_HIGHEST_SYSTEM_ADDRESS (PVOID)0xFFFFFFFFFFFFFFFFULL
32#define MmSystemRangeStart ((PVOID)MI_REAL_SYSTEM_RANGE_START)
35#define MM_HIGHEST_USER_ADDRESS_WOW64 0x7FFEFFFF
36#define MM_SYSTEM_RANGE_START_WOW64 0x80000000
39#define PDE_MAPPED_VA (PTE_PER_PAGE * PAGE_SIZE)
45#define MI_SYSTEM_PTE_BASE (PVOID)MiAddressToPte(KSEG0_BASE)
46#define MM_HIGHEST_VAD_ADDRESS (PVOID)((ULONG_PTR)MM_HIGHEST_USER_ADDRESS - (16 * PAGE_SIZE))
47#define MI_MAPPING_RANGE_START HYPER_SPACE
48#define MI_MAPPING_RANGE_END (MI_MAPPING_RANGE_START + MI_HYPERSPACE_PTES * PAGE_SIZE)
49#define MI_DUMMY_PTE (MI_MAPPING_RANGE_END + PAGE_SIZE)
50#define MI_VAD_BITMAP (MI_DUMMY_PTE + PAGE_SIZE)
51#define MI_WORKING_SET_LIST (MI_VAD_BITMAP + PAGE_SIZE)
54#define MI_MIN_PAGES_FOR_NONPAGED_POOL_TUNING ((255 * _1MB) >> PAGE_SHIFT)
55#define MI_MIN_PAGES_FOR_SYSPTE_TUNING ((19 * _1MB) >> PAGE_SHIFT)
56#define MI_MIN_PAGES_FOR_SYSPTE_BOOST ((32 * _1MB) >> PAGE_SHIFT)
57#define MI_MIN_PAGES_FOR_SYSPTE_BOOST_BOOST ((256 * _1MB) >> PAGE_SHIFT)
58#define MI_MIN_INIT_PAGED_POOLSIZE (32 * _1MB)
59#define MI_MAX_INIT_NONPAGED_POOL_SIZE (128ULL * 1024 * 1024 * 1024)
60#define MI_MAX_NONPAGED_POOL_SIZE (128ULL * 1024 * 1024 * 1024)
61#define MI_SYSTEM_VIEW_SIZE (512 * _1MB)
62#define MI_SESSION_VIEW_SIZE (512 * _1MB)
63#define MI_SESSION_POOL_SIZE (64 * _1MB)
64#define MI_SESSION_IMAGE_SIZE (16 * _1MB)
65#define MI_SESSION_WORKING_SET_SIZE (16 * _1MB)
66#define MI_SESSION_SIZE (MI_SESSION_VIEW_SIZE + \
67 MI_SESSION_POOL_SIZE + \
68 MI_SESSION_IMAGE_SIZE + \
69 MI_SESSION_WORKING_SET_SIZE)
70#define MI_MIN_ALLOCATION_FRAGMENT (4 * _1KB)
71#define MI_ALLOCATION_FRAGMENT (64 * _1KB)
72#define MI_MAX_ALLOCATION_FRAGMENT (2 * _1MB)
75#define MM_PTE_SOFTWARE_PROTECTION_BITS 5
76#define MI_MIN_SECONDARY_COLORS 8
77#define MI_SECONDARY_COLORS 64
78#define MI_MAX_SECONDARY_COLORS 1024
79#define MI_NUMBER_SYSTEM_PTES 22000
80#define MI_MAX_FREE_PAGE_LISTS 4
81#define MI_HYPERSPACE_PTES (256 - 1)
82#define MI_ZERO_PTES (32)
83#define MI_MAX_ZERO_BITS 53
84#define SESSION_POOL_LOOKASIDES 21
87#define MM_EMPTY_PTE_LIST ((ULONG64)0xFFFFFFFF)
88#define MM_EMPTY_LIST ((ULONG_PTR)-1)
92#define PFN_FROM_PTE(v) ((v)->u.Hard.PageFrameNumber)
93#define PFN_FROM_PDE(v) ((v)->u.Hard.PageFrameNumber)
94#define PFN_FROM_PPE(v) ((v)->u.Hard.PageFrameNumber)
95#define PFN_FROM_PXE(v) ((v)->u.Hard.PageFrameNumber)
98#define MI_MAKE_DIRTY_PAGE(x) ((x)->u.Hard.Dirty = 1)
99#define MI_MAKE_CLEAN_PAGE(x) ((x)->u.Hard.Dirty = 0)
100#define MI_MAKE_ACCESSED_PAGE(x) ((x)->u.Hard.Accessed = 1)
101#define MI_PAGE_DISABLE_CACHE(x) ((x)->u.Hard.CacheDisable = 1)
102#define MI_PAGE_WRITE_THROUGH(x) ((x)->u.Hard.WriteThrough = 1)
103#define MI_PAGE_WRITE_COMBINED(x) ((x)->u.Hard.WriteThrough = 0)
104#define MI_IS_PAGE_LARGE(x) ((x)->u.Hard.LargePage == 1)
105#if !defined(CONFIG_SMP)
106#define MI_IS_PAGE_WRITEABLE(x) ((x)->u.Hard.Write == 1)
108#define MI_IS_PAGE_WRITEABLE(x) ((x)->u.Hard.Writable == 1)
110#define MI_IS_PAGE_COPY_ON_WRITE(x)((x)->u.Hard.CopyOnWrite == 1)
111#define MI_IS_PAGE_EXECUTABLE(x) ((x)->u.Hard.NoExecute == 0)
112#define MI_IS_PAGE_DIRTY(x) ((x)->u.Hard.Dirty == 1)
113#define MI_MAKE_OWNER_PAGE(x) ((x)->u.Hard.Owner = 1)
114#if !defined(CONFIG_SMP)
115#define MI_MAKE_WRITE_PAGE(x) ((x)->u.Hard.Write = 1)
117#define MI_MAKE_WRITE_PAGE(x) ((x)->u.Hard.Writable = 1)
121#define MI_IS_NOT_PRESENT_FAULT(FaultCode) !BooleanFlagOn(FaultCode, 0x00000001)
122#define MI_IS_WRITE_ACCESS(FaultCode) BooleanFlagOn(FaultCode, 0x00000002)
125#define MI_IS_INSTRUCTION_FETCH(FaultCode) BooleanFlagOn(FaultCode, 0x00000010)
133#define MI_WRITE_VALID_PPE MI_WRITE_VALID_PTE
134#define ValidKernelPpe ValidKernelPde
142 Offset &= 0xFFFFFFFFFULL << 3;
145#define MiAddressToPte(x) _MiAddressToPte((PVOID)(x))
156#define MiAddressToPde(x) _MiAddressToPde((PVOID)(x))
185#define MiAddressToPteOffset(x) MiAddressToPti(x)
194#define MiAddressToPdeOffset(x) MiAddressToPdi(x)
195#define MiGetPdeOffset(x) MiAddressToPdi(x)
306#define MiIsPteOnPdeBoundary(PointerPte) \
307 ((((ULONG_PTR)PointerPte) & (PAGE_SIZE - 1)) == 0)
308#define MiIsPteOnPpeBoundary(PointerPte) \
309 ((((ULONG_PTR)PointerPte) & (PDE_PER_PAGE * PAGE_SIZE - 1)) == 0)
310#define MiIsPteOnPxeBoundary(PointerPte) \
311 ((((ULONG_PTR)PointerPte) & (PPE_PER_PAGE * PDE_PER_PAGE * PAGE_SIZE - 1)) == 0)
316#define MiProtoPteToPte(x) \
317 (PMMPTE)(((LONG64)(x)->u.Long) >> 16)
323#define MiSubsectionPteToSubsection(x) \
324 (PMMPTE)((LONG64)(x)->u.Subsect.SubsectionAddress)
334 NewPte->u.Subsect.Prototype = 1;
337 NewPte->u.Subsect.SubsectionAddress = ((
ULONG_PTR)
Segment & 0x0000FFFFFFFFFFFF);
346 NewPte->u.Long = (
ULONG64)PointerPte << 16;
349 NewPte->u.Proto.Prototype = 1;
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble * u
_In_ ULONG _In_ ULONG Offset
FORCEINLINE ULONG MiAddressToPxi(PVOID Address)
FORCEINLINE PMMPXE MiPdeToPxe(PMMPDE PointerPde)
#define MiAddressToPte(x)
FORCEINLINE PVOID MiPpeToAddress(PMMPTE PointerPpe)
FORCEINLINE PMMPDE MiPdeToPpe(PMMPDE PointerPde)
FORCEINLINE PMMPPE MiPteToPpe(PMMPTE PointerPte)
FORCEINLINE PMMPTE MiPxeToPte(PMMPXE PointerPxe)
FORCEINLINE ULONG MiAddressToPdi(PVOID Address)
FORCEINLINE VOID MI_MAKE_PROTOTYPE_PTE(IN PMMPTE NewPte, IN PMMPTE PointerPte)
FORCEINLINE BOOLEAN MiIsPdeForAddressValid(PVOID Address)
FORCEINLINE PMMPTE MiPpeToPte(PMMPPE PointerPpe)
FORCEINLINE PMMPTE _MiAddressToPte(PVOID Address)
FORCEINLINE PMMPTE MiAddressToPpe(PVOID Address)
#define MiProtoPteToPte(x)
FORCEINLINE PMMPTE MiAddressToPxe(PVOID Address)
FORCEINLINE ULONG MiAddressToPti(PVOID Address)
FORCEINLINE BOOLEAN MI_IS_MAPPED_PTE(PMMPTE PointerPte)
#define MiAddressToPde(x)
FORCEINLINE PMMPTE _MiAddressToPde(PVOID Address)
FORCEINLINE VOID MI_MAKE_SUBSECTION_PTE(_Out_ PMMPTE NewPte, _In_ PVOID Segment)
FORCEINLINE PMMPXE MiPteToPxe(PMMPTE PointerPte)
FORCEINLINE PVOID MiPxeToAddress(PMMPTE PointerPxe)
#define MiPdeToAddress(_Pde)
#define MiPteToAddress(_Pte)