diff options
author | Jeremy Fitzhardinge <jeremy@goop.org> | 2008-01-30 13:32:57 +0100 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-01-30 13:32:57 +0100 |
commit | 6fdc05d4794056e0b98901646c4b68c60a01d5eb (patch) | |
tree | a6cfb308becd6fe47c549084b29c3e9db3a07f68 /include/asm-x86/pgtable.h | |
parent | c3bcfb57e1e64b9b2f8b2d90564826637e21c5ea (diff) | |
download | linux-6fdc05d4794056e0b98901646c4b68c60a01d5eb.tar.gz linux-6fdc05d4794056e0b98901646c4b68c60a01d5eb.tar.bz2 linux-6fdc05d4794056e0b98901646c4b68c60a01d5eb.zip |
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.h | 14 |
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 static inline pte_t pte_mkhuge(pte_t pte) { return __pte(pte_val(pte) | _PAGE_PSE); } static inline pte_t pte_clrhuge(pte_t pte) { return __pte(pte_val(pte) & ~_PAGE_PSE); } +extern pteval_t __supported_pte_mask; + +static inline pte_t pfn_pte(unsigned long page_nr, pgprot_t pgprot) +{ + return __pte((((phys_addr_t)page_nr << PAGE_SHIFT) | + pgprot_val(pgprot)) & __supported_pte_mask); +} + +static inline pmd_t pfn_pmd(unsigned long page_nr, pgprot_t pgprot) +{ + return __pmd((((phys_addr_t)page_nr << PAGE_SHIFT) | + pgprot_val(pgprot)) & __supported_pte_mask); +} + #endif /* __ASSEMBLY__ */ #ifdef CONFIG_X86_32 |