1 #ifndef __NTOSKRNL_INCLUDE_INTERNAL_ARM_MM_H
2 #define __NTOSKRNL_INCLUDE_INTERNAL_ARM_MM_H
5 // Number of bits corresponding to the area that a PDE entry represents (1MB)
8 #define PDE_SIZE (1 << PDE_SHIFT)
11 // Number of bits corresponding to the area that a coarse page table entry represents (4KB)
14 //#define PAGE_SIZE (1 << PTE_SHIFT) // FIXME: This conflicts with ndk/arm/mmtypes.h which does #define PAGE_SIZE 0x1000 -- use PTE_SIZE here instead?
17 // Number of bits corresponding to the area that a coarse page table occupies (1KB)
20 #define CPT_SIZE (1 << CPT_SHIFT)
22 typedef union _ARM_PTE
102 } ARM_PTE
, *PARM_PTE
;
104 typedef struct _ARM_TRANSLATION_TABLE
107 } ARM_TRANSLATION_TABLE
, *PARM_TRANSLATION_TABLE
;
109 typedef struct _ARM_COARSE_PAGE_TABLE
113 } ARM_COARSE_PAGE_TABLE
, *PARM_COARSE_PAGE_TABLE
;
115 typedef enum _ARM_L1_PTE_TYPE
123 typedef enum _ARM_L2_PTE_TYPE
130 typedef enum _ARM_PTE_ACCESS
138 typedef enum _ARM_DOMAIN
147 // Take 0x80812345 and extract:
148 // PTE_BASE[0x808][0x12]
150 #define MiGetPteAddress(x) \
151 (PMMPTE)(PTE_BASE + \
152 (((ULONG)(x) >> 20) << 12) + \
153 ((((ULONG)(x) >> 12) & 0xFF) << 2))
155 #define MiGetPdeAddress(x) \
156 (PMMPTE)(PDE_BASE + \
157 (((ULONG)(x) >> 20) << 2))
159 #define MiGetPdeOffset(x) (((ULONG)(x)) >> 22)
161 #define PTE_BASE 0xC0000000
162 #define PDE_BASE 0xC1000000
163 #define HYPER_SPACE 0xC1100000
166 PULONG
MmGetPageDirectory(VOID
);