aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/mips/include/asm/mipsregs.h16
-rw-r--r--arch/mips/include/asm/page.h5
-rw-r--r--arch/mips/include/asm/pgtable-bits.h1
-rw-r--r--arch/mips/include/asm/pgtable.h10
4 files changed, 32 insertions, 0 deletions
diff --git a/arch/mips/include/asm/mipsregs.h b/arch/mips/include/asm/mipsregs.h
index 32ef8bec5c85..a581d60cbcc2 100644
--- a/arch/mips/include/asm/mipsregs.h
+++ b/arch/mips/include/asm/mipsregs.h
@@ -220,6 +220,22 @@
220#error Bad page size configuration! 220#error Bad page size configuration!
221#endif 221#endif
222 222
223/*
224 * Default huge tlb size for a given kernel configuration
225 */
226#ifdef CONFIG_PAGE_SIZE_4KB
227#define PM_HUGE_MASK PM_1M
228#elif defined(CONFIG_PAGE_SIZE_8KB)
229#define PM_HUGE_MASK PM_4M
230#elif defined(CONFIG_PAGE_SIZE_16KB)
231#define PM_HUGE_MASK PM_16M
232#elif defined(CONFIG_PAGE_SIZE_32KB)
233#define PM_HUGE_MASK PM_64M
234#elif defined(CONFIG_PAGE_SIZE_64KB)
235#define PM_HUGE_MASK PM_256M
236#elif defined(CONFIG_HUGETLB_PAGE)
237#error Bad page size configuration for hugetlbfs!
238#endif
223 239
224/* 240/*
225 * Values used for computation of new tlb entries 241 * Values used for computation of new tlb entries
diff --git a/arch/mips/include/asm/page.h b/arch/mips/include/asm/page.h
index 72c80d2034c2..dc0eaa731281 100644
--- a/arch/mips/include/asm/page.h
+++ b/arch/mips/include/asm/page.h
@@ -32,6 +32,11 @@
32#define PAGE_SIZE (1UL << PAGE_SHIFT) 32#define PAGE_SIZE (1UL << PAGE_SHIFT)
33#define PAGE_MASK (~((1 << PAGE_SHIFT) - 1)) 33#define PAGE_MASK (~((1 << PAGE_SHIFT) - 1))
34 34
35#define HPAGE_SHIFT (PAGE_SHIFT + PAGE_SHIFT - 3)
36#define HPAGE_SIZE ((1UL) << HPAGE_SHIFT)
37#define HPAGE_MASK (~(HPAGE_SIZE - 1))
38#define HUGETLB_PAGE_ORDER (HPAGE_SHIFT - PAGE_SHIFT)
39
35#ifndef __ASSEMBLY__ 40#ifndef __ASSEMBLY__
36 41
37#include <linux/pfn.h> 42#include <linux/pfn.h>
diff --git a/arch/mips/include/asm/pgtable-bits.h b/arch/mips/include/asm/pgtable-bits.h
index 51b34a48c84a..1073e6df8621 100644
--- a/arch/mips/include/asm/pgtable-bits.h
+++ b/arch/mips/include/asm/pgtable-bits.h
@@ -72,6 +72,7 @@
72#else 72#else
73 73
74#define _PAGE_R4KBUG (1<<5) /* workaround for r4k bug */ 74#define _PAGE_R4KBUG (1<<5) /* workaround for r4k bug */
75#define _PAGE_HUGE (1<<5) /* huge tlb page */
75#define _PAGE_GLOBAL (1<<6) 76#define _PAGE_GLOBAL (1<<6)
76#define _PAGE_VALID (1<<7) 77#define _PAGE_VALID (1<<7)
77#define _PAGE_SILENT_READ (1<<7) /* synonym */ 78#define _PAGE_SILENT_READ (1<<7) /* synonym */
diff --git a/arch/mips/include/asm/pgtable.h b/arch/mips/include/asm/pgtable.h
index 6a0edf72ffbc..1a9f9b257551 100644
--- a/arch/mips/include/asm/pgtable.h
+++ b/arch/mips/include/asm/pgtable.h
@@ -292,6 +292,16 @@ static inline pte_t pte_mkyoung(pte_t pte)
292 pte_val(pte) |= _PAGE_SILENT_READ; 292 pte_val(pte) |= _PAGE_SILENT_READ;
293 return pte; 293 return pte;
294} 294}
295
296#ifdef _PAGE_HUGE
297static inline int pte_huge(pte_t pte) { return pte_val(pte) & _PAGE_HUGE; }
298
299static inline pte_t pte_mkhuge(pte_t pte)
300{
301 pte_val(pte) |= _PAGE_HUGE;
302 return pte;
303}
304#endif /* _PAGE_HUGE */
295#endif 305#endif
296static inline int pte_special(pte_t pte) { return 0; } 306static inline int pte_special(pte_t pte) { return 0; }
297static inline pte_t pte_mkspecial(pte_t pte) { return pte; } 307static inline pte_t pte_mkspecial(pte_t pte) { return pte; }