18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
28c2ecf20Sopenharmony_ci#ifndef _ASM_SH_HUGETLB_H
38c2ecf20Sopenharmony_ci#define _ASM_SH_HUGETLB_H
48c2ecf20Sopenharmony_ci
58c2ecf20Sopenharmony_ci#include <asm/cacheflush.h>
68c2ecf20Sopenharmony_ci#include <asm/page.h>
78c2ecf20Sopenharmony_ci
88c2ecf20Sopenharmony_ci/*
98c2ecf20Sopenharmony_ci * If the arch doesn't supply something else, assume that hugepage
108c2ecf20Sopenharmony_ci * size aligned regions are ok without further preparation.
118c2ecf20Sopenharmony_ci */
128c2ecf20Sopenharmony_ci#define __HAVE_ARCH_PREPARE_HUGEPAGE_RANGE
138c2ecf20Sopenharmony_cistatic inline int prepare_hugepage_range(struct file *file,
148c2ecf20Sopenharmony_ci			unsigned long addr, unsigned long len)
158c2ecf20Sopenharmony_ci{
168c2ecf20Sopenharmony_ci	if (len & ~HPAGE_MASK)
178c2ecf20Sopenharmony_ci		return -EINVAL;
188c2ecf20Sopenharmony_ci	if (addr & ~HPAGE_MASK)
198c2ecf20Sopenharmony_ci		return -EINVAL;
208c2ecf20Sopenharmony_ci	return 0;
218c2ecf20Sopenharmony_ci}
228c2ecf20Sopenharmony_ci
238c2ecf20Sopenharmony_ci#define __HAVE_ARCH_HUGE_PTEP_CLEAR_FLUSH
248c2ecf20Sopenharmony_cistatic inline void huge_ptep_clear_flush(struct vm_area_struct *vma,
258c2ecf20Sopenharmony_ci					 unsigned long addr, pte_t *ptep)
268c2ecf20Sopenharmony_ci{
278c2ecf20Sopenharmony_ci}
288c2ecf20Sopenharmony_ci
298c2ecf20Sopenharmony_cistatic inline void arch_clear_hugepage_flags(struct page *page)
308c2ecf20Sopenharmony_ci{
318c2ecf20Sopenharmony_ci	clear_bit(PG_dcache_clean, &page->flags);
328c2ecf20Sopenharmony_ci}
338c2ecf20Sopenharmony_ci#define arch_clear_hugepage_flags arch_clear_hugepage_flags
348c2ecf20Sopenharmony_ci
358c2ecf20Sopenharmony_ci#include <asm-generic/hugetlb.h>
368c2ecf20Sopenharmony_ci
378c2ecf20Sopenharmony_ci#endif /* _ASM_SH_HUGETLB_H */
38