diff options
Diffstat (limited to 'arch/arm64/include/asm/pgalloc.h')
-rw-r--r-- | arch/arm64/include/asm/pgalloc.h | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/arch/arm64/include/asm/pgalloc.h b/arch/arm64/include/asm/pgalloc.h index 9bea6e74a001..d5bed02073d6 100644 --- a/arch/arm64/include/asm/pgalloc.h +++ b/arch/arm64/include/asm/pgalloc.h | |||
@@ -26,7 +26,7 @@ | |||
26 | 26 | ||
27 | #define check_pgt_cache() do { } while (0) | 27 | #define check_pgt_cache() do { } while (0) |
28 | 28 | ||
29 | #ifndef CONFIG_ARM64_64K_PAGES | 29 | #if CONFIG_ARM64_PGTABLE_LEVELS > 2 |
30 | 30 | ||
31 | static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long addr) | 31 | static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long addr) |
32 | { | 32 | { |
@@ -44,7 +44,27 @@ static inline void pud_populate(struct mm_struct *mm, pud_t *pud, pmd_t *pmd) | |||
44 | set_pud(pud, __pud(__pa(pmd) | PMD_TYPE_TABLE)); | 44 | set_pud(pud, __pud(__pa(pmd) | PMD_TYPE_TABLE)); |
45 | } | 45 | } |
46 | 46 | ||
47 | #endif /* CONFIG_ARM64_64K_PAGES */ | 47 | #endif /* CONFIG_ARM64_PGTABLE_LEVELS > 2 */ |
48 | |||
49 | #if CONFIG_ARM64_PGTABLE_LEVELS > 3 | ||
50 | |||
51 | static inline pud_t *pud_alloc_one(struct mm_struct *mm, unsigned long addr) | ||
52 | { | ||
53 | return (pud_t *)get_zeroed_page(GFP_KERNEL | __GFP_REPEAT); | ||
54 | } | ||
55 | |||
56 | static inline void pud_free(struct mm_struct *mm, pud_t *pud) | ||
57 | { | ||
58 | BUG_ON((unsigned long)pud & (PAGE_SIZE-1)); | ||
59 | free_page((unsigned long)pud); | ||
60 | } | ||
61 | |||
62 | static inline void pgd_populate(struct mm_struct *mm, pgd_t *pgd, pud_t *pud) | ||
63 | { | ||
64 | set_pgd(pgd, __pgd(__pa(pud) | PUD_TYPE_TABLE)); | ||
65 | } | ||
66 | |||
67 | #endif /* CONFIG_ARM64_PGTABLE_LEVELS > 3 */ | ||
48 | 68 | ||
49 | extern pgd_t *pgd_alloc(struct mm_struct *mm); | 69 | extern pgd_t *pgd_alloc(struct mm_struct *mm); |
50 | extern void pgd_free(struct mm_struct *mm, pgd_t *pgd); | 70 | extern void pgd_free(struct mm_struct *mm, pgd_t *pgd); |