1 #ifndef _ASM_GENERIC_PGTABLE_H
2 #define _ASM_GENERIC_PGTABLE_H
10 #ifndef __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS
16 #ifndef __HAVE_ARCH_PMDP_SET_ACCESS_FLAGS
22 #ifndef __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG
37 #ifndef __HAVE_ARCH_PMDP_TEST_AND_CLEAR_YOUNG
38 #ifdef CONFIG_TRANSPARENT_HUGEPAGE
40 unsigned long address,
53 unsigned long address,
62 #ifndef __HAVE_ARCH_PTEP_CLEAR_YOUNG_FLUSH
64 unsigned long address,
pte_t *ptep);
67 #ifndef __HAVE_ARCH_PMDP_CLEAR_YOUNG_FLUSH
69 unsigned long address,
pmd_t *pmdp);
72 #ifndef __HAVE_ARCH_PTEP_GET_AND_CLEAR
74 unsigned long address,
83 #ifndef __HAVE_ARCH_PMDP_GET_AND_CLEAR
84 #ifdef CONFIG_TRANSPARENT_HUGEPAGE
86 unsigned long address,
96 #ifndef __HAVE_ARCH_PTEP_GET_AND_CLEAR_FULL
98 unsigned long address,
pte_t *ptep,
112 #ifndef __HAVE_ARCH_PTE_CLEAR_NOT_PRESENT_FULL
114 unsigned long address,
122 #ifndef __HAVE_ARCH_PTEP_CLEAR_FLUSH
124 unsigned long address,
128 #ifndef __HAVE_ARCH_PMDP_CLEAR_FLUSH
130 unsigned long address,
134 #ifndef __HAVE_ARCH_PTEP_SET_WRPROTECT
138 pte_t old_pte = *ptep;
143 #ifndef __HAVE_ARCH_PMDP_SET_WRPROTECT
144 #ifdef CONFIG_TRANSPARENT_HUGEPAGE
145 static inline void pmdp_set_wrprotect(
struct mm_struct *mm,
146 unsigned long address,
pmd_t *pmdp)
148 pmd_t old_pmd = *pmdp;
152 static inline void pmdp_set_wrprotect(
struct mm_struct *mm,
153 unsigned long address,
pmd_t *pmdp)
160 #ifndef __HAVE_ARCH_PMDP_SPLITTING_FLUSH
162 unsigned long address,
pmd_t *pmdp);
165 #ifndef __HAVE_ARCH_PGTABLE_DEPOSIT
169 #ifndef __HAVE_ARCH_PGTABLE_WITHDRAW
173 #ifndef __HAVE_ARCH_PMDP_INVALIDATE
174 extern void pmdp_invalidate(
struct vm_area_struct *vma,
unsigned long address,
178 #ifndef __HAVE_ARCH_PTE_SAME
185 #ifndef __HAVE_ARCH_PMD_SAME
186 #ifdef CONFIG_TRANSPARENT_HUGEPAGE
187 static inline int pmd_same(
pmd_t pmd_a,
pmd_t pmd_b)
192 static inline int pmd_same(
pmd_t pmd_a,
pmd_t pmd_b)
200 #ifndef __HAVE_ARCH_PAGE_TEST_AND_CLEAR_DIRTY
201 #define page_test_and_clear_dirty(pfn, mapped) (0)
204 #ifndef __HAVE_ARCH_PAGE_TEST_AND_CLEAR_DIRTY
205 #define pte_maybe_dirty(pte) pte_dirty(pte)
207 #define pte_maybe_dirty(pte) (1)
210 #ifndef __HAVE_ARCH_PAGE_TEST_AND_CLEAR_YOUNG
211 #define page_test_and_clear_young(pfn) (0)
214 #ifndef __HAVE_ARCH_PGD_OFFSET_GATE
215 #define pgd_offset_gate(mm, addr) pgd_offset(mm, addr)
218 #ifndef __HAVE_ARCH_MOVE_PTE
219 #define move_pte(pte, prot, old_addr, new_addr) (pte)
222 #ifndef flush_tlb_fix_spurious_fault
223 #define flush_tlb_fix_spurious_fault(vma, address) flush_tlb_page(vma, address)
226 #ifndef pgprot_noncached
227 #define pgprot_noncached(prot) (prot)
230 #ifndef pgprot_writecombine
231 #define pgprot_writecombine pgprot_noncached
240 #define pgd_addr_end(addr, end) \
241 ({ unsigned long __boundary = ((addr) + PGDIR_SIZE) & PGDIR_MASK; \
242 (__boundary - 1 < (end) - 1)? __boundary: (end); \
246 #define pud_addr_end(addr, end) \
247 ({ unsigned long __boundary = ((addr) + PUD_SIZE) & PUD_MASK; \
248 (__boundary - 1 < (end) - 1)? __boundary: (end); \
253 #define pmd_addr_end(addr, end) \
254 ({ unsigned long __boundary = ((addr) + PMD_SIZE) & PMD_MASK; \
255 (__boundary - 1 < (end) - 1)? __boundary: (end); \
268 static inline int pgd_none_or_clear_bad(
pgd_t *
pgd)
279 static inline int pud_none_or_clear_bad(
pud_t *pud)
290 static inline int pmd_none_or_clear_bad(
pmd_t *pmd)
301 static inline pte_t __ptep_modify_prot_start(
struct mm_struct *mm,
313 static inline void __ptep_modify_prot_commit(
struct mm_struct *mm,
324 #ifndef __HAVE_ARCH_PTEP_MODIFY_PROT_TRANSACTION
343 return __ptep_modify_prot_start(mm, addr, ptep);
350 static inline void ptep_modify_prot_commit(
struct mm_struct *mm,
354 __ptep_modify_prot_commit(mm, addr, ptep, pte);
374 #ifndef __HAVE_ARCH_ENTER_LAZY_MMU_MODE
375 #define arch_enter_lazy_mmu_mode() do {} while (0)
376 #define arch_leave_lazy_mmu_mode() do {} while (0)
377 #define arch_flush_lazy_mmu_mode() do {} while (0)
391 #ifndef __HAVE_ARCH_START_CONTEXT_SWITCH
392 #define arch_start_context_switch(prev) do {} while (0)
395 #ifndef __HAVE_PFNMAP_TRACKING
407 unsigned long pfn,
unsigned long addr,
438 unsigned long pfn,
unsigned long size)
443 unsigned long pfn,
unsigned long addr,
454 #ifndef CONFIG_TRANSPARENT_HUGEPAGE
455 static inline int pmd_trans_huge(
pmd_t pmd)
459 static inline int pmd_trans_splitting(
pmd_t pmd)
463 #ifndef __HAVE_ARCH_PMD_WRITE
472 #ifndef pmd_read_atomic
505 static inline int pmd_none_or_trans_huge_or_clear_bad(
pmd_t *pmd)
522 #ifdef CONFIG_TRANSPARENT_HUGEPAGE
528 if (!pmd_trans_huge(pmdval))
548 static inline int pmd_trans_unstable(
pmd_t *pmd)
550 #ifdef CONFIG_TRANSPARENT_HUGEPAGE
551 return pmd_none_or_trans_huge_or_clear_bad(pmd);