diff options
author | Ingo Molnar <mingo@elte.hu> | 2008-01-30 07:32:57 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-01-30 07:32:57 -0500 |
commit | 38472311679d8784c2934d071ddda23d9b3fe264 (patch) | |
tree | 3d37cfad15dc767dfb7033b9366e09dd24bbef53 /include/asm-x86/pgtable.h | |
parent | 6fdc05d4794056e0b98901646c4b68c60a01d5eb (diff) |
x86: unify pgtable accessors which use, #2
based on:
Subject: x86: unify pgtable accessors which use supported_pte_mask
From: Jeremy Fitzhardinge <jeremy@goop.org>
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 | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/include/asm-x86/pgtable.h b/include/asm-x86/pgtable.h index b29a122fc1ff..6452286e71a1 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) | |||
155 | pgprot_val(pgprot)) & __supported_pte_mask); | 155 | pgprot_val(pgprot)) & __supported_pte_mask); |
156 | } | 156 | } |
157 | 157 | ||
158 | static inline pte_t pte_modify(pte_t pte, pgprot_t newprot) | ||
159 | { | ||
160 | pteval_t val = pte_val(pte); | ||
161 | |||
162 | /* | ||
163 | * Chop off the NX bit (if present), and add the NX portion of | ||
164 | * the newprot (if present): | ||
165 | */ | ||
166 | val &= _PAGE_CHG_MASK & ~_PAGE_NX; | ||
167 | val |= pgprot_val(newprot) & __supported_pte_mask; | ||
168 | |||
169 | return __pte(val); | ||
170 | } | ||
171 | |||
172 | |||
158 | #endif /* __ASSEMBLY__ */ | 173 | #endif /* __ASSEMBLY__ */ |
159 | 174 | ||
160 | #ifdef CONFIG_X86_32 | 175 | #ifdef CONFIG_X86_32 |