diff options
Diffstat (limited to 'arch/powerpc/include/asm/mmu-hash64.h')
-rw-r--r-- | arch/powerpc/include/asm/mmu-hash64.h | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/arch/powerpc/include/asm/mmu-hash64.h b/arch/powerpc/include/asm/mmu-hash64.h index b59e06f507ea..05895cff1345 100644 --- a/arch/powerpc/include/asm/mmu-hash64.h +++ b/arch/powerpc/include/asm/mmu-hash64.h | |||
@@ -21,6 +21,7 @@ | |||
21 | * complete pgtable.h but only a portion of it. | 21 | * complete pgtable.h but only a portion of it. |
22 | */ | 22 | */ |
23 | #include <asm/pgtable-ppc64.h> | 23 | #include <asm/pgtable-ppc64.h> |
24 | #include <asm/bug.h> | ||
24 | 25 | ||
25 | /* | 26 | /* |
26 | * Segment table | 27 | * Segment table |
@@ -159,6 +160,24 @@ struct mmu_psize_def | |||
159 | unsigned long avpnm; /* bits to mask out in AVPN in the HPTE */ | 160 | unsigned long avpnm; /* bits to mask out in AVPN in the HPTE */ |
160 | unsigned long sllp; /* SLB L||LP (exact mask to use in slbmte) */ | 161 | unsigned long sllp; /* SLB L||LP (exact mask to use in slbmte) */ |
161 | }; | 162 | }; |
163 | extern struct mmu_psize_def mmu_psize_defs[MMU_PAGE_COUNT]; | ||
164 | |||
165 | static inline int shift_to_mmu_psize(unsigned int shift) | ||
166 | { | ||
167 | int psize; | ||
168 | |||
169 | for (psize = 0; psize < MMU_PAGE_COUNT; ++psize) | ||
170 | if (mmu_psize_defs[psize].shift == shift) | ||
171 | return psize; | ||
172 | return -1; | ||
173 | } | ||
174 | |||
175 | static inline unsigned int mmu_psize_to_shift(unsigned int mmu_psize) | ||
176 | { | ||
177 | if (mmu_psize_defs[mmu_psize].shift) | ||
178 | return mmu_psize_defs[mmu_psize].shift; | ||
179 | BUG(); | ||
180 | } | ||
162 | 181 | ||
163 | #endif /* __ASSEMBLY__ */ | 182 | #endif /* __ASSEMBLY__ */ |
164 | 183 | ||
@@ -193,7 +212,6 @@ static inline int segment_shift(int ssize) | |||
193 | /* | 212 | /* |
194 | * The current system page and segment sizes | 213 | * The current system page and segment sizes |
195 | */ | 214 | */ |
196 | extern struct mmu_psize_def mmu_psize_defs[MMU_PAGE_COUNT]; | ||
197 | extern int mmu_linear_psize; | 215 | extern int mmu_linear_psize; |
198 | extern int mmu_virtual_psize; | 216 | extern int mmu_virtual_psize; |
199 | extern int mmu_vmalloc_psize; | 217 | extern int mmu_vmalloc_psize; |