This source file includes following definitions.
- pmd_huge
- pud_huge
- pgd_huge
- hugepd_ok
- get_hugepd_cache_index
- pmd_huge
- pud_huge
1
2 #ifndef _ASM_POWERPC_BOOK3S_64_PGTABLE_4K_H
3 #define _ASM_POWERPC_BOOK3S_64_PGTABLE_4K_H
4
5
6
7 #ifndef __ASSEMBLY__
8 #ifdef CONFIG_HUGETLB_PAGE
9 static inline int pmd_huge(pmd_t pmd)
10 {
11
12
13
14 if (radix_enabled())
15 return !!(pmd_raw(pmd) & cpu_to_be64(_PAGE_PTE));
16 return 0;
17 }
18
19 static inline int pud_huge(pud_t pud)
20 {
21
22
23
24 if (radix_enabled())
25 return !!(pud_raw(pud) & cpu_to_be64(_PAGE_PTE));
26 return 0;
27 }
28
29 static inline int pgd_huge(pgd_t pgd)
30 {
31
32
33
34 if (radix_enabled())
35 return !!(pgd_raw(pgd) & cpu_to_be64(_PAGE_PTE));
36 return 0;
37 }
38 #define pgd_huge pgd_huge
39
40
41
42
43
44 static inline int hugepd_ok(hugepd_t hpd)
45 {
46 if (radix_enabled())
47 return 0;
48 return hash__hugepd_ok(hpd);
49 }
50 #define is_hugepd(hpd) (hugepd_ok(hpd))
51
52
53
54
55
56 #define H_16M_CACHE_INDEX (PAGE_SHIFT + H_PTE_INDEX_SIZE + H_PMD_INDEX_SIZE - 24)
57 #define H_16G_CACHE_INDEX \
58 (PAGE_SHIFT + H_PTE_INDEX_SIZE + H_PMD_INDEX_SIZE + H_PUD_INDEX_SIZE - 34)
59
60 static inline int get_hugepd_cache_index(int index)
61 {
62 switch (index) {
63 case H_16M_CACHE_INDEX:
64 return HTLB_16M_INDEX;
65 case H_16G_CACHE_INDEX:
66 return HTLB_16G_INDEX;
67 default:
68 BUG();
69 }
70
71 }
72
73 #else
74 static inline int pmd_huge(pmd_t pmd) { return 0; }
75 static inline int pud_huge(pud_t pud) { return 0; }
76 #endif
77
78 #endif
79
80 #endif