ReactOS  0.4.15-dev-3163-gf17c2c0
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   (104 * _1MB)
 
#define MI_SESSION_VIEW_SIZE   (104 * _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, 0x1)
 
#define MI_IS_WRITE_ACCESS(FaultCode)   BooleanFlagOn(FaultCode, 0x2)
 
#define MI_IS_INSTRUCTION_FETCH(FaultCode)   BooleanFlagOn(FaultCode, 0x10)
 
#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, 0x10)

Definition at line 123 of file mm.h.

◆ MI_IS_NOT_PRESENT_FAULT

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

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, 0x2)

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:
MI_SESSION_POOL_SIZE + \
MI_SESSION_IMAGE_SIZE + \
MI_SESSION_WORKING_SET_SIZE)
#define MI_SESSION_VIEW_SIZE
Definition: mm.h:62

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   (104 * _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   (104 * _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 126 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 149 of file mm.h.

◆ MiAddressToPdeOffset

#define MiAddressToPdeOffset (   x)    MiAddressToPdi(x)

Definition at line 187 of file mm.h.

◆ MiAddressToPte

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

Definition at line 138 of file mm.h.

◆ MiAddressToPteOffset

#define MiAddressToPteOffset (   x)    MiAddressToPti(x)

Definition at line 178 of file mm.h.

◆ MiGetPdeOffset

#define MiGetPdeOffset (   x)    MiAddressToPdi(x)

Definition at line 188 of file mm.h.

◆ MiIsPteOnPdeBoundary

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

Definition at line 299 of file mm.h.

◆ MiIsPteOnPpeBoundary

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

Definition at line 301 of file mm.h.

◆ MiIsPteOnPxeBoundary

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

Definition at line 303 of file mm.h.

◆ MiProtoPteToPte

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

Definition at line 309 of file mm.h.

◆ MiSubsectionPteToSubsection

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

Definition at line 316 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 127 of file mm.h.

Function Documentation

◆ _MiAddressToPde()

FORCEINLINE PMMPTE _MiAddressToPde ( PVOID  Address)

Definition at line 143 of file mm.h.

144 {
145  ULONG64 Offset = (ULONG64)Address >> (PDI_SHIFT - 3);
146  Offset &= 0x7FFFFFF << 3;
147  return (PMMPTE)(PDE_BASE + Offset);
148 }
#define PDE_BASE
Definition: mm.h:160
#define PDI_SHIFT
static WCHAR Address[46]
Definition: ping.c:68
unsigned __int64 ULONG64
Definition: imports.h:198
_In_ ULONG _In_ ULONG Offset
Definition: ntddpcm.h:101

◆ _MiAddressToPte()

FORCEINLINE PMMPTE _MiAddressToPte ( PVOID  Address)

Definition at line 132 of file mm.h.

133 {
134  ULONG64 Offset = (ULONG64)Address >> (PTI_SHIFT - 3);
135  Offset &= 0xFFFFFFFFFULL << 3;
136  return (PMMPTE)(PTE_BASE + Offset);
137 }
#define PTE_BASE
Definition: mm.h:153
static WCHAR Address[46]
Definition: ping.c:68
#define PTI_SHIFT
#define ULL(a, b)
Definition: format_msg.c:27
unsigned __int64 ULONG64
Definition: imports.h:198
_In_ ULONG _In_ ULONG Offset
Definition: ntddpcm.h:101

◆ MI_IS_MAPPED_PTE()

FORCEINLINE BOOLEAN MI_IS_MAPPED_PTE ( PMMPTE  PointerPte)

Definition at line 349 of file mm.h.

350 {
351  return ((PointerPte->u.Hard.Valid != 0) ||
352  (PointerPte->u.Proto.Prototype != 0) ||
353  (PointerPte->u.Trans.Transition != 0) ||
354  (PointerPte->u.Hard.PageFrameNumber != 0));
355 }
union _MMPTE::@2274 u
ULONG64 Transition
Definition: mmtypes.h:105
MMPTE_TRANSITION Trans
Definition: mmtypes.h:220
ULONG64 Valid
Definition: mmtypes.h:150
MMPTE_HARDWARE Hard
Definition: mmtypes.h:217
ULONG64 Prototype
Definition: mmtypes.h:121
ULONG64 PageFrameNumber
Definition: mmtypes.h:171
MMPTE_PROTOTYPE Proto
Definition: mmtypes.h:218

Referenced by MiDeleteVirtualAddresses().

◆ MI_MAKE_PROTOTYPE_PTE()

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

Definition at line 335 of file mm.h.

337 {
338  /* Store the Address */
339  NewPte->u.Long = (ULONG64)PointerPte << 16;
340 
341  /* Mark this as a prototype PTE */
342  NewPte->u.Proto.Prototype = 1;
343 
344  ASSERT(MiProtoPteToPte(NewPte) == PointerPte);
345 }
#define MiProtoPteToPte(x)
Definition: mm.h:309
#define ASSERT(a)
Definition: mode.c:44
unsigned __int64 ULONG64
Definition: imports.h:198

Referenced by MiAddMappedPtes(), and MmArmInitSystem().

◆ MI_MAKE_SUBSECTION_PTE()

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

Definition at line 321 of file mm.h.

324 {
325  /* Mark this as a prototype */
326  NewPte->u.Long = 0;
327  NewPte->u.Subsect.Prototype = 1;
328 
329  /* Store the lower 48 bits of the Segment address */
330  NewPte->u.Subsect.SubsectionAddress = ((ULONG_PTR)Segment & 0x0000FFFFFFFFFFFF);
331 }
_Inout_ PVOID Segment
Definition: exfuncs.h:1101
#define ULONG_PTR
Definition: config.h:101

Referenced by MmArmInitSystem().

◆ MiAddressToPdi()

FORCEINLINE ULONG MiAddressToPdi ( PVOID  Address)

Definition at line 183 of file mm.h.

184 {
185  return ((((ULONG64)Address) >> PDI_SHIFT) & 0x1FF);
186 }
#define PDI_SHIFT
static WCHAR Address[46]
Definition: ping.c:68
unsigned __int64 ULONG64
Definition: imports.h:198

◆ MiAddressToPpe()

◆ MiAddressToPti()

FORCEINLINE ULONG MiAddressToPti ( PVOID  Address)

Definition at line 174 of file mm.h.

175 {
176  return ((((ULONG64)Address) >> PTI_SHIFT) & 0x1FF);
177 }
static WCHAR Address[46]
Definition: ping.c:68
#define PTI_SHIFT
unsigned __int64 ULONG64
Definition: imports.h:198

Referenced by MiArchCreateProcessAddressSpace().

◆ MiAddressToPxe()

◆ MiAddressToPxi()

FORCEINLINE ULONG MiAddressToPxi ( PVOID  Address)

Definition at line 193 of file mm.h.

194 {
195  return ((((ULONG64)Address) >> PXI_SHIFT) & 0x1FF);
196 }
static WCHAR Address[46]
Definition: ping.c:68
#define PXI_SHIFT
unsigned __int64 ULONG64
Definition: imports.h:198

Referenced by MiArchCreateProcessAddressSpace().

◆ MiIsPdeForAddressValid()

FORCEINLINE BOOLEAN MiIsPdeForAddressValid ( PVOID  Address)

Definition at line 359 of file mm.h.

360 {
361  return ((MiAddressToPxe(Address)->u.Hard.Valid) &&
362  (MiAddressToPpe(Address)->u.Hard.Valid) &&
363  (MiAddressToPde(Address)->u.Hard.Valid));
364 }
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:154
#define MiAddressToPde(x)
Definition: mm.h:149
static WCHAR Address[46]
Definition: ping.c:68
FORCEINLINE PMMPTE MiAddressToPxe(PVOID Address)
Definition: mm.h:164

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

◆ MiPdeToAddress()

FORCEINLINE PVOID MiPdeToAddress ( PMMPTE  PointerPde)

Definition at line 210 of file mm.h.

211 {
212  /* Use signed math */
213  return (PVOID)(((LONG64)PointerPde << 34) >> 16);
214 }
int64_t LONG64
Definition: typedefs.h:68

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

◆ MiPdeToPpe()

FORCEINLINE PMMPDE MiPdeToPpe ( PMMPDE  PointerPde)

Definition at line 285 of file mm.h.

286 {
287  return (PMMPPE)MiAddressToPte(PointerPde);
288 }
#define MiAddressToPte(x)
Definition: mm.h:138

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

◆ MiPdeToPte()

FORCEINLINE PMMPTE MiPdeToPte ( PMMPDE  PointerPde)

Definition at line 237 of file mm.h.

238 {
239  return (PMMPTE)MiPteToAddress(PointerPde);
240 }
FORCEINLINE PVOID MiPteToAddress(PMMPTE PointerPte)
Definition: mm.h:201

Referenced by MiAllocatePoolPages(), MiCalculatePageCommitment(), MiDeletePde(), and MiIsEntireRangeCommitted().

◆ MiPdeToPxe()

FORCEINLINE PMMPXE MiPdeToPxe ( PMMPDE  PointerPde)

Definition at line 293 of file mm.h.

294 {
295  return (PMMPXE)MiAddressToPde(PointerPde);
296 }
#define MiAddressToPde(x)
Definition: mm.h:149

Referenced by MiDeletePde(), and MiMakePdeExistAndMakeValid().

◆ MiPpeToAddress()

FORCEINLINE PVOID MiPpeToAddress ( PMMPTE  PointerPpe)

Definition at line 219 of file mm.h.

220 {
221  /* Use signed math */
222  return (PVOID)(((LONG64)PointerPpe << 43) >> 16);
223 }
int64_t LONG64
Definition: typedefs.h:68

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

◆ MiPpeToPte()

FORCEINLINE PMMPTE MiPpeToPte ( PMMPPE  PointerPpe)

Definition at line 245 of file mm.h.

246 {
247  return (PMMPTE)MiPdeToAddress(PointerPpe);
248 }
FORCEINLINE PVOID MiPdeToAddress(PMMPTE PointerPde)
Definition: mm.h:210

Referenced by MiCalculatePageCommitment(), and MiIsEntireRangeCommitted().

◆ MiPteToAddress()

◆ MiPteToPde()

◆ MiPteToPpe()

FORCEINLINE PMMPPE MiPteToPpe ( PMMPTE  PointerPte)

Definition at line 269 of file mm.h.

270 {
271  return (PMMPPE)MiAddressToPde(PointerPte);
272 }
#define MiAddressToPde(x)
Definition: mm.h:149

Referenced by MiCalculatePageCommitment(), and MiIsEntireRangeCommitted().

◆ MiPteToPxe()

FORCEINLINE PMMPXE MiPteToPxe ( PMMPTE  PointerPte)

Definition at line 277 of file mm.h.

278 {
279  return (PMMPXE)MiAddressToPpe(PointerPte);
280 }
FORCEINLINE PMMPTE MiAddressToPpe(PVOID Address)
Definition: mm.h:154

Referenced by MiCalculatePageCommitment(), and MiIsEntireRangeCommitted().

◆ MiPxeToAddress()

FORCEINLINE PVOID MiPxeToAddress ( PMMPTE  PointerPxe)

Definition at line 228 of file mm.h.

229 {
230  /* Use signed math */
231  return (PVOID)(((LONG64)PointerPxe << 52) >> 16);
232 }
int64_t LONG64
Definition: typedefs.h:68

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

◆ MiPxeToPte()

FORCEINLINE PMMPTE MiPxeToPte ( PMMPXE  PointerPxe)

Definition at line 253 of file mm.h.

254 {
255  return (PMMPTE)MiPpeToAddress(PointerPxe);
256 }
FORCEINLINE PVOID MiPpeToAddress(PMMPTE PointerPpe)
Definition: mm.h:219

Referenced by MiCalculatePageCommitment(), and MiIsEntireRangeCommitted().