aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremy Fitzhardinge <jeremy@goop.org>2008-03-17 19:37:03 -0400
committerIngo Molnar <mingo@elte.hu>2008-04-24 17:57:31 -0400
commitee5aa8d3ba65d76157f22b7afedd089d8acfe524 (patch)
treebddbec4ffd9508c3bd7afaeebc15b28226022b6d
parent2761fa0920756dc471d297843646a4a9bca6656f (diff)
x86/pgtable.h: demacro ptep_set_access_flags
Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-rw-r--r--arch/x86/mm/pgtable.c16
-rw-r--r--include/asm-x86/pgtable.h13
2 files changed, 19 insertions, 10 deletions
diff --git a/arch/x86/mm/pgtable.c b/arch/x86/mm/pgtable.c
index 5accc08683c7..e7cda2057e1d 100644
--- a/arch/x86/mm/pgtable.c
+++ b/arch/x86/mm/pgtable.c
@@ -1,5 +1,6 @@
1#include <linux/mm.h> 1#include <linux/mm.h>
2#include <asm/pgalloc.h> 2#include <asm/pgalloc.h>
3#include <asm/pgtable.h>
3#include <asm/tlb.h> 4#include <asm/tlb.h>
4 5
5pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address) 6pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address)
@@ -264,3 +265,18 @@ void pgd_free(struct mm_struct *mm, pgd_t *pgd)
264 free_page((unsigned long)pgd); 265 free_page((unsigned long)pgd);
265} 266}
266#endif 267#endif
268
269int ptep_set_access_flags(struct vm_area_struct *vma,
270 unsigned long address, pte_t *ptep,
271 pte_t entry, int dirty)
272{
273 int changed = !pte_same(*ptep, entry);
274
275 if (changed && dirty) {
276 *ptep = entry;
277 pte_update_defer(vma->vm_mm, address, ptep);
278 flush_tlb_page(vma, address);
279 }
280
281 return changed;
282}
diff --git a/include/asm-x86/pgtable.h b/include/asm-x86/pgtable.h
index f1d9f4a03f6f..feddddc2d97b 100644
--- a/include/asm-x86/pgtable.h
+++ b/include/asm-x86/pgtable.h
@@ -389,16 +389,9 @@ static inline void native_set_pte_at(struct mm_struct *mm, unsigned long addr,
389 * bit at the same time. 389 * bit at the same time.
390 */ 390 */
391#define __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS 391#define __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS
392#define ptep_set_access_flags(vma, address, ptep, entry, dirty) \ 392extern int ptep_set_access_flags(struct vm_area_struct *vma,
393({ \ 393 unsigned long address, pte_t *ptep,
394 int __changed = !pte_same(*(ptep), entry); \ 394 pte_t entry, int dirty);
395 if (__changed && dirty) { \
396 *ptep = entry; \
397 pte_update_defer((vma)->vm_mm, (address), (ptep)); \
398 flush_tlb_page(vma, address); \
399 } \
400 __changed; \
401})
402 395
403#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG 396#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG
404#define ptep_test_and_clear_young(vma, addr, ptep) ({ \ 397#define ptep_test_and_clear_young(vma, addr, ptep) ({ \