Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

MIPS: Add hugetlbfs page defines.

Signed-off-by: David Daney <ddaney@caviumnetworks.com>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

authored by

David Daney and committed by
Ralf Baechle
dd794392 50a41ff2

+32
+16
arch/mips/include/asm/mipsregs.h
··· 220 220 #error Bad page size configuration! 221 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 241 * Values used for computation of new tlb entries
+5
arch/mips/include/asm/page.h
··· 32 32 #define PAGE_SIZE (1UL << PAGE_SHIFT) 33 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 40 #ifndef __ASSEMBLY__ 36 41 37 42 #include <linux/pfn.h>
+1
arch/mips/include/asm/pgtable-bits.h
··· 72 72 #else 73 73 74 74 #define _PAGE_R4KBUG (1<<5) /* workaround for r4k bug */ 75 + #define _PAGE_HUGE (1<<5) /* huge tlb page */ 75 76 #define _PAGE_GLOBAL (1<<6) 76 77 #define _PAGE_VALID (1<<7) 77 78 #define _PAGE_SILENT_READ (1<<7) /* synonym */
+10
arch/mips/include/asm/pgtable.h
··· 292 292 pte_val(pte) |= _PAGE_SILENT_READ; 293 293 return pte; 294 294 } 295 + 296 + #ifdef _PAGE_HUGE 297 + static inline int pte_huge(pte_t pte) { return pte_val(pte) & _PAGE_HUGE; } 298 + 299 + static inline pte_t pte_mkhuge(pte_t pte) 300 + { 301 + pte_val(pte) |= _PAGE_HUGE; 302 + return pte; 303 + } 304 + #endif /* _PAGE_HUGE */ 295 305 #endif 296 306 static inline int pte_special(pte_t pte) { return 0; } 297 307 static inline pte_t pte_mkspecial(pte_t pte) { return pte; }