ReactOS  0.4.14-dev-606-g14ebc0b
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_VIEW_END   0xFFFFF97FFF000000ULL
 
#define MI_SESSION_SPACE_END   0xFFFFF97FFFFFFFFFULL
 
#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 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   (16 * _1MB)
 
#define MI_SESSION_VIEW_SIZE   (20 * _1MB)
 
#define MI_SESSION_POOL_SIZE   (16 * _1MB)
 
#define MI_SESSION_IMAGE_SIZE   (8 * _1MB)
 
#define MI_SESSION_WORKING_SET_SIZE   (4 * _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 MiPdeToPte(_Pde)   ((PMMPTE)MiPteToAddress(_Pde))
 
#define MiPteToPde(_Pte)   ((PMMPDE)MiAddressToPte(_Pte))
 
#define MiPdeToPpe(_Pde)   ((PMMPPE)MiAddressToPte(_Pde))
 
#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)((x)->u.Subsect.SubsectionAddress >> 16)
 

Functions

PMMPTE FORCEINLINE _MiAddressToPte (PVOID Address)
 
PMMPTE FORCEINLINE _MiAddressToPde (PVOID Address)
 
PMMPTE FORCEINLINE MiAddressToPpe (PVOID Address)
 
PMMPTE FORCEINLINE MiAddressToPxe (PVOID Address)
 
ULONG FORCEINLINE MiAddressToPti (PVOID Address)
 
ULONG FORCEINLINE MiAddressToPdi (PVOID Address)
 
ULONG FORCEINLINE MiAddressToPxi (PVOID Address)
 
PVOID FORCEINLINE MiPteToAddress (PMMPTE PointerPte)
 
PVOID FORCEINLINE MiPdeToAddress (PMMPTE PointerPde)
 
PVOID FORCEINLINE MiPpeToAddress (PMMPTE PointerPpe)
 
PVOID FORCEINLINE MiPxeToAddress (PMMPTE PointerPxe)
 
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)
 
INIT_FUNCTION VOID FORCEINLINE MmInitGlobalKernelPageDirectory (VOID)
 
BOOLEAN FORCEINLINE 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 68 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 46 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 78 of file mm.h.

◆ MI_IS_INSTRUCTION_FETCH

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

Definition at line 120 of file mm.h.

◆ MI_IS_NOT_PRESENT_FAULT

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

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

◆ MI_IS_PAGE_DIRTY

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

Definition at line 109 of file mm.h.

◆ MI_IS_PAGE_EXECUTABLE

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

Definition at line 108 of file mm.h.

◆ MI_IS_PAGE_LARGE

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

Definition at line 101 of file mm.h.

◆ MI_IS_PAGE_WRITEABLE

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

Definition at line 103 of file mm.h.

◆ MI_IS_WRITE_ACCESS

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

Definition at line 119 of file mm.h.

◆ MI_MAKE_ACCESSED_PAGE

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

Definition at line 97 of file mm.h.

◆ MI_MAKE_CLEAN_PAGE

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

Definition at line 96 of file mm.h.

◆ MI_MAKE_DIRTY_PAGE

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

Definition at line 95 of file mm.h.

◆ MI_MAKE_OWNER_PAGE

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

Definition at line 110 of file mm.h.

◆ MI_MAKE_WRITE_PAGE

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

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

◆ MI_MAPPING_RANGE_START

#define MI_MAPPING_RANGE_START   HYPER_SPACE

Definition at line 44 of file mm.h.

◆ MI_MAX_ALLOCATION_FRAGMENT

#define MI_MAX_ALLOCATION_FRAGMENT   (2 * _1MB)

Definition at line 69 of file mm.h.

◆ MI_MAX_FREE_PAGE_LISTS

#define MI_MAX_FREE_PAGE_LISTS   4

Definition at line 77 of file mm.h.

◆ MI_MAX_INIT_NONPAGED_POOL_SIZE

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

Definition at line 56 of file mm.h.

◆ MI_MAX_NONPAGED_POOL_SIZE

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

Definition at line 57 of file mm.h.

◆ MI_MAX_SECONDARY_COLORS

#define MI_MAX_SECONDARY_COLORS   1024

Definition at line 75 of file mm.h.

◆ MI_MAX_ZERO_BITS

#define MI_MAX_ZERO_BITS   53

Definition at line 80 of file mm.h.

◆ MI_MIN_ALLOCATION_FRAGMENT

#define MI_MIN_ALLOCATION_FRAGMENT   (4 * _1KB)

Definition at line 67 of file mm.h.

◆ MI_MIN_INIT_PAGED_POOLSIZE

#define MI_MIN_INIT_PAGED_POOLSIZE   (32 * _1MB)

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

◆ MI_MIN_PAGES_FOR_SYSPTE_BOOST

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

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

◆ MI_MIN_PAGES_FOR_SYSPTE_TUNING

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

Definition at line 52 of file mm.h.

◆ MI_MIN_SECONDARY_COLORS

#define MI_MIN_SECONDARY_COLORS   8

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

◆ MI_PAGE_DISABLE_CACHE

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

Definition at line 98 of file mm.h.

◆ MI_PAGE_WRITE_COMBINED

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

Definition at line 100 of file mm.h.

◆ MI_PAGE_WRITE_THROUGH

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

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

◆ MI_SESSION_IMAGE_SIZE

#define MI_SESSION_IMAGE_SIZE   (8 * _1MB)

Definition at line 61 of file mm.h.

◆ MI_SESSION_POOL_SIZE

#define MI_SESSION_POOL_SIZE   (16 * _1MB)

Definition at line 60 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:59

Definition at line 63 of file mm.h.

◆ MI_SESSION_SPACE_END

#define MI_SESSION_SPACE_END   0xFFFFF97FFFFFFFFFULL

Definition at line 25 of file mm.h.

◆ MI_SESSION_VIEW_END

#define MI_SESSION_VIEW_END   0xFFFFF97FFF000000ULL

Definition at line 24 of file mm.h.

◆ MI_SESSION_VIEW_SIZE

#define MI_SESSION_VIEW_SIZE   (20 * _1MB)

Definition at line 59 of file mm.h.

◆ MI_SESSION_WORKING_SET_SIZE

#define MI_SESSION_WORKING_SET_SIZE   (4 * _1MB)

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

◆ MI_SYSTEM_VIEW_SIZE

#define MI_SYSTEM_VIEW_SIZE   (16 * _1MB)

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

◆ MI_WORKING_SET_LIST

#define MI_WORKING_SET_LIST   (MI_VAD_BITMAP + PAGE_SIZE)

Definition at line 48 of file mm.h.

◆ MI_WRITE_VALID_PPE

#define MI_WRITE_VALID_PPE   MI_WRITE_VALID_PTE

Definition at line 123 of file mm.h.

◆ MI_ZERO_PTES

#define MI_ZERO_PTES   (32)

Definition at line 79 of file mm.h.

◆ MiAddressToPde

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

Definition at line 146 of file mm.h.

◆ MiAddressToPdeOffset

#define MiAddressToPdeOffset (   x)    MiAddressToPdi(x)

Definition at line 184 of file mm.h.

◆ MiAddressToPte

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

Definition at line 135 of file mm.h.

◆ MiAddressToPteOffset

#define MiAddressToPteOffset (   x)    MiAddressToPti(x)

Definition at line 175 of file mm.h.

◆ MiGetPdeOffset

#define MiGetPdeOffset (   x)    MiAddressToPdi(x)

Definition at line 185 of file mm.h.

◆ MiIsPteOnPdeBoundary

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

Definition at line 237 of file mm.h.

◆ MiIsPteOnPpeBoundary

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

Definition at line 239 of file mm.h.

◆ MiIsPteOnPxeBoundary

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

Definition at line 241 of file mm.h.

◆ MiPdeToPpe

#define MiPdeToPpe (   _Pde)    ((PMMPPE)MiAddressToPte(_Pde))

Definition at line 234 of file mm.h.

◆ MiPdeToPte

#define MiPdeToPte (   _Pde)    ((PMMPTE)MiPteToAddress(_Pde))

Definition at line 232 of file mm.h.

◆ MiProtoPteToPte

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

Definition at line 247 of file mm.h.

◆ MiPteToPde

#define MiPteToPde (   _Pte)    ((PMMPDE)MiAddressToPte(_Pte))

Definition at line 233 of file mm.h.

◆ MiSubsectionPteToSubsection

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

Definition at line 253 of file mm.h.

◆ MM_EMPTY_LIST

#define MM_EMPTY_LIST   ((ULONG_PTR)-1)

Definition at line 85 of file mm.h.

◆ MM_EMPTY_PTE_LIST

#define MM_EMPTY_PTE_LIST   ((ULONG64)0xFFFFFFFF)

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

◆ MM_PTE_SOFTWARE_PROTECTION_BITS

#define MM_PTE_SOFTWARE_PROTECTION_BITS   5

Definition at line 72 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.

◆ PFN_FROM_PDE

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

Definition at line 90 of file mm.h.

◆ PFN_FROM_PPE

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

Definition at line 91 of file mm.h.

◆ PFN_FROM_PTE

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

Definition at line 89 of file mm.h.

◆ PFN_FROM_PXE

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

Definition at line 92 of file mm.h.

◆ SESSION_POOL_LOOKASIDES

#define SESSION_POOL_LOOKASIDES   21

Definition at line 81 of file mm.h.

◆ ValidKernelPpe

#define ValidKernelPpe   ValidKernelPde

Definition at line 124 of file mm.h.

Function Documentation

◆ _MiAddressToPde()

PMMPTE FORCEINLINE _MiAddressToPde ( PVOID  Address)

Definition at line 140 of file mm.h.

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

◆ _MiAddressToPte()

PMMPTE FORCEINLINE _MiAddressToPte ( PVOID  Address)

Definition at line 129 of file mm.h.

130 {
131  ULONG64 Offset = (ULONG64)Address >> (PTI_SHIFT - 3);
132  Offset &= 0xFFFFFFFFFULL << 3;
133  return (PMMPTE)(PTE_BASE + Offset);
134 }
#define PTE_BASE
Definition: mm.h:32
_In_ ULONG _In_ ULONG Offset
Definition: ntddpcm.h:101
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

◆ MI_IS_MAPPED_PTE()

FORCEINLINE BOOLEAN MI_IS_MAPPED_PTE ( PMMPTE  PointerPte)

FIXME

Definition at line 286 of file mm.h.

287 {
289  __debugbreak();
290  return ((PointerPte->u.Long & 0xFFFFFC01) != 0);
291 }
union _MMPTE::@2255 u
void __cdecl __debugbreak(void)
Definition: intrin_ppc.h:698
ULONG_PTR Long
Definition: mmtypes.h:215

Referenced by MiDeleteVirtualAddresses().

◆ MI_MAKE_PROTOTYPE_PTE()

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

Definition at line 272 of file mm.h.

274 {
275  /* Store the Address */
276  NewPte->u.Long = (ULONG64)PointerPte << 16;
277 
278  /* Mark this as a prototype PTE */
279  NewPte->u.Proto.Prototype = 1;
280 
281  ASSERT(MiProtoPteToPte(NewPte) == PointerPte);
282 }
#define MiProtoPteToPte(x)
Definition: mm.h:247
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
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 258 of file mm.h.

261 {
262  /* Mark this as a prototype */
263  NewPte->u.Long = 0;
264  NewPte->u.Subsect.Prototype = 1;
265 
266  /* Store the lower 48 bits of the Segment address */
267  NewPte->u.Subsect.SubsectionAddress = ((ULONG_PTR)Segment & 0x0000FFFFFFFFFFFF);
268 }
_Inout_ PVOID Segment
Definition: exfuncs.h:893
#define ULONG_PTR
Definition: config.h:101

Referenced by MmArmInitSystem().

◆ MiAddressToPdi()

ULONG FORCEINLINE MiAddressToPdi ( PVOID  Address)

Definition at line 180 of file mm.h.

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

◆ MiAddressToPpe()

PMMPTE FORCEINLINE MiAddressToPpe ( PVOID  Address)

Definition at line 151 of file mm.h.

152 {
153  ULONG64 Offset = (ULONG64)Address >> (PPI_SHIFT - 3);
154  Offset &= 0x3FFFF << 3;
155  return (PMMPTE)(PPE_BASE + Offset);
156 }
_In_ ULONG _In_ ULONG Offset
Definition: ntddpcm.h:101
static WCHAR Address[46]
Definition: ping.c:68
#define PPI_SHIFT
#define PPE_BASE
unsigned __int64 ULONG64
Definition: imports.h:198

Referenced by MiBuildPagedPool(), MiBuildPfnDatabaseFromPageTables(), MiGetPteForProcess(), MiIsPdeForAddressValid(), MiLockVirtualMemory(), MiMapPPEs(), MiQueryAddressState(), MiUnlockVirtualMemory(), MmArmAccessFault(), MmArmInitSystem(), MmGetPhysicalAddress(), MmIsAddressValid(), and MmProbeAndLockPages().

◆ MiAddressToPti()

ULONG FORCEINLINE MiAddressToPti ( PVOID  Address)

Definition at line 171 of file mm.h.

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

Referenced by MmCreateProcessAddressSpace().

◆ MiAddressToPxe()

PMMPTE FORCEINLINE MiAddressToPxe ( PVOID  Address)

◆ MiAddressToPxi()

ULONG FORCEINLINE MiAddressToPxi ( PVOID  Address)

Definition at line 190 of file mm.h.

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

Referenced by MmCreateProcessAddressSpace().

◆ MiIsPdeForAddressValid()

BOOLEAN FORCEINLINE MiIsPdeForAddressValid ( PVOID  Address)

Definition at line 303 of file mm.h.

304 {
305  return ((MiAddressToPxe(Address)->u.Hard.Valid) &&
306  (MiAddressToPpe(Address)->u.Hard.Valid) &&
307  (MiAddressToPde(Address)->u.Hard.Valid));
308 }
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
PMMPTE FORCEINLINE MiAddressToPpe(PVOID Address)
Definition: mm.h:151
#define MiAddressToPde(x)
Definition: mm.h:146
static WCHAR Address[46]
Definition: ping.c:68
PMMPTE FORCEINLINE MiAddressToPxe(PVOID Address)
Definition: mm.h:161

◆ MiPdeToAddress()

PVOID FORCEINLINE MiPdeToAddress ( PMMPTE  PointerPde)

Definition at line 207 of file mm.h.

208 {
209  /* Use signed math */
210  return (PVOID)(((LONG64)PointerPde << 34) >> 16);
211 }
int64_t LONG64
Definition: typedefs.h:66

Referenced by MiBuildPfnDatabaseFromPageTables(), and MiQueryAddressState().

◆ MiPpeToAddress()

PVOID FORCEINLINE MiPpeToAddress ( PMMPTE  PointerPpe)

Definition at line 216 of file mm.h.

217 {
218  /* Use signed math */
219  return (PVOID)(((LONG64)PointerPpe << 43) >> 16);
220 }
int64_t LONG64
Definition: typedefs.h:66

Referenced by MiBuildPfnDatabaseFromPageTables(), and MiQueryAddressState().

◆ MiPteToAddress()

◆ MiPxeToAddress()

PVOID FORCEINLINE MiPxeToAddress ( PMMPTE  PointerPxe)

Definition at line 225 of file mm.h.

226 {
227  /* Use signed math */
228  return (PVOID)(((LONG64)PointerPxe << 52) >> 16);
229 }
int64_t LONG64
Definition: typedefs.h:66

Referenced by MiBuildPfnDatabaseFromPageTables(), and MiQueryAddressState().

◆ MmInitGlobalKernelPageDirectory()

INIT_FUNCTION VOID FORCEINLINE MmInitGlobalKernelPageDirectory ( VOID  )

Definition at line 296 of file mm.h.

297 {
298  /* Nothing to do */
299 }

Referenced by MmInitSystem().