1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _ASM_POWERPC_BOOK3S_64_PGTABLE_4K_H
3 #define _ASM_POWERPC_BOOK3S_64_PGTABLE_4K_H
5 * hash 4k can't share hugetlb and also doesn't support THP
8 #ifdef CONFIG_HUGETLB_PAGE
9 static inline int pmd_huge(pmd_t pmd
)
12 * leaf pte for huge page
15 return !!(pmd_raw(pmd
) & cpu_to_be64(_PAGE_PTE
));
19 static inline int pud_huge(pud_t pud
)
22 * leaf pte for huge page
25 return !!(pud_raw(pud
) & cpu_to_be64(_PAGE_PTE
));
29 static inline int pgd_huge(pgd_t pgd
)
32 * leaf pte for huge page
35 return !!(pgd_raw(pgd
) & cpu_to_be64(_PAGE_PTE
));
38 #define pgd_huge pgd_huge
40 * With radix , we have hugepage ptes in the pud and pmd entries. We don't
41 * need to setup hugepage directory for them. Our pte and page directory format
42 * enable us to have this enabled.
44 static inline int hugepd_ok(hugepd_t hpd
)
48 return hash__hugepd_ok(hpd
);
50 #define is_hugepd(hpd) (hugepd_ok(hpd))
52 #else /* !CONFIG_HUGETLB_PAGE */
53 static inline int pmd_huge(pmd_t pmd
) { return 0; }
54 static inline int pud_huge(pud_t pud
) { return 0; }
55 #endif /* CONFIG_HUGETLB_PAGE */
57 #endif /* __ASSEMBLY__ */
59 #endif /*_ASM_POWERPC_BOOK3S_64_PGTABLE_4K_H */