28c23b68d38d7a2a48c4a068803941c0fd3dd5c4
[muen/linux.git] / arch / parisc / include / asm / hugetlb.h
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _ASM_PARISC64_HUGETLB_H
3 #define _ASM_PARISC64_HUGETLB_H
4
5 #include <asm/page.h>
6
7 void set_huge_pte_at(struct mm_struct *mm, unsigned long addr,
8                      pte_t *ptep, pte_t pte);
9
10 pte_t huge_ptep_get_and_clear(struct mm_struct *mm, unsigned long addr,
11                               pte_t *ptep);
12
13 static inline int is_hugepage_only_range(struct mm_struct *mm,
14                                          unsigned long addr,
15                                          unsigned long len) {
16         return 0;
17 }
18
19 /*
20  * If the arch doesn't supply something else, assume that hugepage
21  * size aligned regions are ok without further preparation.
22  */
23 static inline int prepare_hugepage_range(struct file *file,
24                         unsigned long addr, unsigned long len)
25 {
26         if (len & ~HPAGE_MASK)
27                 return -EINVAL;
28         if (addr & ~HPAGE_MASK)
29                 return -EINVAL;
30         return 0;
31 }
32
33 static inline void huge_ptep_clear_flush(struct vm_area_struct *vma,
34                                          unsigned long addr, pte_t *ptep)
35 {
36 }
37
38 static inline int huge_pte_none(pte_t pte)
39 {
40         return pte_none(pte);
41 }
42
43 static inline pte_t huge_pte_wrprotect(pte_t pte)
44 {
45         return pte_wrprotect(pte);
46 }
47
48 void huge_ptep_set_wrprotect(struct mm_struct *mm,
49                                            unsigned long addr, pte_t *ptep);
50
51 int huge_ptep_set_access_flags(struct vm_area_struct *vma,
52                                              unsigned long addr, pte_t *ptep,
53                                              pte_t pte, int dirty);
54
55 static inline pte_t huge_ptep_get(pte_t *ptep)
56 {
57         return *ptep;
58 }
59
60 static inline void arch_clear_hugepage_flags(struct page *page)
61 {
62 }
63
64 #include <asm-generic/hugetlb.h>
65
66 #endif /* _ASM_PARISC64_HUGETLB_H */