aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/include/asm/pgtable.h
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/include/asm/pgtable.h')
-rw-r--r--arch/x86/include/asm/pgtable.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/arch/x86/include/asm/pgtable.h b/arch/x86/include/asm/pgtable.h
index 5199db2923d3..bc28e6fe7052 100644
--- a/arch/x86/include/asm/pgtable.h
+++ b/arch/x86/include/asm/pgtable.h
@@ -390,6 +390,7 @@ pte_t *populate_extra_pte(unsigned long vaddr);
390 390
391#ifndef __ASSEMBLY__ 391#ifndef __ASSEMBLY__
392#include <linux/mm_types.h> 392#include <linux/mm_types.h>
393#include <linux/log2.h>
393 394
394static inline int pte_none(pte_t pte) 395static inline int pte_none(pte_t pte)
395{ 396{
@@ -781,6 +782,19 @@ static inline void clone_pgd_range(pgd_t *dst, pgd_t *src, int count)
781 memcpy(dst, src, count * sizeof(pgd_t)); 782 memcpy(dst, src, count * sizeof(pgd_t));
782} 783}
783 784
785#define PTE_SHIFT ilog2(PTRS_PER_PTE)
786static inline int page_level_shift(enum pg_level level)
787{
788 return (PAGE_SHIFT - PTE_SHIFT) + level * PTE_SHIFT;
789}
790static inline unsigned long page_level_size(enum pg_level level)
791{
792 return 1UL << page_level_shift(level);
793}
794static inline unsigned long page_level_mask(enum pg_level level)
795{
796 return ~(page_level_size(level) - 1);
797}
784 798
785#include <asm-generic/pgtable.h> 799#include <asm-generic/pgtable.h>
786#endif /* __ASSEMBLY__ */ 800#endif /* __ASSEMBLY__ */