diff options
author | Jeremy Fitzhardinge <jeremy@goop.org> | 2008-01-30 07:32:57 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-01-30 07:32:57 -0500 |
commit | 6fdc05d4794056e0b98901646c4b68c60a01d5eb (patch) | |
tree | a6cfb308becd6fe47c549084b29c3e9db3a07f68 /include/asm-x86/pgtable_64.h | |
parent | c3bcfb57e1e64b9b2f8b2d90564826637e21c5ea (diff) |
x86: unify pgtable accessors which use
Make users of supported_pte_mask common. This has the side-effect of
introducing the variable for 32-bit non-PAE, but I think its a pretty
small cost to simplify the code.
Signed-off-by: Jeremy Fitzhardinge <jeremy@xensource.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'include/asm-x86/pgtable_64.h')
-rw-r--r-- | include/asm-x86/pgtable_64.h | 18 |
1 files changed, 0 insertions, 18 deletions
diff --git a/include/asm-x86/pgtable_64.h b/include/asm-x86/pgtable_64.h index 84f47f9d7896..57e4ebe0f7fc 100644 --- a/include/asm-x86/pgtable_64.h +++ b/include/asm-x86/pgtable_64.h | |||
@@ -17,7 +17,6 @@ extern pud_t level3_kernel_pgt[512]; | |||
17 | extern pud_t level3_ident_pgt[512]; | 17 | extern pud_t level3_ident_pgt[512]; |
18 | extern pmd_t level2_kernel_pgt[512]; | 18 | extern pmd_t level2_kernel_pgt[512]; |
19 | extern pgd_t init_level4_pgt[]; | 19 | extern pgd_t init_level4_pgt[]; |
20 | extern unsigned long __supported_pte_mask; | ||
21 | 20 | ||
22 | #define swapper_pg_dir init_level4_pgt | 21 | #define swapper_pg_dir init_level4_pgt |
23 | 22 | ||
@@ -165,14 +164,6 @@ static inline unsigned long pmd_bad(pmd_t pmd) | |||
165 | #define pte_page(x) pfn_to_page(pte_pfn(x)) | 164 | #define pte_page(x) pfn_to_page(pte_pfn(x)) |
166 | #define pte_pfn(x) ((pte_val(x) & __PHYSICAL_MASK) >> PAGE_SHIFT) | 165 | #define pte_pfn(x) ((pte_val(x) & __PHYSICAL_MASK) >> PAGE_SHIFT) |
167 | 166 | ||
168 | static inline pte_t pfn_pte(unsigned long page_nr, pgprot_t pgprot) | ||
169 | { | ||
170 | pte_t pte; | ||
171 | pte_val(pte) = (page_nr << PAGE_SHIFT); | ||
172 | pte_val(pte) |= pgprot_val(pgprot); | ||
173 | pte_val(pte) &= __supported_pte_mask; | ||
174 | return pte; | ||
175 | } | ||
176 | struct vm_area_struct; | 167 | struct vm_area_struct; |
177 | 168 | ||
178 | static inline int ptep_test_and_clear_young(struct vm_area_struct *vma, unsigned long addr, pte_t *ptep) | 169 | static inline int ptep_test_and_clear_young(struct vm_area_struct *vma, unsigned long addr, pte_t *ptep) |
@@ -239,15 +230,6 @@ static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long addr, | |||
239 | /* page, protection -> pte */ | 230 | /* page, protection -> pte */ |
240 | #define mk_pte(page, pgprot) pfn_pte(page_to_pfn(page), (pgprot)) | 231 | #define mk_pte(page, pgprot) pfn_pte(page_to_pfn(page), (pgprot)) |
241 | 232 | ||
242 | /* Change flags of a PTE */ | ||
243 | static inline pte_t pte_modify(pte_t pte, pgprot_t newprot) | ||
244 | { | ||
245 | pte_val(pte) &= _PAGE_CHG_MASK; | ||
246 | pte_val(pte) |= pgprot_val(newprot); | ||
247 | pte_val(pte) &= __supported_pte_mask; | ||
248 | return pte; | ||
249 | } | ||
250 | |||
251 | #define pte_index(address) \ | 233 | #define pte_index(address) \ |
252 | (((address) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1)) | 234 | (((address) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1)) |
253 | #define pte_offset_kernel(dir, address) ((pte_t *) pmd_page_vaddr(*(dir)) + \ | 235 | #define pte_offset_kernel(dir, address) ((pte_t *) pmd_page_vaddr(*(dir)) + \ |