diff options
Diffstat (limited to 'arch/x86/include/asm/page.h')
-rw-r--r-- | arch/x86/include/asm/page.h | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/arch/x86/include/asm/page.h b/arch/x86/include/asm/page.h index e9873a2e8695..40226999cbf8 100644 --- a/arch/x86/include/asm/page.h +++ b/arch/x86/include/asm/page.h | |||
@@ -95,6 +95,11 @@ static inline pgdval_t native_pgd_val(pgd_t pgd) | |||
95 | return pgd.pgd; | 95 | return pgd.pgd; |
96 | } | 96 | } |
97 | 97 | ||
98 | static inline pgdval_t pgd_flags(pgd_t pgd) | ||
99 | { | ||
100 | return native_pgd_val(pgd) & PTE_FLAGS_MASK; | ||
101 | } | ||
102 | |||
98 | #if PAGETABLE_LEVELS >= 3 | 103 | #if PAGETABLE_LEVELS >= 3 |
99 | #if PAGETABLE_LEVELS == 4 | 104 | #if PAGETABLE_LEVELS == 4 |
100 | typedef struct { pudval_t pud; } pud_t; | 105 | typedef struct { pudval_t pud; } pud_t; |
@@ -117,6 +122,11 @@ static inline pudval_t native_pud_val(pud_t pud) | |||
117 | } | 122 | } |
118 | #endif /* PAGETABLE_LEVELS == 4 */ | 123 | #endif /* PAGETABLE_LEVELS == 4 */ |
119 | 124 | ||
125 | static inline pudval_t pud_flags(pud_t pud) | ||
126 | { | ||
127 | return native_pud_val(pud) & PTE_FLAGS_MASK; | ||
128 | } | ||
129 | |||
120 | typedef struct { pmdval_t pmd; } pmd_t; | 130 | typedef struct { pmdval_t pmd; } pmd_t; |
121 | 131 | ||
122 | static inline pmd_t native_make_pmd(pmdval_t val) | 132 | static inline pmd_t native_make_pmd(pmdval_t val) |
@@ -128,6 +138,7 @@ static inline pmdval_t native_pmd_val(pmd_t pmd) | |||
128 | { | 138 | { |
129 | return pmd.pmd; | 139 | return pmd.pmd; |
130 | } | 140 | } |
141 | |||
131 | #else /* PAGETABLE_LEVELS == 2 */ | 142 | #else /* PAGETABLE_LEVELS == 2 */ |
132 | #include <asm-generic/pgtable-nopmd.h> | 143 | #include <asm-generic/pgtable-nopmd.h> |
133 | 144 | ||
@@ -137,6 +148,11 @@ static inline pmdval_t native_pmd_val(pmd_t pmd) | |||
137 | } | 148 | } |
138 | #endif /* PAGETABLE_LEVELS >= 3 */ | 149 | #endif /* PAGETABLE_LEVELS >= 3 */ |
139 | 150 | ||
151 | static inline pmdval_t pmd_flags(pmd_t pmd) | ||
152 | { | ||
153 | return native_pmd_val(pmd) & PTE_FLAGS_MASK; | ||
154 | } | ||
155 | |||
140 | static inline pte_t native_make_pte(pteval_t val) | 156 | static inline pte_t native_make_pte(pteval_t val) |
141 | { | 157 | { |
142 | return (pte_t) { .pte = val }; | 158 | return (pte_t) { .pte = val }; |
@@ -147,7 +163,7 @@ static inline pteval_t native_pte_val(pte_t pte) | |||
147 | return pte.pte; | 163 | return pte.pte; |
148 | } | 164 | } |
149 | 165 | ||
150 | static inline pteval_t native_pte_flags(pte_t pte) | 166 | static inline pteval_t pte_flags(pte_t pte) |
151 | { | 167 | { |
152 | return native_pte_val(pte) & PTE_FLAGS_MASK; | 168 | return native_pte_val(pte) & PTE_FLAGS_MASK; |
153 | } | 169 | } |
@@ -173,7 +189,6 @@ static inline pteval_t native_pte_flags(pte_t pte) | |||
173 | #endif | 189 | #endif |
174 | 190 | ||
175 | #define pte_val(x) native_pte_val(x) | 191 | #define pte_val(x) native_pte_val(x) |
176 | #define pte_flags(x) native_pte_flags(x) | ||
177 | #define __pte(x) native_make_pte(x) | 192 | #define __pte(x) native_make_pte(x) |
178 | 193 | ||
179 | #endif /* CONFIG_PARAVIRT */ | 194 | #endif /* CONFIG_PARAVIRT */ |