1 #ifndef _ASM_POWERPC_HUGETLB_H
2 #define _ASM_POWERPC_HUGETLB_H
6 pte_t
*huge_pte_offset_and_shift(struct mm_struct
*mm
,
7 unsigned long addr
, unsigned *shift
);
9 void flush_dcache_icache_hugepage(struct page
*page
);
11 int is_hugepage_only_range(struct mm_struct
*mm
, unsigned long addr
,
14 void hugetlb_free_pgd_range(struct mmu_gather
*tlb
, unsigned long addr
,
15 unsigned long end
, unsigned long floor
,
16 unsigned long ceiling
);
19 * The version of vma_mmu_pagesize() in arch/powerpc/mm/hugetlbpage.c needs
20 * to override the version in mm/hugetlb.c
22 #define vma_mmu_pagesize vma_mmu_pagesize
25 * If the arch doesn't supply something else, assume that hugepage
26 * size aligned regions are ok without further preparation.
28 static inline int prepare_hugepage_range(struct file
*file
,
29 unsigned long addr
, unsigned long len
)
31 struct hstate
*h
= hstate_file(file
);
32 if (len
& ~huge_page_mask(h
))
34 if (addr
& ~huge_page_mask(h
))
39 static inline void hugetlb_prefault_arch_hook(struct mm_struct
*mm
)
44 static inline void set_huge_pte_at(struct mm_struct
*mm
, unsigned long addr
,
45 pte_t
*ptep
, pte_t pte
)
47 set_pte_at(mm
, addr
, ptep
, pte
);
50 static inline pte_t
huge_ptep_get_and_clear(struct mm_struct
*mm
,
51 unsigned long addr
, pte_t
*ptep
)
53 unsigned long old
= pte_update(mm
, addr
, ptep
, ~0UL, 1);
57 static inline void huge_ptep_clear_flush(struct vm_area_struct
*vma
,
58 unsigned long addr
, pte_t
*ptep
)
61 pte
= huge_ptep_get_and_clear(vma
->vm_mm
, addr
, ptep
);
62 flush_tlb_page(vma
, addr
);
65 static inline int huge_pte_none(pte_t pte
)
70 static inline pte_t
huge_pte_wrprotect(pte_t pte
)
72 return pte_wrprotect(pte
);
75 static inline int huge_ptep_set_access_flags(struct vm_area_struct
*vma
,
76 unsigned long addr
, pte_t
*ptep
,
79 return ptep_set_access_flags(vma
, addr
, ptep
, pte
, dirty
);
82 static inline pte_t
huge_ptep_get(pte_t
*ptep
)
87 static inline int arch_prepare_hugepage(struct page
*page
)
92 static inline void arch_release_hugepage(struct page
*page
)
96 #endif /* _ASM_POWERPC_HUGETLB_H */