1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _ASM_POWERPC_BOOK3S_64_HUGETLB_H
3 #define _ASM_POWERPC_BOOK3S_64_HUGETLB_H
5 * For radix we want generic code to handle hugetlb. But then if we want
6 * both hash and radix to be enabled together we need to workaround the
9 void radix__flush_hugetlb_page(struct vm_area_struct *vma, unsigned long vmaddr);
10 void radix__local_flush_hugetlb_page(struct vm_area_struct *vma, unsigned long vmaddr);
12 radix__hugetlb_get_unmapped_area(struct file *file, unsigned long addr,
13 unsigned long len, unsigned long pgoff,
16 static inline int hstate_get_psize(struct hstate *hstate)
20 shift = huge_page_shift(hstate);
21 if (shift == mmu_psize_defs[MMU_PAGE_2M].shift)
23 else if (shift == mmu_psize_defs[MMU_PAGE_1G].shift)
25 else if (shift == mmu_psize_defs[MMU_PAGE_16M].shift)
27 else if (shift == mmu_psize_defs[MMU_PAGE_16G].shift)
30 WARN(1, "Wrong huge page shift\n");
31 return mmu_virtual_psize;
35 #ifdef CONFIG_ARCH_HAS_GIGANTIC_PAGE
36 static inline bool gigantic_page_supported(void)
42 /* hugepd entry valid bit */
43 #define HUGEPD_VAL_BITS (0x8000000000000000UL)