Go to the documentation of this file.
20 #ifndef _ASM_PGTABLE_3LEVEL_H
21 #define _ASM_PGTABLE_3LEVEL_H
32 #define PTRS_PER_PTE 512
33 #define PTRS_PER_PMD 512
34 #define PTRS_PER_PGD 4
36 #define PTE_HWTABLE_PTRS (PTRS_PER_PTE)
37 #define PTE_HWTABLE_OFF (0)
38 #define PTE_HWTABLE_SIZE (PTRS_PER_PTE * sizeof(u64))
43 #define PGDIR_SHIFT 30
50 #define PMD_SIZE (1UL << PMD_SHIFT)
51 #define PMD_MASK (~(PMD_SIZE-1))
52 #define PGDIR_SIZE (1UL << PGDIR_SHIFT)
53 #define PGDIR_MASK (~(PGDIR_SIZE-1))
58 #define SECTION_SHIFT 21
59 #define SECTION_SIZE (1UL << SECTION_SHIFT)
60 #define SECTION_MASK (~(SECTION_SIZE-1))
62 #define USER_PTRS_PER_PGD (PAGE_OFFSET / PGDIR_SIZE)
70 #define L_PTE_PRESENT (_AT(pteval_t, 3) << 0)
71 #define L_PTE_FILE (_AT(pteval_t, 1) << 2)
72 #define L_PTE_USER (_AT(pteval_t, 1) << 6)
73 #define L_PTE_RDONLY (_AT(pteval_t, 1) << 7)
74 #define L_PTE_SHARED (_AT(pteval_t, 3) << 8)
75 #define L_PTE_YOUNG (_AT(pteval_t, 1) << 10)
76 #define L_PTE_XN (_AT(pteval_t, 1) << 54)
77 #define L_PTE_DIRTY (_AT(pteval_t, 1) << 55)
78 #define L_PTE_SPECIAL (_AT(pteval_t, 1) << 56)
83 #define L_PTE_XN_HIGH (1 << (54 - 32))
84 #define L_PTE_DIRTY_HIGH (1 << (55 - 32))
89 #define L_PTE_MT_UNCACHED (_AT(pteval_t, 0) << 2)
90 #define L_PTE_MT_BUFFERABLE (_AT(pteval_t, 1) << 2)
91 #define L_PTE_MT_WRITETHROUGH (_AT(pteval_t, 2) << 2)
92 #define L_PTE_MT_WRITEBACK (_AT(pteval_t, 3) << 2)
93 #define L_PTE_MT_WRITEALLOC (_AT(pteval_t, 7) << 2)
94 #define L_PTE_MT_DEV_SHARED (_AT(pteval_t, 4) << 2)
95 #define L_PTE_MT_DEV_NONSHARED (_AT(pteval_t, 4) << 2)
96 #define L_PTE_MT_DEV_WC (_AT(pteval_t, 1) << 2)
97 #define L_PTE_MT_DEV_CACHED (_AT(pteval_t, 3) << 2)
98 #define L_PTE_MT_MASK (_AT(pteval_t, 7) << 2)
103 #define L_PGD_SWAPPER (_AT(pgdval_t, 1) << 55)
107 #define pud_none(pud) (!pud_val(pud))
108 #define pud_bad(pud) (!(pud_val(pud) & 2))
109 #define pud_present(pud) (pud_val(pud))
111 #define pud_clear(pudp) \
114 clean_pmd_entry(pudp); \
117 #define set_pud(pudp, pud) \
120 flush_pmd_entry(pudp); \
129 #define pmd_index(addr) (((addr) >> PMD_SHIFT) & (PTRS_PER_PMD - 1))
135 #define pmd_bad(pmd) (!(pmd_val(pmd) & 2))
137 #define copy_pmd(pmdpd,pmdps) \
140 flush_pmd_entry(pmdpd); \
143 #define pmd_clear(pmdp) \
146 clean_pmd_entry(pmdp); \
149 #define set_pte_ext(ptep,pte,ext) cpu_set_pte_ext(ptep,__pte(pte_val(pte)|(ext)))