Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=38472311679d8784c2934d071ddda23d9b3fe264 Commit: 38472311679d8784c2934d071ddda23d9b3fe264 Parent: 6fdc05d4794056e0b98901646c4b68c60a01d5eb Author: Ingo Molnar <[EMAIL PROTECTED]> AuthorDate: Wed Jan 30 13:32:57 2008 +0100 Committer: Ingo Molnar <[EMAIL PROTECTED]> CommitDate: Wed Jan 30 13:32:57 2008 +0100
x86: unify pgtable accessors which use, #2 based on: Subject: x86: unify pgtable accessors which use supported_pte_mask From: Jeremy Fitzhardinge <[EMAIL PROTECTED]> Signed-off-by: Ingo Molnar <[EMAIL PROTECTED]> Signed-off-by: Thomas Gleixner <[EMAIL PROTECTED]> --- include/asm-x86/pgtable.h | 15 +++++++++++++++ include/asm-x86/pgtable_32.h | 16 ---------------- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/include/asm-x86/pgtable.h b/include/asm-x86/pgtable.h index b29a122..6452286 100644 --- a/include/asm-x86/pgtable.h +++ b/include/asm-x86/pgtable.h @@ -155,6 +155,21 @@ static inline pmd_t pfn_pmd(unsigned long page_nr, pgprot_t pgprot) pgprot_val(pgprot)) & __supported_pte_mask); } +static inline pte_t pte_modify(pte_t pte, pgprot_t newprot) +{ + pteval_t val = pte_val(pte); + + /* + * Chop off the NX bit (if present), and add the NX portion of + * the newprot (if present): + */ + val &= _PAGE_CHG_MASK & ~_PAGE_NX; + val |= pgprot_val(newprot) & __supported_pte_mask; + + return __pte(val); +} + + #endif /* __ASSEMBLY__ */ #ifdef CONFIG_X86_32 diff --git a/include/asm-x86/pgtable_32.h b/include/asm-x86/pgtable_32.h index 0aaefdd..109dad5 100644 --- a/include/asm-x86/pgtable_32.h +++ b/include/asm-x86/pgtable_32.h @@ -235,22 +235,6 @@ static inline void clone_pgd_range(pgd_t *dst, pgd_t *src, int count) #define mk_pte(page, pgprot) pfn_pte(page_to_pfn(page), (pgprot)) -static inline pte_t pte_modify(pte_t pte, pgprot_t newprot) -{ - pte.pte_low &= _PAGE_CHG_MASK; - pte.pte_low |= pgprot_val(newprot); -#ifdef CONFIG_X86_PAE - /* - * Chop off the NX bit (if present), and add the NX portion of - * the newprot (if present): - */ - pte.pte_high &= ~(1 << (_PAGE_BIT_NX - 32)); - pte.pte_high |= (pgprot_val(newprot) >> 32) & \ - (__supported_pte_mask >> 32); -#endif - return pte; -} - /* * the pgd page can be thought of an array like this: pgd_t[PTRS_PER_PGD] * - To unsubscribe from this list: send the line "unsubscribe git-commits-head" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html