aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/include/asm/page.h
diff options
context:
space:
mode:
Diffstat (limited to 'arch/mips/include/asm/page.h')
-rw-r--r--arch/mips/include/asm/page.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/arch/mips/include/asm/page.h b/arch/mips/include/asm/page.h
index f6be4741f7e8..5e08bcc74897 100644
--- a/arch/mips/include/asm/page.h
+++ b/arch/mips/include/asm/page.h
@@ -11,6 +11,8 @@
11 11
12#include <spaces.h> 12#include <spaces.h>
13#include <linux/const.h> 13#include <linux/const.h>
14#include <linux/kernel.h>
15#include <asm/mipsregs.h>
14 16
15/* 17/*
16 * PAGE_SHIFT determines the page size 18 * PAGE_SHIFT determines the page size
@@ -33,6 +35,29 @@
33#define PAGE_SIZE (_AC(1,UL) << PAGE_SHIFT) 35#define PAGE_SIZE (_AC(1,UL) << PAGE_SHIFT)
34#define PAGE_MASK (~((1 << PAGE_SHIFT) - 1)) 36#define PAGE_MASK (~((1 << PAGE_SHIFT) - 1))
35 37
38/*
39 * This is used for calculating the real page sizes
40 * for FTLB or VTLB + FTLB confugrations.
41 */
42static inline unsigned int page_size_ftlb(unsigned int mmuextdef)
43{
44 switch (mmuextdef) {
45 case MIPS_CONF4_MMUEXTDEF_FTLBSIZEEXT:
46 if (PAGE_SIZE == (1 << 30))
47 return 5;
48 if (PAGE_SIZE == (1llu << 32))
49 return 6;
50 if (PAGE_SIZE > (256 << 10))
51 return 7; /* reserved */
52 /* fall through */
53 case MIPS_CONF4_MMUEXTDEF_VTLBSIZEEXT:
54 return (PAGE_SHIFT - 10) / 2;
55 default:
56 panic("Invalid FTLB configuration with Conf4_mmuextdef=%d value\n",
57 mmuextdef >> 14);
58 }
59}
60
36#ifdef CONFIG_MIPS_HUGE_TLB_SUPPORT 61#ifdef CONFIG_MIPS_HUGE_TLB_SUPPORT
37#define HPAGE_SHIFT (PAGE_SHIFT + PAGE_SHIFT - 3) 62#define HPAGE_SHIFT (PAGE_SHIFT + PAGE_SHIFT - 3)
38#define HPAGE_SIZE (_AC(1,UL) << HPAGE_SHIFT) 63#define HPAGE_SIZE (_AC(1,UL) << HPAGE_SHIFT)