aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-i386/pgtable.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-i386/pgtable.h')
-rw-r--r--include/asm-i386/pgtable.h34
1 files changed, 19 insertions, 15 deletions
diff --git a/include/asm-i386/pgtable.h b/include/asm-i386/pgtable.h
index 2394589786ba..628fa7747d0c 100644
--- a/include/asm-i386/pgtable.h
+++ b/include/asm-i386/pgtable.h
@@ -285,32 +285,36 @@ static inline pte_t native_local_ptep_get_and_clear(pte_t *ptep)
285 */ 285 */
286#define __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS 286#define __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS
287#define ptep_set_access_flags(vma, address, ptep, entry, dirty) \ 287#define ptep_set_access_flags(vma, address, ptep, entry, dirty) \
288do { \ 288({ \
289 if (dirty) { \ 289 int __changed = !pte_same(*(ptep), entry); \
290 if (__changed && dirty) { \
290 (ptep)->pte_low = (entry).pte_low; \ 291 (ptep)->pte_low = (entry).pte_low; \
291 pte_update_defer((vma)->vm_mm, (address), (ptep)); \ 292 pte_update_defer((vma)->vm_mm, (address), (ptep)); \
292 flush_tlb_page(vma, address); \ 293 flush_tlb_page(vma, address); \
293 } \ 294 } \
294} while (0) 295 __changed; \
296})
295 297
296#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_DIRTY 298#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_DIRTY
297#define ptep_test_and_clear_dirty(vma, addr, ptep) ({ \ 299#define ptep_test_and_clear_dirty(vma, addr, ptep) ({ \
298 int ret = 0; \ 300 int __ret = 0; \
299 if (pte_dirty(*ptep)) \ 301 if (pte_dirty(*(ptep))) \
300 ret = test_and_clear_bit(_PAGE_BIT_DIRTY, &ptep->pte_low); \ 302 __ret = test_and_clear_bit(_PAGE_BIT_DIRTY, \
301 if (ret) \ 303 &(ptep)->pte_low); \
302 pte_update_defer(vma->vm_mm, addr, ptep); \ 304 if (__ret) \
303 ret; \ 305 pte_update((vma)->vm_mm, addr, ptep); \
306 __ret; \
304}) 307})
305 308
306#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG 309#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG
307#define ptep_test_and_clear_young(vma, addr, ptep) ({ \ 310#define ptep_test_and_clear_young(vma, addr, ptep) ({ \
308 int ret = 0; \ 311 int __ret = 0; \
309 if (pte_young(*ptep)) \ 312 if (pte_young(*(ptep))) \
310 ret = test_and_clear_bit(_PAGE_BIT_ACCESSED, &ptep->pte_low); \ 313 __ret = test_and_clear_bit(_PAGE_BIT_ACCESSED, \
311 if (ret) \ 314 &(ptep)->pte_low); \
312 pte_update_defer(vma->vm_mm, addr, ptep); \ 315 if (__ret) \
313 ret; \ 316 pte_update((vma)->vm_mm, addr, ptep); \
317 __ret; \
314}) 318})
315 319
316/* 320/*