• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /****************************************************************************
2  ****************************************************************************
3  ***
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.
9  ***
10  ****************************************************************************
11  ****************************************************************************/
12 #ifndef _ASM_GENERIC_PGTABLE_H
13 #define _ASM_GENERIC_PGTABLE_H
14 
15 #ifndef __HAVE_ARCH_PTEP_ESTABLISH
16 
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)
19 #else
20 #define ptep_establish(__vma, __address, __ptep, __entry)  do {   set_pte_atomic(__ptep, __entry);   flush_tlb_page(__vma, __address);  } while (0)
21 #endif
22 #endif
23 
24 #ifndef __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS
25 
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)
27 #endif
28 
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;  })
31 #endif
32 
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;  })
35 #endif
36 
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;  })
39 #endif
40 
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;  })
43 #endif
44 
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;  })
47 #endif
48 
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;  })
51 #endif
52 
53 #ifndef __HAVE_ARCH_PTE_CLEAR_FULL
54 #define pte_clear_full(__mm, __address, __ptep, __full)  do {   pte_clear((__mm), (__address), (__ptep));  } while (0)
55 #endif
56 
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;  })
59 #endif
60 
61 #ifndef __HAVE_ARCH_PTEP_SET_WRPROTECT
62 struct mm_struct;
63 #endif
64 #ifndef __HAVE_ARCH_PTE_SAME
65 #define pte_same(A,B) (pte_val(A) == pte_val(B))
66 #endif
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)
70 #else
71 #define pte_maybe_dirty(pte) (1)
72 #endif
73 #ifndef __HAVE_ARCH_PAGE_TEST_AND_CLEAR_YOUNG
74 #define page_test_and_clear_young(page) (0)
75 #endif
76 #ifndef __HAVE_ARCH_PGD_OFFSET_GATE
77 #define pgd_offset_gate(mm, addr) pgd_offset(mm, addr)
78 #endif
79 #ifndef __HAVE_ARCH_LAZY_MMU_PROT_UPDATE
80 #define lazy_mmu_prot_update(pte) do { } while (0)
81 #endif
82 #ifndef __HAVE_ARCH_MOVE_PTE
83 #define move_pte(pte, prot, old_addr, new_addr) (pte)
84 #endif
85 #define pgd_addr_end(addr, end)  ({ unsigned long __boundary = ((addr) + PGDIR_SIZE) & PGDIR_MASK;   (__boundary - 1 < (end) - 1)? __boundary: (end);  })
86 #ifndef pud_addr_end
87 #define pud_addr_end(addr, end)  ({ unsigned long __boundary = ((addr) + PUD_SIZE) & PUD_MASK;   (__boundary - 1 < (end) - 1)? __boundary: (end);  })
88 #endif
89 #ifndef pmd_addr_end
90 #define pmd_addr_end(addr, end)  ({ unsigned long __boundary = ((addr) + PMD_SIZE) & PMD_MASK;   (__boundary - 1 < (end) - 1)? __boundary: (end);  })
91 #endif
92 #ifndef __ASSEMBLY__
93 
94 #endif
95 #endif
96