Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ee5aa8d3 authored by Jeremy Fitzhardinge's avatar Jeremy Fitzhardinge Committed by Ingo Molnar
Browse files

x86/pgtable.h: demacro ptep_set_access_flags

parent 2761fa09
Loading
Loading
Loading
Loading
+16 −0
Original line number Original line Diff line number Diff line
#include <linux/mm.h>
#include <linux/mm.h>
#include <asm/pgalloc.h>
#include <asm/pgalloc.h>
#include <asm/pgtable.h>
#include <asm/tlb.h>
#include <asm/tlb.h>


pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address)
pte_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)
	free_page((unsigned long)pgd);
	free_page((unsigned long)pgd);
}
}
#endif
#endif

int ptep_set_access_flags(struct vm_area_struct *vma,
			  unsigned long address, pte_t *ptep,
			  pte_t entry, int dirty)
{
	int changed = !pte_same(*ptep, entry);

	if (changed && dirty) {
		*ptep = entry;
		pte_update_defer(vma->vm_mm, address, ptep);
		flush_tlb_page(vma, address);
	}

	return changed;
}
+3 −10
Original line number Original line Diff line number Diff line
@@ -389,16 +389,9 @@ static inline void native_set_pte_at(struct mm_struct *mm, unsigned long addr,
 * bit at the same time.
 * bit at the same time.
 */
 */
#define  __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS
#define  __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS
#define ptep_set_access_flags(vma, address, ptep, entry, dirty)		\
extern int ptep_set_access_flags(struct vm_area_struct *vma,
({									\
				 unsigned long address, pte_t *ptep,
	int __changed = !pte_same(*(ptep), entry);			\
				 pte_t entry, int dirty);
	if (__changed && dirty) {					\
		*ptep = entry;						\
		pte_update_defer((vma)->vm_mm, (address), (ptep));	\
		flush_tlb_page(vma, address);				\
	}								\
	__changed;							\
})


#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG
#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG
#define ptep_test_and_clear_young(vma, addr, ptep) ({			\
#define ptep_test_and_clear_young(vma, addr, ptep) ({			\