aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/powerpc/include/asm/mmu-book3e.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/arch/powerpc/include/asm/mmu-book3e.h b/arch/powerpc/include/asm/mmu-book3e.h
index 8bd560c5fe84..936db360790a 100644
--- a/arch/powerpc/include/asm/mmu-book3e.h
+++ b/arch/powerpc/include/asm/mmu-book3e.h
@@ -215,6 +215,7 @@
215#define TLBILX_T_CLASS3 7 215#define TLBILX_T_CLASS3 7
216 216
217#ifndef __ASSEMBLY__ 217#ifndef __ASSEMBLY__
218#include <asm/bug.h>
218 219
219extern unsigned int tlbcam_index; 220extern unsigned int tlbcam_index;
220 221
@@ -254,6 +255,23 @@ struct mmu_psize_def
254}; 255};
255extern struct mmu_psize_def mmu_psize_defs[MMU_PAGE_COUNT]; 256extern struct mmu_psize_def mmu_psize_defs[MMU_PAGE_COUNT];
256 257
258static inline int shift_to_mmu_psize(unsigned int shift)
259{
260 int psize;
261
262 for (psize = 0; psize < MMU_PAGE_COUNT; ++psize)
263 if (mmu_psize_defs[psize].shift == shift)
264 return psize;
265 return -1;
266}
267
268static inline unsigned int mmu_psize_to_shift(unsigned int mmu_psize)
269{
270 if (mmu_psize_defs[mmu_psize].shift)
271 return mmu_psize_defs[mmu_psize].shift;
272 BUG();
273}
274
257/* The page sizes use the same names as 64-bit hash but are 275/* The page sizes use the same names as 64-bit hash but are
258 * constants 276 * constants
259 */ 277 */