1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _ASM_RISCV_HUGETLB_H
3 #define _ASM_RISCV_HUGETLB_H
5 #include <asm/cacheflush.h>
8 static inline void arch_clear_hugepage_flags(struct page *page)
10 clear_bit(PG_dcache_clean, &page->flags);
12 #define arch_clear_hugepage_flags arch_clear_hugepage_flags
14 #ifdef CONFIG_RISCV_ISA_SVNAPOT
15 #define __HAVE_ARCH_HUGE_PTE_CLEAR
16 void huge_pte_clear(struct mm_struct *mm, unsigned long addr,
17 pte_t *ptep, unsigned long sz);
19 #define __HAVE_ARCH_HUGE_SET_HUGE_PTE_AT
20 void set_huge_pte_at(struct mm_struct *mm,
21 unsigned long addr, pte_t *ptep, pte_t pte,
24 #define __HAVE_ARCH_HUGE_PTEP_GET_AND_CLEAR
25 pte_t huge_ptep_get_and_clear(struct mm_struct *mm,
26 unsigned long addr, pte_t *ptep);
28 #define __HAVE_ARCH_HUGE_PTEP_CLEAR_FLUSH
29 pte_t huge_ptep_clear_flush(struct vm_area_struct *vma,
30 unsigned long addr, pte_t *ptep);
32 #define __HAVE_ARCH_HUGE_PTEP_SET_WRPROTECT
33 void huge_ptep_set_wrprotect(struct mm_struct *mm,
34 unsigned long addr, pte_t *ptep);
36 #define __HAVE_ARCH_HUGE_PTEP_SET_ACCESS_FLAGS
37 int huge_ptep_set_access_flags(struct vm_area_struct *vma,
38 unsigned long addr, pte_t *ptep,
39 pte_t pte, int dirty);
41 #define __HAVE_ARCH_HUGE_PTEP_GET
42 pte_t huge_ptep_get(pte_t *ptep);
44 pte_t arch_make_huge_pte(pte_t entry, unsigned int shift, vm_flags_t flags);
45 #define arch_make_huge_pte arch_make_huge_pte
47 #endif /*CONFIG_RISCV_ISA_SVNAPOT*/
49 #include <asm-generic/hugetlb.h>
51 #endif /* _ASM_RISCV_HUGETLB_H */