1 #ifndef __NTOSKRNL_INCLUDE_INTERNAL_ARM_MM_H
2 #define __NTOSKRNL_INCLUDE_INTERNAL_ARM_MM_H
5 #pragma GCC system_header
9 // Number of bits corresponding to the area that a PDE entry represents (1MB)
12 #define PDE_SIZE (1 << PDE_SHIFT)
15 // Number of bits corresponding to the area that a coarse page table entry represents (4KB)
18 #define PAGE_SIZE (1 << PTE_SHIFT)
21 // Number of bits corresponding to the area that a coarse page table occupies (1KB)
24 #define CPT_SIZE (1 << CPT_SHIFT)
26 typedef union _ARM_PTE
102 ULONG BaseAddress
:22;
106 } ARM_PTE
, *PARM_PTE
;
108 typedef struct _ARM_TRANSLATION_TABLE
111 } ARM_TRANSLATION_TABLE
, *PARM_TRANSLATION_TABLE
;
113 typedef struct _ARM_COARSE_PAGE_TABLE
117 } ARM_COARSE_PAGE_TABLE
, *PARM_COARSE_PAGE_TABLE
;
119 typedef enum _ARM_L1_PTE_TYPE
127 typedef enum _ARM_L2_PTE_TYPE
134 typedef enum _ARM_PTE_ACCESS
142 typedef enum _ARM_DOMAIN
151 // Take 0x80812345 and extract:
152 // PTE_BASE[0x808][0x12]
154 #define MiGetPteAddress(x) \
155 (PMMPTE)(PTE_BASE + \
156 (((ULONG)(x) >> 20) << 12) + \
157 ((((ULONG)(x) >> 12) & 0xFF) << 2))
159 #define MiGetPdeAddress(x) \
160 (PMMPTE)(PDE_BASE + \
161 (((ULONG)(x) >> 20) << 2))
163 #define MiGetPdeOffset(x) (((ULONG)(x)) >> 22)
165 #define PTE_BASE 0xC0000000
166 #define PDE_BASE 0xC1000000
167 #define HYPER_SPACE 0xC1100000
170 PULONG
MmGetPageDirectory(VOID
);