aboutsummaryrefslogtreecommitdiffstats
path: root/arch/um/include/asm/pgtable.h
diff options
context:
space:
mode:
Diffstat (limited to 'arch/um/include/asm/pgtable.h')
-rw-r--r--arch/um/include/asm/pgtable.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/arch/um/include/asm/pgtable.h b/arch/um/include/asm/pgtable.h
index 6a3f9845743e..5888f1b83477 100644
--- a/arch/um/include/asm/pgtable.h
+++ b/arch/um/include/asm/pgtable.h
@@ -273,6 +273,12 @@ static inline void set_pte(pte_t *pteptr, pte_t pteval)
273} 273}
274#define set_pte_at(mm,addr,ptep,pteval) set_pte(ptep,pteval) 274#define set_pte_at(mm,addr,ptep,pteval) set_pte(ptep,pteval)
275 275
276#define __HAVE_ARCH_PTE_SAME
277static inline int pte_same(pte_t pte_a, pte_t pte_b)
278{
279 return !((pte_val(pte_a) ^ pte_val(pte_b)) & ~_PAGE_NEWPAGE);
280}
281
276/* 282/*
277 * Conversion functions: convert a page and protection to a page entry, 283 * Conversion functions: convert a page and protection to a page entry,
278 * and a page entry and page directory to the page they refer to. 284 * and a page entry and page directory to the page they refer to.
@@ -348,11 +354,11 @@ extern pte_t *virt_to_pte(struct mm_struct *mm, unsigned long addr);
348#define update_mmu_cache(vma,address,ptep) do ; while (0) 354#define update_mmu_cache(vma,address,ptep) do ; while (0)
349 355
350/* Encode and de-code a swap entry */ 356/* Encode and de-code a swap entry */
351#define __swp_type(x) (((x).val >> 4) & 0x3f) 357#define __swp_type(x) (((x).val >> 5) & 0x1f)
352#define __swp_offset(x) ((x).val >> 11) 358#define __swp_offset(x) ((x).val >> 11)
353 359
354#define __swp_entry(type, offset) \ 360#define __swp_entry(type, offset) \
355 ((swp_entry_t) { ((type) << 4) | ((offset) << 11) }) 361 ((swp_entry_t) { ((type) << 5) | ((offset) << 11) })
356#define __pte_to_swp_entry(pte) \ 362#define __pte_to_swp_entry(pte) \
357 ((swp_entry_t) { pte_val(pte_mkuptodate(pte)) }) 363 ((swp_entry_t) { pte_val(pte_mkuptodate(pte)) })
358#define __swp_entry_to_pte(x) ((pte_t) { (x).val }) 364#define __swp_entry_to_pte(x) ((pte_t) { (x).val })