Commit | Line | Data |
---|---|---|
a9252aae AK |
1 | #ifndef _ASM_POWERPC_BOOK3S_64_PGTABLE_4K_H |
2 | #define _ASM_POWERPC_BOOK3S_64_PGTABLE_4K_H | |
3 | /* | |
4 | * hash 4k can't share hugetlb and also doesn't support THP | |
5 | */ | |
c0a6c719 AK |
6 | #ifndef __ASSEMBLY__ |
7 | #ifdef CONFIG_HUGETLB_PAGE | |
8 | static inline int pmd_huge(pmd_t pmd) | |
9 | { | |
10 | /* | |
11 | * leaf pte for huge page | |
12 | */ | |
13 | if (radix_enabled()) | |
66c570f5 | 14 | return !!(pmd_raw(pmd) & cpu_to_be64(_PAGE_PTE)); |
c0a6c719 AK |
15 | return 0; |
16 | } | |
17 | ||
18 | static inline int pud_huge(pud_t pud) | |
19 | { | |
20 | /* | |
21 | * leaf pte for huge page | |
22 | */ | |
23 | if (radix_enabled()) | |
66c570f5 | 24 | return !!(pud_raw(pud) & cpu_to_be64(_PAGE_PTE)); |
c0a6c719 AK |
25 | return 0; |
26 | } | |
27 | ||
28 | static inline int pgd_huge(pgd_t pgd) | |
29 | { | |
30 | /* | |
31 | * leaf pte for huge page | |
32 | */ | |
33 | if (radix_enabled()) | |
66c570f5 | 34 | return !!(pgd_raw(pgd) & cpu_to_be64(_PAGE_PTE)); |
c0a6c719 AK |
35 | return 0; |
36 | } | |
37 | #define pgd_huge pgd_huge | |
38 | /* | |
39 | * With radix , we have hugepage ptes in the pud and pmd entries. We don't | |
40 | * need to setup hugepage directory for them. Our pte and page directory format | |
41 | * enable us to have this enabled. | |
42 | */ | |
43 | static inline int hugepd_ok(hugepd_t hpd) | |
44 | { | |
45 | if (radix_enabled()) | |
46 | return 0; | |
47 | return hash__hugepd_ok(hpd); | |
48 | } | |
49 | #define is_hugepd(hpd) (hugepd_ok(hpd)) | |
50 | #endif /* CONFIG_HUGETLB_PAGE */ | |
51 | #endif /* __ASSEMBLY__ */ | |
a9252aae AK |
52 | |
53 | #endif /*_ASM_POWERPC_BOOK3S_64_PGTABLE_4K_H */ |