ReactOS 0.4.16-dev-329-g9223134
mm.h File Reference

Go to the source code of this file.

Macros

#define _MI_PAGING_LEVELS   4
 
#define _MI_HAS_NO_EXECUTE   1
 
#define MI_USER_PROBE_ADDRESS   (PVOID)0x000007FFFFFF0000ULL
 
#define MI_DEFAULT_SYSTEM_RANGE_START   (PVOID)0xFFFF080000000000ULL
 
#define MI_REAL_SYSTEM_RANGE_START   0xFFFF800000000000ULL
 
#define HYPER_SPACE   0xFFFFF70000000000ULL
 
#define HYPER_SPACE_END   0xFFFFF77FFFFFFFFFULL
 
#define MI_SYSTEM_CACHE_WS_START   0xFFFFF78000001000ULL
 
#define MM_SYSTEM_SPACE_START   0xFFFFF88000000000ULL
 
#define MI_DEBUG_MAPPING   (PVOID)0xFFFFF89FFFFFF000ULL
 
#define MI_PAGED_POOL_START   (PVOID)0xFFFFF8A000000000ULL
 
#define MI_SESSION_SPACE_END   0xFFFFF98000000000ULL
 
#define MI_SYSTEM_CACHE_START   0xFFFFF98000000000ULL
 
#define MI_SYSTEM_CACHE_END   0xFFFFFA7FFFFFFFFFULL
 
#define MI_PFN_DATABASE   0xFFFFFA8000000000ULL
 
#define MI_NONPAGED_POOL_END   (PVOID)0xFFFFFFFFFFBFFFFFULL
 
#define MI_HIGHEST_SYSTEM_ADDRESS   (PVOID)0xFFFFFFFFFFFFFFFFULL
 
#define MmSystemRangeStart   ((PVOID)MI_REAL_SYSTEM_RANGE_START)
 
#define MM_HIGHEST_USER_ADDRESS_WOW64   0x7FFEFFFF
 
#define MM_SYSTEM_RANGE_START_WOW64   0x80000000
 
#define PDE_MAPPED_VA   (PTE_PER_PAGE * PAGE_SIZE)
 
#define MI_SYSTEM_PTE_BASE   (PVOID)MiAddressToPte(KSEG0_BASE)
 
#define MM_HIGHEST_VAD_ADDRESS   (PVOID)((ULONG_PTR)MM_HIGHEST_USER_ADDRESS - (16 * PAGE_SIZE))
 
#define MI_MAPPING_RANGE_START   HYPER_SPACE
 
#define MI_MAPPING_RANGE_END   (MI_MAPPING_RANGE_START + MI_HYPERSPACE_PTES * PAGE_SIZE)
 
#define MI_DUMMY_PTE   (MI_MAPPING_RANGE_END + PAGE_SIZE)
 
#define MI_VAD_BITMAP   (MI_DUMMY_PTE + PAGE_SIZE)
 
#define MI_WORKING_SET_LIST   (MI_VAD_BITMAP + PAGE_SIZE)
 
#define MI_MIN_PAGES_FOR_NONPAGED_POOL_TUNING   ((255 * _1MB) >> PAGE_SHIFT)
 
#define MI_MIN_PAGES_FOR_SYSPTE_TUNING   ((19 * _1MB) >> PAGE_SHIFT)
 
#define MI_MIN_PAGES_FOR_SYSPTE_BOOST   ((32 * _1MB) >> PAGE_SHIFT)
 
#define MI_MIN_PAGES_FOR_SYSPTE_BOOST_BOOST   ((256 * _1MB) >> PAGE_SHIFT)
 
#define MI_MIN_INIT_PAGED_POOLSIZE   (32 * _1MB)
 
#define MI_MAX_INIT_NONPAGED_POOL_SIZE   (128ULL * 1024 * 1024 * 1024)
 
#define MI_MAX_NONPAGED_POOL_SIZE   (128ULL * 1024 * 1024 * 1024)
 
#define MI_SYSTEM_VIEW_SIZE   (512 * _1MB)
 
#define MI_SESSION_VIEW_SIZE   (512 * _1MB)
 
#define MI_SESSION_POOL_SIZE   (64 * _1MB)
 
#define MI_SESSION_IMAGE_SIZE   (16 * _1MB)
 
#define MI_SESSION_WORKING_SET_SIZE   (16 * _1MB)
 
#define MI_SESSION_SIZE
 
#define MI_MIN_ALLOCATION_FRAGMENT   (4 * _1KB)
 
#define MI_ALLOCATION_FRAGMENT   (64 * _1KB)
 
#define MI_MAX_ALLOCATION_FRAGMENT   (2 * _1MB)
 
#define MM_PTE_SOFTWARE_PROTECTION_BITS   5
 
#define MI_MIN_SECONDARY_COLORS   8
 
#define MI_SECONDARY_COLORS   64
 
#define MI_MAX_SECONDARY_COLORS   1024
 
#define MI_NUMBER_SYSTEM_PTES   22000
 
#define MI_MAX_FREE_PAGE_LISTS   4
 
#define MI_HYPERSPACE_PTES   (256 - 1)
 
#define MI_ZERO_PTES   (32)
 
#define MI_MAX_ZERO_BITS   53
 
#define SESSION_POOL_LOOKASIDES   21
 
#define MM_EMPTY_PTE_LIST   ((ULONG64)0xFFFFFFFF)
 
#define MM_EMPTY_LIST   ((ULONG_PTR)-1)
 
#define PFN_FROM_PTE(v)   ((v)->u.Hard.PageFrameNumber)
 
#define PFN_FROM_PDE(v)   ((v)->u.Hard.PageFrameNumber)
 
#define PFN_FROM_PPE(v)   ((v)->u.Hard.PageFrameNumber)
 
#define PFN_FROM_PXE(v)   ((v)->u.Hard.PageFrameNumber)
 
#define MI_MAKE_DIRTY_PAGE(x)   ((x)->u.Hard.Dirty = 1)
 
#define MI_MAKE_CLEAN_PAGE(x)   ((x)->u.Hard.Dirty = 0)
 
#define MI_MAKE_ACCESSED_PAGE(x)   ((x)->u.Hard.Accessed = 1)
 
#define MI_PAGE_DISABLE_CACHE(x)   ((x)->u.Hard.CacheDisable = 1)
 
#define MI_PAGE_WRITE_THROUGH(x)   ((x)->u.Hard.WriteThrough = 1)
 
#define MI_PAGE_WRITE_COMBINED(x)   ((x)->u.Hard.WriteThrough = 0)
 
#define MI_IS_PAGE_LARGE(x)   ((x)->u.Hard.LargePage == 1)
 
#define MI_IS_PAGE_WRITEABLE(x)   ((x)->u.Hard.Write == 1)
 
#define MI_IS_PAGE_COPY_ON_WRITE(x)   ((x)->u.Hard.CopyOnWrite == 1)
 
#define MI_IS_PAGE_EXECUTABLE(x)   ((x)->u.Hard.NoExecute == 0)
 
#define MI_IS_PAGE_DIRTY(x)   ((x)->u.Hard.Dirty == 1)
 
#define MI_MAKE_OWNER_PAGE(x)   ((x)->u.Hard.Owner = 1)
 
#define MI_MAKE_WRITE_PAGE(x)   ((x)->u.Hard.Write = 1)
 
#define MI_IS_NOT_PRESENT_FAULT(FaultCode)   !BooleanFlagOn(FaultCode, 0x00000001)
 
#define MI_IS_WRITE_ACCESS(FaultCode)   BooleanFlagOn(FaultCode, 0x00000002)
 
#define MI_IS_INSTRUCTION_FETCH(FaultCode)   BooleanFlagOn(FaultCode, 0x00000010)
 
#define MI_WRITE_VALID_PPE   MI_WRITE_VALID_PTE
 
#define ValidKernelPpe   ValidKernelPde
 
#define MiAddressToPte(x)   _MiAddressToPte((PVOID)(x))
 
#define MiAddressToPde(x)   _MiAddressToPde((PVOID)(x))
 
#define MiAddressToPteOffset(x)   MiAddressToPti(x)
 
#define MiAddressToPdeOffset(x)   MiAddressToPdi(x)
 
#define MiGetPdeOffset(x)   MiAddressToPdi(x)
 
#define MiIsPteOnPdeBoundary(PointerPte)    ((((ULONG_PTR)PointerPte) & (PAGE_SIZE - 1)) == 0)
 
#define MiIsPteOnPpeBoundary(PointerPte)    ((((ULONG_PTR)PointerPte) & (PDE_PER_PAGE * PAGE_SIZE - 1)) == 0)
 
#define MiIsPteOnPxeBoundary(PointerPte)    ((((ULONG_PTR)PointerPte) & (PPE_PER_PAGE * PDE_PER_PAGE * PAGE_SIZE - 1)) == 0)
 
#define MiProtoPteToPte(x)    (PMMPTE)(((LONG64)(x)->u.Long) >> 16) /* Sign extend 48 bits */
 
#define MiSubsectionPteToSubsection(x)    (PMMPTE)((LONG64)(x)->u.Subsect.SubsectionAddress)
 

Functions

FORCEINLINE PMMPTE _MiAddressToPte (PVOID Address)
 
FORCEINLINE PMMPTE _MiAddressToPde (PVOID Address)
 
FORCEINLINE PMMPTE MiAddressToPpe (PVOID Address)
 
FORCEINLINE PMMPTE MiAddressToPxe (PVOID Address)
 
FORCEINLINE ULONG MiAddressToPti (PVOID Address)
 
FORCEINLINE ULONG MiAddressToPdi (PVOID Address)
 
FORCEINLINE ULONG MiAddressToPxi (PVOID Address)
 
FORCEINLINE PVOID MiPteToAddress (PMMPTE PointerPte)
 
FORCEINLINE PVOID MiPdeToAddress (PMMPTE PointerPde)
 
FORCEINLINE PVOID MiPpeToAddress (PMMPTE PointerPpe)
 
FORCEINLINE PVOID MiPxeToAddress (PMMPTE PointerPxe)
 
FORCEINLINE PMMPTE MiPdeToPte (PMMPDE PointerPde)
 
FORCEINLINE PMMPTE MiPpeToPte (PMMPPE PointerPpe)
 
FORCEINLINE PMMPTE MiPxeToPte (PMMPXE PointerPxe)
 
FORCEINLINE PMMPDE MiPteToPde (PMMPTE PointerPte)
 
FORCEINLINE PMMPPE MiPteToPpe (PMMPTE PointerPte)
 
FORCEINLINE PMMPXE MiPteToPxe (PMMPTE PointerPte)
 
FORCEINLINE PMMPDE MiPdeToPpe (PMMPDE PointerPde)
 
FORCEINLINE PMMPXE MiPdeToPxe (PMMPDE PointerPde)
 
FORCEINLINE VOID MI_MAKE_SUBSECTION_PTE (_Out_ PMMPTE NewPte, _In_ PVOID Segment)
 
FORCEINLINE VOID MI_MAKE_PROTOTYPE_PTE (IN PMMPTE NewPte, IN PMMPTE PointerPte)
 
FORCEINLINE BOOLEAN MI_IS_MAPPED_PTE (PMMPTE PointerPte)
 
FORCEINLINE BOOLEAN MiIsPdeForAddressValid (PVOID Address)
 

Macro Definition Documentation

◆ _MI_HAS_NO_EXECUTE

#define _MI_HAS_NO_EXECUTE   1

Definition at line 7 of file mm.h.

◆ _MI_PAGING_LEVELS

#define _MI_PAGING_LEVELS   4

Definition at line 6 of file mm.h.

◆ HYPER_SPACE

#define HYPER_SPACE   0xFFFFF70000000000ULL

Definition at line 14 of file mm.h.

◆ HYPER_SPACE_END

#define HYPER_SPACE_END   0xFFFFF77FFFFFFFFFULL

Definition at line 15 of file mm.h.

◆ MI_ALLOCATION_FRAGMENT

#define MI_ALLOCATION_FRAGMENT   (64 * _1KB)

Definition at line 71 of file mm.h.

◆ MI_DEBUG_MAPPING

#define MI_DEBUG_MAPPING   (PVOID)0xFFFFF89FFFFFF000ULL

Definition at line 20 of file mm.h.

◆ MI_DEFAULT_SYSTEM_RANGE_START

#define MI_DEFAULT_SYSTEM_RANGE_START   (PVOID)0xFFFF080000000000ULL

Definition at line 11 of file mm.h.

◆ MI_DUMMY_PTE

#define MI_DUMMY_PTE   (MI_MAPPING_RANGE_END + PAGE_SIZE)

Definition at line 49 of file mm.h.

◆ MI_HIGHEST_SYSTEM_ADDRESS

#define MI_HIGHEST_SYSTEM_ADDRESS   (PVOID)0xFFFFFFFFFFFFFFFFULL

Definition at line 31 of file mm.h.

◆ MI_HYPERSPACE_PTES

#define MI_HYPERSPACE_PTES   (256 - 1)

Definition at line 81 of file mm.h.

◆ MI_IS_INSTRUCTION_FETCH

#define MI_IS_INSTRUCTION_FETCH (   FaultCode)    BooleanFlagOn(FaultCode, 0x00000010)

Definition at line 125 of file mm.h.

◆ MI_IS_NOT_PRESENT_FAULT

#define MI_IS_NOT_PRESENT_FAULT (   FaultCode)    !BooleanFlagOn(FaultCode, 0x00000001)

Definition at line 121 of file mm.h.

◆ MI_IS_PAGE_COPY_ON_WRITE

#define MI_IS_PAGE_COPY_ON_WRITE (   x)    ((x)->u.Hard.CopyOnWrite == 1)

Definition at line 110 of file mm.h.

◆ MI_IS_PAGE_DIRTY

#define MI_IS_PAGE_DIRTY (   x)    ((x)->u.Hard.Dirty == 1)

Definition at line 112 of file mm.h.

◆ MI_IS_PAGE_EXECUTABLE

#define MI_IS_PAGE_EXECUTABLE (   x)    ((x)->u.Hard.NoExecute == 0)

Definition at line 111 of file mm.h.

◆ MI_IS_PAGE_LARGE

#define MI_IS_PAGE_LARGE (   x)    ((x)->u.Hard.LargePage == 1)

Definition at line 104 of file mm.h.

◆ MI_IS_PAGE_WRITEABLE

#define MI_IS_PAGE_WRITEABLE (   x)    ((x)->u.Hard.Write == 1)

Definition at line 106 of file mm.h.

◆ MI_IS_WRITE_ACCESS

#define MI_IS_WRITE_ACCESS (   FaultCode)    BooleanFlagOn(FaultCode, 0x00000002)

Definition at line 122 of file mm.h.

◆ MI_MAKE_ACCESSED_PAGE

#define MI_MAKE_ACCESSED_PAGE (   x)    ((x)->u.Hard.Accessed = 1)

Definition at line 100 of file mm.h.

◆ MI_MAKE_CLEAN_PAGE

#define MI_MAKE_CLEAN_PAGE (   x)    ((x)->u.Hard.Dirty = 0)

Definition at line 99 of file mm.h.

◆ MI_MAKE_DIRTY_PAGE

#define MI_MAKE_DIRTY_PAGE (   x)    ((x)->u.Hard.Dirty = 1)

Definition at line 98 of file mm.h.

◆ MI_MAKE_OWNER_PAGE

#define MI_MAKE_OWNER_PAGE (   x)    ((x)->u.Hard.Owner = 1)

Definition at line 113 of file mm.h.

◆ MI_MAKE_WRITE_PAGE

#define MI_MAKE_WRITE_PAGE (   x)    ((x)->u.Hard.Write = 1)

Definition at line 115 of file mm.h.

◆ MI_MAPPING_RANGE_END

#define MI_MAPPING_RANGE_END   (MI_MAPPING_RANGE_START + MI_HYPERSPACE_PTES * PAGE_SIZE)

Definition at line 48 of file mm.h.

◆ MI_MAPPING_RANGE_START

#define MI_MAPPING_RANGE_START   HYPER_SPACE

Definition at line 47 of file mm.h.

◆ MI_MAX_ALLOCATION_FRAGMENT

#define MI_MAX_ALLOCATION_FRAGMENT   (2 * _1MB)

Definition at line 72 of file mm.h.

◆ MI_MAX_FREE_PAGE_LISTS

#define MI_MAX_FREE_PAGE_LISTS   4

Definition at line 80 of file mm.h.

◆ MI_MAX_INIT_NONPAGED_POOL_SIZE

#define MI_MAX_INIT_NONPAGED_POOL_SIZE   (128ULL * 1024 * 1024 * 1024)

Definition at line 59 of file mm.h.

◆ MI_MAX_NONPAGED_POOL_SIZE

#define MI_MAX_NONPAGED_POOL_SIZE   (128ULL * 1024 * 1024 * 1024)

Definition at line 60 of file mm.h.

◆ MI_MAX_SECONDARY_COLORS

#define MI_MAX_SECONDARY_COLORS   1024

Definition at line 78 of file mm.h.

◆ MI_MAX_ZERO_BITS

#define MI_MAX_ZERO_BITS   53

Definition at line 83 of file mm.h.

◆ MI_MIN_ALLOCATION_FRAGMENT

#define MI_MIN_ALLOCATION_FRAGMENT   (4 * _1KB)

Definition at line 70 of file mm.h.

◆ MI_MIN_INIT_PAGED_POOLSIZE

#define MI_MIN_INIT_PAGED_POOLSIZE   (32 * _1MB)

Definition at line 58 of file mm.h.

◆ MI_MIN_PAGES_FOR_NONPAGED_POOL_TUNING

#define MI_MIN_PAGES_FOR_NONPAGED_POOL_TUNING   ((255 * _1MB) >> PAGE_SHIFT)

Definition at line 54 of file mm.h.

◆ MI_MIN_PAGES_FOR_SYSPTE_BOOST

#define MI_MIN_PAGES_FOR_SYSPTE_BOOST   ((32 * _1MB) >> PAGE_SHIFT)

Definition at line 56 of file mm.h.

◆ MI_MIN_PAGES_FOR_SYSPTE_BOOST_BOOST

#define MI_MIN_PAGES_FOR_SYSPTE_BOOST_BOOST   ((256 * _1MB) >> PAGE_SHIFT)

Definition at line 57 of file mm.h.

◆ MI_MIN_PAGES_FOR_SYSPTE_TUNING

#define MI_MIN_PAGES_FOR_SYSPTE_TUNING   ((19 * _1MB) >> PAGE_SHIFT)

Definition at line 55 of file mm.h.

◆ MI_MIN_SECONDARY_COLORS

#define MI_MIN_SECONDARY_COLORS   8

Definition at line 76 of file mm.h.

◆ MI_NONPAGED_POOL_END

#define MI_NONPAGED_POOL_END   (PVOID)0xFFFFFFFFFFBFFFFFULL

Definition at line 29 of file mm.h.

◆ MI_NUMBER_SYSTEM_PTES

#define MI_NUMBER_SYSTEM_PTES   22000

Definition at line 79 of file mm.h.

◆ MI_PAGE_DISABLE_CACHE

#define MI_PAGE_DISABLE_CACHE (   x)    ((x)->u.Hard.CacheDisable = 1)

Definition at line 101 of file mm.h.

◆ MI_PAGE_WRITE_COMBINED

#define MI_PAGE_WRITE_COMBINED (   x)    ((x)->u.Hard.WriteThrough = 0)

Definition at line 103 of file mm.h.

◆ MI_PAGE_WRITE_THROUGH

#define MI_PAGE_WRITE_THROUGH (   x)    ((x)->u.Hard.WriteThrough = 1)

Definition at line 102 of file mm.h.

◆ MI_PAGED_POOL_START

#define MI_PAGED_POOL_START   (PVOID)0xFFFFF8A000000000ULL

Definition at line 21 of file mm.h.

◆ MI_PFN_DATABASE

#define MI_PFN_DATABASE   0xFFFFFA8000000000ULL

Definition at line 28 of file mm.h.

◆ MI_REAL_SYSTEM_RANGE_START

#define MI_REAL_SYSTEM_RANGE_START   0xFFFF800000000000ULL

Definition at line 12 of file mm.h.

◆ MI_SECONDARY_COLORS

#define MI_SECONDARY_COLORS   64

Definition at line 77 of file mm.h.

◆ MI_SESSION_IMAGE_SIZE

#define MI_SESSION_IMAGE_SIZE   (16 * _1MB)

Definition at line 64 of file mm.h.

◆ MI_SESSION_POOL_SIZE

#define MI_SESSION_POOL_SIZE   (64 * _1MB)

Definition at line 63 of file mm.h.

◆ MI_SESSION_SIZE

#define MI_SESSION_SIZE
Value:
#define MI_SESSION_WORKING_SET_SIZE
Definition: mm.h:65
#define MI_SESSION_VIEW_SIZE
Definition: mm.h:62
#define MI_SESSION_IMAGE_SIZE
Definition: mm.h:64
#define MI_SESSION_POOL_SIZE
Definition: mm.h:63

Definition at line 66 of file mm.h.

◆ MI_SESSION_SPACE_END

#define MI_SESSION_SPACE_END   0xFFFFF98000000000ULL

Definition at line 25 of file mm.h.

◆ MI_SESSION_VIEW_SIZE

#define MI_SESSION_VIEW_SIZE   (512 * _1MB)

Definition at line 62 of file mm.h.

◆ MI_SESSION_WORKING_SET_SIZE

#define MI_SESSION_WORKING_SET_SIZE   (16 * _1MB)

Definition at line 65 of file mm.h.

◆ MI_SYSTEM_CACHE_END

#define MI_SYSTEM_CACHE_END   0xFFFFFA7FFFFFFFFFULL

Definition at line 27 of file mm.h.

◆ MI_SYSTEM_CACHE_START

#define MI_SYSTEM_CACHE_START   0xFFFFF98000000000ULL

Definition at line 26 of file mm.h.

◆ MI_SYSTEM_CACHE_WS_START

#define MI_SYSTEM_CACHE_WS_START   0xFFFFF78000001000ULL

Definition at line 17 of file mm.h.

◆ MI_SYSTEM_PTE_BASE

#define MI_SYSTEM_PTE_BASE   (PVOID)MiAddressToPte(KSEG0_BASE)

Definition at line 45 of file mm.h.

◆ MI_SYSTEM_VIEW_SIZE

#define MI_SYSTEM_VIEW_SIZE   (512 * _1MB)

Definition at line 61 of file mm.h.

◆ MI_USER_PROBE_ADDRESS

#define MI_USER_PROBE_ADDRESS   (PVOID)0x000007FFFFFF0000ULL

Definition at line 10 of file mm.h.

◆ MI_VAD_BITMAP

#define MI_VAD_BITMAP   (MI_DUMMY_PTE + PAGE_SIZE)

Definition at line 50 of file mm.h.

◆ MI_WORKING_SET_LIST

#define MI_WORKING_SET_LIST   (MI_VAD_BITMAP + PAGE_SIZE)

Definition at line 51 of file mm.h.

◆ MI_WRITE_VALID_PPE

#define MI_WRITE_VALID_PPE   MI_WRITE_VALID_PTE

Definition at line 133 of file mm.h.

◆ MI_ZERO_PTES

#define MI_ZERO_PTES   (32)

Definition at line 82 of file mm.h.

◆ MiAddressToPde

#define MiAddressToPde (   x)    _MiAddressToPde((PVOID)(x))

Definition at line 156 of file mm.h.

◆ MiAddressToPdeOffset

#define MiAddressToPdeOffset (   x)    MiAddressToPdi(x)

Definition at line 194 of file mm.h.

◆ MiAddressToPte

#define MiAddressToPte (   x)    _MiAddressToPte((PVOID)(x))

Definition at line 145 of file mm.h.

◆ MiAddressToPteOffset

#define MiAddressToPteOffset (   x)    MiAddressToPti(x)

Definition at line 185 of file mm.h.

◆ MiGetPdeOffset

#define MiGetPdeOffset (   x)    MiAddressToPdi(x)

Definition at line 195 of file mm.h.

◆ MiIsPteOnPdeBoundary

#define MiIsPteOnPdeBoundary (   PointerPte)     ((((ULONG_PTR)PointerPte) & (PAGE_SIZE - 1)) == 0)

Definition at line 306 of file mm.h.

◆ MiIsPteOnPpeBoundary

#define MiIsPteOnPpeBoundary (   PointerPte)     ((((ULONG_PTR)PointerPte) & (PDE_PER_PAGE * PAGE_SIZE - 1)) == 0)

Definition at line 308 of file mm.h.

◆ MiIsPteOnPxeBoundary

#define MiIsPteOnPxeBoundary (   PointerPte)     ((((ULONG_PTR)PointerPte) & (PPE_PER_PAGE * PDE_PER_PAGE * PAGE_SIZE - 1)) == 0)

Definition at line 310 of file mm.h.

◆ MiProtoPteToPte

#define MiProtoPteToPte (   x)     (PMMPTE)(((LONG64)(x)->u.Long) >> 16) /* Sign extend 48 bits */

Definition at line 316 of file mm.h.

◆ MiSubsectionPteToSubsection

#define MiSubsectionPteToSubsection (   x)     (PMMPTE)((LONG64)(x)->u.Subsect.SubsectionAddress)

Definition at line 323 of file mm.h.

◆ MM_EMPTY_LIST

#define MM_EMPTY_LIST   ((ULONG_PTR)-1)

Definition at line 88 of file mm.h.

◆ MM_EMPTY_PTE_LIST

#define MM_EMPTY_PTE_LIST   ((ULONG64)0xFFFFFFFF)

Definition at line 87 of file mm.h.

◆ MM_HIGHEST_USER_ADDRESS_WOW64

#define MM_HIGHEST_USER_ADDRESS_WOW64   0x7FFEFFFF

Definition at line 35 of file mm.h.

◆ MM_HIGHEST_VAD_ADDRESS

#define MM_HIGHEST_VAD_ADDRESS   (PVOID)((ULONG_PTR)MM_HIGHEST_USER_ADDRESS - (16 * PAGE_SIZE))

Definition at line 46 of file mm.h.

◆ MM_PTE_SOFTWARE_PROTECTION_BITS

#define MM_PTE_SOFTWARE_PROTECTION_BITS   5

Definition at line 75 of file mm.h.

◆ MM_SYSTEM_RANGE_START_WOW64

#define MM_SYSTEM_RANGE_START_WOW64   0x80000000

Definition at line 36 of file mm.h.

◆ MM_SYSTEM_SPACE_START

#define MM_SYSTEM_SPACE_START   0xFFFFF88000000000ULL

Definition at line 19 of file mm.h.

◆ MmSystemRangeStart

#define MmSystemRangeStart   ((PVOID)MI_REAL_SYSTEM_RANGE_START)

Definition at line 32 of file mm.h.

◆ PDE_MAPPED_VA

#define PDE_MAPPED_VA   (PTE_PER_PAGE * PAGE_SIZE)

Definition at line 39 of file mm.h.

◆ PFN_FROM_PDE

#define PFN_FROM_PDE (   v)    ((v)->u.Hard.PageFrameNumber)

Definition at line 93 of file mm.h.

◆ PFN_FROM_PPE

#define PFN_FROM_PPE (   v)    ((v)->u.Hard.PageFrameNumber)

Definition at line 94 of file mm.h.

◆ PFN_FROM_PTE

#define PFN_FROM_PTE (   v)    ((v)->u.Hard.PageFrameNumber)

Definition at line 92 of file mm.h.

◆ PFN_FROM_PXE

#define PFN_FROM_PXE (   v)    ((v)->u.Hard.PageFrameNumber)

Definition at line 95 of file mm.h.

◆ SESSION_POOL_LOOKASIDES

#define SESSION_POOL_LOOKASIDES   21

Definition at line 84 of file mm.h.

◆ ValidKernelPpe

#define ValidKernelPpe   ValidKernelPde

Definition at line 134 of file mm.h.

Function Documentation

◆ _MiAddressToPde()

FORCEINLINE PMMPTE _MiAddressToPde ( PVOID  Address)

Definition at line 150 of file mm.h.

151{
153 Offset &= 0x7FFFFFF << 3;
154 return (PMMPTE)(PDE_BASE + Offset);
155}
#define PDE_BASE
Definition: winldr.c:21
unsigned __int64 ULONG64
Definition: imports.h:198
_In_ ULONG _In_ ULONG Offset
Definition: ntddpcm.h:101
static WCHAR Address[46]
Definition: ping.c:68
#define PDI_SHIFT

◆ _MiAddressToPte()

FORCEINLINE PMMPTE _MiAddressToPte ( PVOID  Address)

Definition at line 139 of file mm.h.

140{
142 Offset &= 0xFFFFFFFFFULL << 3;
143 return (PMMPTE)(PTE_BASE + Offset);
144}
#define PTE_BASE
Definition: mmx86.c:14
#define PTI_SHIFT

◆ MI_IS_MAPPED_PTE()

FORCEINLINE BOOLEAN MI_IS_MAPPED_PTE ( PMMPTE  PointerPte)

Definition at line 356 of file mm.h.

357{
358 return ((PointerPte->u.Hard.Valid != 0) ||
359 (PointerPte->u.Proto.Prototype != 0) ||
360 (PointerPte->u.Trans.Transition != 0) ||
361 (PointerPte->u.Hard.PageFrameNumber != 0));
362}
ULONG64 Valid
Definition: mmtypes.h:150
ULONG64 PageFrameNumber
Definition: mmtypes.h:171
ULONG64 Prototype
Definition: mmtypes.h:121
ULONG64 Transition
Definition: mmtypes.h:105
union _MMPTE::@2339 u
MMPTE_TRANSITION Trans
Definition: mmtypes.h:220
MMPTE_PROTOTYPE Proto
Definition: mmtypes.h:218
MMPTE_HARDWARE Hard
Definition: mmtypes.h:217

Referenced by MiDeleteVirtualAddresses().

◆ MI_MAKE_PROTOTYPE_PTE()

FORCEINLINE VOID MI_MAKE_PROTOTYPE_PTE ( IN PMMPTE  NewPte,
IN PMMPTE  PointerPte 
)

Definition at line 342 of file mm.h.

344{
345 /* Store the Address */
346 NewPte->u.Long = (ULONG64)PointerPte << 16;
347
348 /* Mark this as a prototype PTE */
349 NewPte->u.Proto.Prototype = 1;
350
351 ASSERT(MiProtoPteToPte(NewPte) == PointerPte);
352}
#define ASSERT(a)
Definition: mode.c:44
#define MiProtoPteToPte(x)
Definition: mm.h:316

Referenced by MiAddMappedPtes(), and MmArmInitSystem().

◆ MI_MAKE_SUBSECTION_PTE()

FORCEINLINE VOID MI_MAKE_SUBSECTION_PTE ( _Out_ PMMPTE  NewPte,
_In_ PVOID  Segment 
)

Definition at line 328 of file mm.h.

331{
332 /* Mark this as a prototype */
333 NewPte->u.Long = 0;
334 NewPte->u.Subsect.Prototype = 1;
335
336 /* Store the lower 48 bits of the Segment address */
337 NewPte->u.Subsect.SubsectionAddress = ((ULONG_PTR)Segment & 0x0000FFFFFFFFFFFF);
338}
#define ULONG_PTR
Definition: config.h:101
_Inout_ PVOID Segment
Definition: exfuncs.h:1101

Referenced by MmArmInitSystem().

◆ MiAddressToPdi()

FORCEINLINE ULONG MiAddressToPdi ( PVOID  Address)

Definition at line 190 of file mm.h.

191{
192 return ((((ULONG64)Address) >> PDI_SHIFT) & 0x1FF);
193}

◆ MiAddressToPpe()

◆ MiAddressToPti()

FORCEINLINE ULONG MiAddressToPti ( PVOID  Address)

Definition at line 181 of file mm.h.

182{
183 return ((((ULONG64)Address) >> PTI_SHIFT) & 0x1FF);
184}

Referenced by MiArchCreateProcessAddressSpace().

◆ MiAddressToPxe()

◆ MiAddressToPxi()

FORCEINLINE ULONG MiAddressToPxi ( PVOID  Address)

Definition at line 200 of file mm.h.

201{
202 return ((((ULONG64)Address) >> PXI_SHIFT) & 0x1FF);
203}

Referenced by MiArchCreateProcessAddressSpace().

◆ MiIsPdeForAddressValid()

FORCEINLINE BOOLEAN MiIsPdeForAddressValid ( PVOID  Address)

Definition at line 366 of file mm.h.

367{
368 return ((MiAddressToPxe(Address)->u.Hard.Valid) &&
369 (MiAddressToPpe(Address)->u.Hard.Valid) &&
370 (MiAddressToPde(Address)->u.Hard.Valid));
371}
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
Definition: glfuncs.h:240
FORCEINLINE PMMPTE MiAddressToPpe(PVOID Address)
Definition: mm.h:161
FORCEINLINE PMMPTE MiAddressToPxe(PVOID Address)
Definition: mm.h:171
#define MiAddressToPde(x)
Definition: mm.h:156

Referenced by _Success_(), MmGetPageProtect(), MmIsDisabledPage(), and MmIsPagePresent().

◆ MiPdeToAddress()

FORCEINLINE PVOID MiPdeToAddress ( PMMPTE  PointerPde)

Definition at line 217 of file mm.h.

218{
219 /* Use signed math */
220 return (PVOID)(((LONG64)PointerPde << 34) >> 16);
221}
int64_t LONG64
Definition: typedefs.h:68

◆ MiPdeToPpe()

FORCEINLINE PMMPDE MiPdeToPpe ( PMMPDE  PointerPde)

Definition at line 292 of file mm.h.

293{
294 return (PMMPPE)MiAddressToPte(PointerPde);
295}
#define MiAddressToPte(x)
Definition: mm.h:145

Referenced by MiDeletePde(), MiFillSystemPageDirectory(), and MiMakePdeExistAndMakeValid().

◆ MiPdeToPte()

FORCEINLINE PMMPTE MiPdeToPte ( PMMPDE  PointerPde)

Definition at line 244 of file mm.h.

245{
246 return (PMMPTE)MiPteToAddress(PointerPde);
247}
#define MiPteToAddress(_Pte)
Definition: mm.h:116

◆ MiPdeToPxe()

FORCEINLINE PMMPXE MiPdeToPxe ( PMMPDE  PointerPde)

Definition at line 300 of file mm.h.

301{
302 return (PMMPXE)MiAddressToPde(PointerPde);
303}

Referenced by MiDeletePde(), and MiMakePdeExistAndMakeValid().

◆ MiPpeToAddress()

FORCEINLINE PVOID MiPpeToAddress ( PMMPTE  PointerPpe)

Definition at line 226 of file mm.h.

227{
228 /* Use signed math */
229 return (PVOID)(((LONG64)PointerPpe << 43) >> 16);
230}

Referenced by MiBuildPfnDatabaseFromPageTables(), MiDeleteVirtualAddresses(), MiPxeToPte(), and MiQueryAddressState().

◆ MiPpeToPte()

FORCEINLINE PMMPTE MiPpeToPte ( PMMPPE  PointerPpe)

Definition at line 252 of file mm.h.

253{
254 return (PMMPTE)MiPdeToAddress(PointerPpe);
255}
#define MiPdeToAddress(_Pde)
Definition: mm.h:117

Referenced by MiCalculatePageCommitment(), and MiIsEntireRangeCommitted().

◆ MiPteToAddress()

FORCEINLINE PVOID MiPteToAddress ( PMMPTE  PointerPte)

Definition at line 208 of file mm.h.

209{
210 /* Use signed math */
211 return (PVOID)(((LONG64)PointerPte << 25) >> 16);
212}

◆ MiPteToPde()

FORCEINLINE PMMPDE MiPteToPde ( PMMPTE  PointerPte)

Definition at line 268 of file mm.h.

269{
270 return (PMMPDE)MiAddressToPte(PointerPte);
271}

◆ MiPteToPpe()

FORCEINLINE PMMPPE MiPteToPpe ( PMMPTE  PointerPte)

Definition at line 276 of file mm.h.

277{
278 return (PMMPPE)MiAddressToPde(PointerPte);
279}

Referenced by MiCalculatePageCommitment(), and MiIsEntireRangeCommitted().

◆ MiPteToPxe()

FORCEINLINE PMMPXE MiPteToPxe ( PMMPTE  PointerPte)

Definition at line 284 of file mm.h.

285{
286 return (PMMPXE)MiAddressToPpe(PointerPte);
287}

Referenced by MiCalculatePageCommitment(), and MiIsEntireRangeCommitted().

◆ MiPxeToAddress()

FORCEINLINE PVOID MiPxeToAddress ( PMMPTE  PointerPxe)

Definition at line 235 of file mm.h.

236{
237 /* Use signed math */
238 return (PVOID)(((LONG64)PointerPxe << 52) >> 16);
239}

Referenced by MiBuildPfnDatabaseFromPageTables(), MiDeleteVirtualAddresses(), and MiQueryAddressState().

◆ MiPxeToPte()

FORCEINLINE PMMPTE MiPxeToPte ( PMMPXE  PointerPxe)

Definition at line 260 of file mm.h.

261{
262 return (PMMPTE)MiPpeToAddress(PointerPxe);
263}
FORCEINLINE PVOID MiPpeToAddress(PMMPTE PointerPpe)
Definition: mm.h:226

Referenced by MiCalculatePageCommitment(), and MiIsEntireRangeCommitted().