1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _ASM_SH_HUGETLB_H
3 #define _ASM_SH_HUGETLB_H
5 #include <asm/cacheflush.h>
8 static inline int is_hugepage_only_range(struct mm_struct *mm,
15 * If the arch doesn't supply something else, assume that hugepage
16 * size aligned regions are ok without further preparation.
18 static inline int prepare_hugepage_range(struct file *file,
19 unsigned long addr, unsigned long len)
21 if (len & ~HPAGE_MASK)
23 if (addr & ~HPAGE_MASK)
28 static inline void set_huge_pte_at(struct mm_struct *mm, unsigned long addr,
29 pte_t *ptep, pte_t pte)
31 set_pte_at(mm, addr, ptep, pte);
34 static inline pte_t huge_ptep_get_and_clear(struct mm_struct *mm,
35 unsigned long addr, pte_t *ptep)
37 return ptep_get_and_clear(mm, addr, ptep);
40 static inline void huge_ptep_clear_flush(struct vm_area_struct *vma,
41 unsigned long addr, pte_t *ptep)
45 static inline int huge_pte_none(pte_t pte)
50 static inline pte_t huge_pte_wrprotect(pte_t pte)
52 return pte_wrprotect(pte);
55 static inline void huge_ptep_set_wrprotect(struct mm_struct *mm,
56 unsigned long addr, pte_t *ptep)
58 ptep_set_wrprotect(mm, addr, ptep);
61 static inline int huge_ptep_set_access_flags(struct vm_area_struct *vma,
62 unsigned long addr, pte_t *ptep,
65 return ptep_set_access_flags(vma, addr, ptep, pte, dirty);
68 static inline pte_t huge_ptep_get(pte_t *ptep)
73 static inline void arch_clear_hugepage_flags(struct page *page)
75 clear_bit(PG_dcache_clean, &page->flags);
78 #include <asm-generic/hugetlb.h>
80 #endif /* _ASM_SH_HUGETLB_H */