aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-x86/pgtable.h
diff options
context:
space:
mode:
authorJeremy Fitzhardinge <jeremy@goop.org>2008-01-30 07:32:57 -0500
committerIngo Molnar <mingo@elte.hu>2008-01-30 07:32:57 -0500
commit6fdc05d4794056e0b98901646c4b68c60a01d5eb (patch)
treea6cfb308becd6fe47c549084b29c3e9db3a07f68 /include/asm-x86/pgtable.h
parentc3bcfb57e1e64b9b2f8b2d90564826637e21c5ea (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.h')
-rw-r--r--include/asm-x86/pgtable.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/asm-x86/pgtable.h b/include/asm-x86/pgtable.h
index 4c03ff2246fd..b29a122fc1ff 100644
--- a/include/asm-x86/pgtable.h
+++ b/include/asm-x86/pgtable.h
@@ -141,6 +141,20 @@ static inline pte_t pte_mkwrite(pte_t pte) { return __pte(pte_val(pte) | _PAGE_R
141static inline pte_t pte_mkhuge(pte_t pte) { return __pte(pte_val(pte) | _PAGE_PSE); } 141static inline pte_t pte_mkhuge(pte_t pte) { return __pte(pte_val(pte) | _PAGE_PSE); }
142static inline pte_t pte_clrhuge(pte_t pte) { return __pte(pte_val(pte) & ~_PAGE_PSE); } 142static inline pte_t pte_clrhuge(pte_t pte) { return __pte(pte_val(pte) & ~_PAGE_PSE); }
143 143
144extern pteval_t __supported_pte_mask;
145
146static inline pte_t pfn_pte(unsigned long page_nr, pgprot_t pgprot)
147{
148 return __pte((((phys_addr_t)page_nr << PAGE_SHIFT) |
149 pgprot_val(pgprot)) & __supported_pte_mask);
150}
151
152static inline pmd_t pfn_pmd(unsigned long page_nr, pgprot_t pgprot)
153{
154 return __pmd((((phys_addr_t)page_nr << PAGE_SHIFT) |
155 pgprot_val(pgprot)) & __supported_pte_mask);
156}
157
144#endif /* __ASSEMBLY__ */ 158#endif /* __ASSEMBLY__ */
145 159
146#ifdef CONFIG_X86_32 160#ifdef CONFIG_X86_32