[PATCH 4 of 5] x86/pgtable.h: demacro ptep_test_and_clear_young

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Ingo Molnar <mingo@...>
Cc: LKML <linux-kernel@...>, Andi Kleen <ak@...>, Jan Beulich <jbeulich@...>, Eduardo Pereira Habkost <ehabkost@...>, Ian Campbell <ijc@...>, H Peter Anvin <hpa@...>, Zach Amsden <zach@...>
Date: Friday, February 1, 2008 - 7:25 pm

Signed-off-by: Jeremy Fitzhardinge <jeremy@xensource.com>
---
 include/asm-x86/pgtable.h |   20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/include/asm-x86/pgtable.h b/include/asm-x86/pgtable.h
--- a/include/asm-x86/pgtable.h
+++ b/include/asm-x86/pgtable.h
@@ -311,15 +311,17 @@
 }
 
 #define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG
-#define ptep_test_and_clear_young(vma, addr, ptep) ({			\
-	int __ret = 0;							\
-	if (pte_young(*(ptep)))						\
-		__ret = test_and_clear_bit(_PAGE_BIT_ACCESSED,		\
-					   &(ptep)->pte);		\
-	if (__ret)							\
-		pte_update((vma)->vm_mm, addr, ptep);			\
-	__ret;								\
-})
+static inline int ptep_test_and_clear_young(struct vm_area_struct *vma,
+					    unsigned long addr, pte_t *ptep)
+{
+	int ret = 0;
+	if (pte_young(*ptep))
+		ret = test_and_clear_bit(_PAGE_BIT_ACCESSED,
+					 &ptep->pte);
+	if (ret)
+		pte_update(vma->vm_mm, addr, ptep);
+	return ret;
+}
 
 #define __HAVE_ARCH_PTEP_CLEAR_YOUNG_FLUSH
 #define ptep_clear_flush_young(vma, address, ptep)			\


--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 0 of 5] x86: add alloc/release_pud; more demacroing, Jeremy Fitzhardinge, (Fri Feb 1, 7:25 pm)
[PATCH 1 of 5] x86: rename paravirt_alloc_pt etc after the p..., Jeremy Fitzhardinge, (Fri Feb 1, 7:25 pm)
[PATCH 5 of 5] x86/pgtable.h: demacro ptep_clear_flush_young, Jeremy Fitzhardinge, (Fri Feb 1, 7:25 pm)
[PATCH 4 of 5] x86/pgtable.h: demacro ptep_test_and_clear_yo..., Jeremy Fitzhardinge, (Fri Feb 1, 7:25 pm)
[PATCH 2 of 5] x86: add pud_alloc for 4-level pagetables, Jeremy Fitzhardinge, (Fri Feb 1, 7:25 pm)
[PATCH 3 of 5] x86/pgtable.h: demacro ptep_set_access_flags, Jeremy Fitzhardinge, (Fri Feb 1, 7:25 pm)
Re: [PATCH 3 of 5] x86/pgtable.h: demacro ptep_set_access_fl..., Jeremy Fitzhardinge, (Sat Feb 2, 6:20 am)