GNU Linux-libre 4.9-gnu1
[releases.git] / arch / powerpc / include / asm / book3s / 64 / hugetlb-radix.h
1 #ifndef _ASM_POWERPC_BOOK3S_64_HUGETLB_RADIX_H
2 #define _ASM_POWERPC_BOOK3S_64_HUGETLB_RADIX_H
3 /*
4  * For radix we want generic code to handle hugetlb. But then if we want
5  * both hash and radix to be enabled together we need to workaround the
6  * limitations.
7  */
8 void radix__flush_hugetlb_page(struct vm_area_struct *vma, unsigned long vmaddr);
9 void radix__local_flush_hugetlb_page(struct vm_area_struct *vma, unsigned long vmaddr);
10 extern unsigned long
11 radix__hugetlb_get_unmapped_area(struct file *file, unsigned long addr,
12                                 unsigned long len, unsigned long pgoff,
13                                 unsigned long flags);
14
15 static inline int hstate_get_psize(struct hstate *hstate)
16 {
17         unsigned long shift;
18
19         shift = huge_page_shift(hstate);
20         if (shift == mmu_psize_defs[MMU_PAGE_2M].shift)
21                 return MMU_PAGE_2M;
22         else if (shift == mmu_psize_defs[MMU_PAGE_1G].shift)
23                 return MMU_PAGE_1G;
24         else {
25                 WARN(1, "Wrong huge page shift\n");
26                 return mmu_virtual_psize;
27         }
28 }
29 #endif