diff options
Diffstat (limited to 'arch/x86/include/asm/page.h')
-rw-r--r-- | arch/x86/include/asm/page.h | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/arch/x86/include/asm/page.h b/arch/x86/include/asm/page.h index e9873a2e8695..05f2da7f387a 100644 --- a/arch/x86/include/asm/page.h +++ b/arch/x86/include/asm/page.h | |||
@@ -57,7 +57,6 @@ typedef struct { pgdval_t pgd; } pgd_t; | |||
57 | typedef struct { pgprotval_t pgprot; } pgprot_t; | 57 | typedef struct { pgprotval_t pgprot; } pgprot_t; |
58 | 58 | ||
59 | extern int page_is_ram(unsigned long pagenr); | 59 | extern int page_is_ram(unsigned long pagenr); |
60 | extern int pagerange_is_ram(unsigned long start, unsigned long end); | ||
61 | extern int devmem_is_allowed(unsigned long pagenr); | 60 | extern int devmem_is_allowed(unsigned long pagenr); |
62 | extern void map_devmem(unsigned long pfn, unsigned long size, | 61 | extern void map_devmem(unsigned long pfn, unsigned long size, |
63 | pgprot_t vma_prot); | 62 | pgprot_t vma_prot); |
@@ -95,6 +94,11 @@ static inline pgdval_t native_pgd_val(pgd_t pgd) | |||
95 | return pgd.pgd; | 94 | return pgd.pgd; |
96 | } | 95 | } |
97 | 96 | ||
97 | static inline pgdval_t pgd_flags(pgd_t pgd) | ||
98 | { | ||
99 | return native_pgd_val(pgd) & PTE_FLAGS_MASK; | ||
100 | } | ||
101 | |||
98 | #if PAGETABLE_LEVELS >= 3 | 102 | #if PAGETABLE_LEVELS >= 3 |
99 | #if PAGETABLE_LEVELS == 4 | 103 | #if PAGETABLE_LEVELS == 4 |
100 | typedef struct { pudval_t pud; } pud_t; | 104 | typedef struct { pudval_t pud; } pud_t; |
@@ -117,6 +121,11 @@ static inline pudval_t native_pud_val(pud_t pud) | |||
117 | } | 121 | } |
118 | #endif /* PAGETABLE_LEVELS == 4 */ | 122 | #endif /* PAGETABLE_LEVELS == 4 */ |
119 | 123 | ||
124 | static inline pudval_t pud_flags(pud_t pud) | ||
125 | { | ||
126 | return native_pud_val(pud) & PTE_FLAGS_MASK; | ||
127 | } | ||
128 | |||
120 | typedef struct { pmdval_t pmd; } pmd_t; | 129 | typedef struct { pmdval_t pmd; } pmd_t; |
121 | 130 | ||
122 | static inline pmd_t native_make_pmd(pmdval_t val) | 131 | static inline pmd_t native_make_pmd(pmdval_t val) |
@@ -128,6 +137,7 @@ static inline pmdval_t native_pmd_val(pmd_t pmd) | |||
128 | { | 137 | { |
129 | return pmd.pmd; | 138 | return pmd.pmd; |
130 | } | 139 | } |
140 | |||
131 | #else /* PAGETABLE_LEVELS == 2 */ | 141 | #else /* PAGETABLE_LEVELS == 2 */ |
132 | #include <asm-generic/pgtable-nopmd.h> | 142 | #include <asm-generic/pgtable-nopmd.h> |
133 | 143 | ||
@@ -137,6 +147,11 @@ static inline pmdval_t native_pmd_val(pmd_t pmd) | |||
137 | } | 147 | } |
138 | #endif /* PAGETABLE_LEVELS >= 3 */ | 148 | #endif /* PAGETABLE_LEVELS >= 3 */ |
139 | 149 | ||
150 | static inline pmdval_t pmd_flags(pmd_t pmd) | ||
151 | { | ||
152 | return native_pmd_val(pmd) & PTE_FLAGS_MASK; | ||
153 | } | ||
154 | |||
140 | static inline pte_t native_make_pte(pteval_t val) | 155 | static inline pte_t native_make_pte(pteval_t val) |
141 | { | 156 | { |
142 | return (pte_t) { .pte = val }; | 157 | return (pte_t) { .pte = val }; |
@@ -147,7 +162,7 @@ static inline pteval_t native_pte_val(pte_t pte) | |||
147 | return pte.pte; | 162 | return pte.pte; |
148 | } | 163 | } |
149 | 164 | ||
150 | static inline pteval_t native_pte_flags(pte_t pte) | 165 | static inline pteval_t pte_flags(pte_t pte) |
151 | { | 166 | { |
152 | return native_pte_val(pte) & PTE_FLAGS_MASK; | 167 | return native_pte_val(pte) & PTE_FLAGS_MASK; |
153 | } | 168 | } |
@@ -173,7 +188,6 @@ static inline pteval_t native_pte_flags(pte_t pte) | |||
173 | #endif | 188 | #endif |
174 | 189 | ||
175 | #define pte_val(x) native_pte_val(x) | 190 | #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) | 191 | #define __pte(x) native_make_pte(x) |
178 | 192 | ||
179 | #endif /* CONFIG_PARAVIRT */ | 193 | #endif /* CONFIG_PARAVIRT */ |