/** PAE pagetable entries are 64 bits wide. */
#define PAE_PTE_SZ 8
+/** PAE pagetables encode 9 bits of index. */
+#define PAE_PT_ORDER 9
+
/** @{ */
/** All PAE pagetables contain 512 entries. */
#define PAE_L1_PT_ENTRIES (PAGE_SIZE / PAE_PTE_SZ)
/** PSE pagetable entries are 32 bits wide. */
#define PSE_PTE_SZ 4
+/** PAE pagetables encode 10 bits of index. */
+#define PSE_PT_ORDER 10
+
/** @{ */
/** All PSE pagetables contain 1024 entries. */
#define PSE_L1_PT_ENTRIES (PAGE_SIZE / PSE_PTE_SZ)
#define PAGE_ORDER_4K 0
#define PAGE_ORDER_2M 9
+#define PAGE_ORDER_4M 10
#define PAGE_ORDER_1G 18
#define _PAGE_PRESENT 0x0001
#if CONFIG_PAGING_LEVELS == 2 /* PSE Paging */
+#define PT_ORDER PSE_PT_ORDER
+
#define L1_PT_SHIFT PSE_L1_PT_SHIFT
#define L2_PT_SHIFT PSE_L2_PT_SHIFT
+#define L1_PT_ENTRIES PSE_L1_PT_ENTRIES
+#define L2_PT_ENTRIES PSE_L2_PT_ENTRIES
+
#else /* CONFIG_PAGING_LEVELS == 2 */ /* PAE Paging */
+#define PT_ORDER PAE_PT_ORDER
+
#define L1_PT_SHIFT PAE_L1_PT_SHIFT
#define L2_PT_SHIFT PAE_L2_PT_SHIFT
+#define L1_PT_ENTRIES PAE_L1_PT_ENTRIES
+#define L2_PT_ENTRIES PAE_L2_PT_ENTRIES
+
#endif /* !CONFIG_PAGING_LEVELS == 2 */
#if CONFIG_PAGING_LEVELS >= 3 /* PAE Paging */
#define L3_PT_SHIFT PAE_L3_PT_SHIFT
+#define L3_PT_ENTRIES PAE_L3_PT_ENTRIES
+
#endif /* CONFIG_PAGING_LEVELS >= 3 */
#if CONFIG_PAGING_LEVELS >= 4 /* PAE Paging */
#define L4_PT_SHIFT PAE_L4_PT_SHIFT
+#define L4_PT_ENTRIES PAE_L4_PT_ENTRIES
+
#endif /* CONFIG_PAGING_LEVELS >= 4 */