1 /****************************************************************************
2 ****************************************************************************
4 *** This header was automatically generated from a Linux kernel header
5 *** of the same name, to make information necessary for userspace to
6 *** call into the kernel available to libc. It contains only constants,
7 *** structures, and macros generated from the original header, and thus,
8 *** contains no copyrightable information.
10 ****************************************************************************
11 ****************************************************************************/
12 #ifndef _ASM_GENERIC_PGTABLE_H
13 #define _ASM_GENERIC_PGTABLE_H
15 #ifndef __HAVE_ARCH_PTEP_ESTABLISH
17 #ifndef __HAVE_ARCH_SET_PTE_ATOMIC
18 #define ptep_establish(__vma, __address, __ptep, __entry) do { set_pte_at((__vma)->vm_mm, (__address), __ptep, __entry); flush_tlb_page(__vma, __address); } while (0)
20 #define ptep_establish(__vma, __address, __ptep, __entry) do { set_pte_atomic(__ptep, __entry); flush_tlb_page(__vma, __address); } while (0)
24 #ifndef __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS
26 #define ptep_set_access_flags(__vma, __address, __ptep, __entry, __dirty) do { set_pte_at((__vma)->vm_mm, (__address), __ptep, __entry); flush_tlb_page(__vma, __address); } while (0)
29 #ifndef __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG
30 #define ptep_test_and_clear_young(__vma, __address, __ptep) ({ pte_t __pte = *(__ptep); int r = 1; if (!pte_young(__pte)) r = 0; else set_pte_at((__vma)->vm_mm, (__address), (__ptep), pte_mkold(__pte)); r; })
33 #ifndef __HAVE_ARCH_PTEP_CLEAR_YOUNG_FLUSH
34 #define ptep_clear_flush_young(__vma, __address, __ptep) ({ int __young; __young = ptep_test_and_clear_young(__vma, __address, __ptep); if (__young) flush_tlb_page(__vma, __address); __young; })
37 #ifndef __HAVE_ARCH_PTEP_TEST_AND_CLEAR_DIRTY
38 #define ptep_test_and_clear_dirty(__vma, __address, __ptep) ({ pte_t __pte = *__ptep; int r = 1; if (!pte_dirty(__pte)) r = 0; else set_pte_at((__vma)->vm_mm, (__address), (__ptep), pte_mkclean(__pte)); r; })
41 #ifndef __HAVE_ARCH_PTEP_CLEAR_DIRTY_FLUSH
42 #define ptep_clear_flush_dirty(__vma, __address, __ptep) ({ int __dirty; __dirty = ptep_test_and_clear_dirty(__vma, __address, __ptep); if (__dirty) flush_tlb_page(__vma, __address); __dirty; })
45 #ifndef __HAVE_ARCH_PTEP_GET_AND_CLEAR
46 #define ptep_get_and_clear(__mm, __address, __ptep) ({ pte_t __pte = *(__ptep); pte_clear((__mm), (__address), (__ptep)); __pte; })
49 #ifndef __HAVE_ARCH_PTEP_GET_AND_CLEAR_FULL
50 #define ptep_get_and_clear_full(__mm, __address, __ptep, __full) ({ pte_t __pte; __pte = ptep_get_and_clear((__mm), (__address), (__ptep)); __pte; })
53 #ifndef __HAVE_ARCH_PTE_CLEAR_FULL
54 #define pte_clear_full(__mm, __address, __ptep, __full) do { pte_clear((__mm), (__address), (__ptep)); } while (0)
57 #ifndef __HAVE_ARCH_PTEP_CLEAR_FLUSH
58 #define ptep_clear_flush(__vma, __address, __ptep) ({ pte_t __pte; __pte = ptep_get_and_clear((__vma)->vm_mm, __address, __ptep); flush_tlb_page(__vma, __address); __pte; })
61 #ifndef __HAVE_ARCH_PTEP_SET_WRPROTECT
64 #ifndef __HAVE_ARCH_PTE_SAME
65 #define pte_same(A,B) (pte_val(A) == pte_val(B))
67 #ifndef __HAVE_ARCH_PAGE_TEST_AND_CLEAR_DIRTY
68 #define page_test_and_clear_dirty(page) (0)
69 #define pte_maybe_dirty(pte) pte_dirty(pte)
71 #define pte_maybe_dirty(pte) (1)
73 #ifndef __HAVE_ARCH_PAGE_TEST_AND_CLEAR_YOUNG
74 #define page_test_and_clear_young(page) (0)
76 #ifndef __HAVE_ARCH_PGD_OFFSET_GATE
77 #define pgd_offset_gate(mm, addr) pgd_offset(mm, addr)
79 #ifndef __HAVE_ARCH_LAZY_MMU_PROT_UPDATE
80 #define lazy_mmu_prot_update(pte) do { } while (0)
82 #ifndef __HAVE_ARCH_MOVE_PTE
83 #define move_pte(pte, prot, old_addr, new_addr) (pte)
85 #define pgd_addr_end(addr, end) ({ unsigned long __boundary = ((addr) + PGDIR_SIZE) & PGDIR_MASK; (__boundary - 1 < (end) - 1)? __boundary: (end); })
87 #define pud_addr_end(addr, end) ({ unsigned long __boundary = ((addr) + PUD_SIZE) & PUD_MASK; (__boundary - 1 < (end) - 1)? __boundary: (end); })
90 #define pmd_addr_end(addr, end) ({ unsigned long __boundary = ((addr) + PMD_SIZE) & PMD_MASK; (__boundary - 1 < (end) - 1)? __boundary: (end); })