diff options
author | Jeremy Fitzhardinge <jeremy@goop.org> | 2008-03-17 19:37:04 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-04-24 17:57:31 -0400 |
commit | f9fbf1a36a6bb6a639459802bccee01185ee3220 (patch) | |
tree | 9f8280c8c4dbb93902ef611a0975acd282cae57b | |
parent | ee5aa8d3ba65d76157f22b7afedd089d8acfe524 (diff) |
x86/pgtable.h: demacro ptep_test_and_clear_young
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.c | 15 | ||||
-rw-r--r-- | include/asm-x86/pgtable.h | 11 |
2 files changed, 17 insertions, 9 deletions
diff --git a/arch/x86/mm/pgtable.c b/arch/x86/mm/pgtable.c index e7cda2057e1d..54bd77a7eee0 100644 --- a/arch/x86/mm/pgtable.c +++ b/arch/x86/mm/pgtable.c | |||
@@ -280,3 +280,18 @@ int ptep_set_access_flags(struct vm_area_struct *vma, | |||
280 | 280 | ||
281 | return changed; | 281 | return changed; |
282 | } | 282 | } |
283 | |||
284 | int ptep_test_and_clear_young(struct vm_area_struct *vma, | ||
285 | unsigned long addr, pte_t *ptep) | ||
286 | { | ||
287 | int ret = 0; | ||
288 | |||
289 | if (pte_young(*ptep)) | ||
290 | ret = test_and_clear_bit(_PAGE_BIT_ACCESSED, | ||
291 | &ptep->pte); | ||
292 | |||
293 | if (ret) | ||
294 | pte_update(vma->vm_mm, addr, ptep); | ||
295 | |||
296 | return ret; | ||
297 | } | ||
diff --git a/include/asm-x86/pgtable.h b/include/asm-x86/pgtable.h index feddddc2d97b..676408c98631 100644 --- a/include/asm-x86/pgtable.h +++ b/include/asm-x86/pgtable.h | |||
@@ -394,15 +394,8 @@ extern int ptep_set_access_flags(struct vm_area_struct *vma, | |||
394 | pte_t entry, int dirty); | 394 | pte_t entry, int dirty); |
395 | 395 | ||
396 | #define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG | 396 | #define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG |
397 | #define ptep_test_and_clear_young(vma, addr, ptep) ({ \ | 397 | extern int ptep_test_and_clear_young(struct vm_area_struct *vma, |
398 | int __ret = 0; \ | 398 | unsigned long addr, pte_t *ptep); |
399 | if (pte_young(*(ptep))) \ | ||
400 | __ret = test_and_clear_bit(_PAGE_BIT_ACCESSED, \ | ||
401 | &(ptep)->pte); \ | ||
402 | if (__ret) \ | ||
403 | pte_update((vma)->vm_mm, addr, ptep); \ | ||
404 | __ret; \ | ||
405 | }) | ||
406 | 399 | ||
407 | #define __HAVE_ARCH_PTEP_CLEAR_YOUNG_FLUSH | 400 | #define __HAVE_ARCH_PTEP_CLEAR_YOUNG_FLUSH |
408 | #define ptep_clear_flush_young(vma, address, ptep) \ | 401 | #define ptep_clear_flush_young(vma, address, ptep) \ |