Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit dd794392 authored by David Daney's avatar David Daney Committed by Ralf Baechle
Browse files

MIPS: Add hugetlbfs page defines.

parent 50a41ff2
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -220,6 +220,22 @@
#error Bad page size configuration!
#endif

/*
 * Default huge tlb size for a given kernel configuration
 */
#ifdef CONFIG_PAGE_SIZE_4KB
#define PM_HUGE_MASK	PM_1M
#elif defined(CONFIG_PAGE_SIZE_8KB)
#define PM_HUGE_MASK	PM_4M
#elif defined(CONFIG_PAGE_SIZE_16KB)
#define PM_HUGE_MASK	PM_16M
#elif defined(CONFIG_PAGE_SIZE_32KB)
#define PM_HUGE_MASK	PM_64M
#elif defined(CONFIG_PAGE_SIZE_64KB)
#define PM_HUGE_MASK	PM_256M
#elif defined(CONFIG_HUGETLB_PAGE)
#error Bad page size configuration for hugetlbfs!
#endif

/*
 * Values used for computation of new tlb entries
+5 −0
Original line number Diff line number Diff line
@@ -32,6 +32,11 @@
#define PAGE_SIZE	(1UL << PAGE_SHIFT)
#define PAGE_MASK       (~((1 << PAGE_SHIFT) - 1))

#define HPAGE_SHIFT	(PAGE_SHIFT + PAGE_SHIFT - 3)
#define HPAGE_SIZE	((1UL) << HPAGE_SHIFT)
#define HPAGE_MASK	(~(HPAGE_SIZE - 1))
#define HUGETLB_PAGE_ORDER	(HPAGE_SHIFT - PAGE_SHIFT)

#ifndef __ASSEMBLY__

#include <linux/pfn.h>
+1 −0
Original line number Diff line number Diff line
@@ -72,6 +72,7 @@
#else

#define _PAGE_R4KBUG                (1<<5)  /* workaround for r4k bug  */
#define _PAGE_HUGE                  (1<<5)  /* huge tlb page */
#define _PAGE_GLOBAL                (1<<6)
#define _PAGE_VALID                 (1<<7)
#define _PAGE_SILENT_READ           (1<<7)  /* synonym                 */
+10 −0
Original line number Diff line number Diff line
@@ -292,6 +292,16 @@ static inline pte_t pte_mkyoung(pte_t pte)
		pte_val(pte) |= _PAGE_SILENT_READ;
	return pte;
}

#ifdef _PAGE_HUGE
static inline int pte_huge(pte_t pte)	{ return pte_val(pte) & _PAGE_HUGE; }

static inline pte_t pte_mkhuge(pte_t pte)
{
	pte_val(pte) |= _PAGE_HUGE;
	return pte;
}
#endif /* _PAGE_HUGE */
#endif
static inline int pte_special(pte_t pte)	{ return 0; }
static inline pte_t pte_mkspecial(pte_t pte)	{ return pte; }