diff options
Diffstat (limited to 'include/asm-avr32/pgalloc.h')
-rw-r--r-- | include/asm-avr32/pgalloc.h | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/include/asm-avr32/pgalloc.h b/include/asm-avr32/pgalloc.h index 5b768fc2388e..e9636d1f383f 100644 --- a/include/asm-avr32/pgalloc.h +++ b/include/asm-avr32/pgalloc.h | |||
@@ -9,8 +9,6 @@ | |||
9 | #define __ASM_AVR32_PGALLOC_H | 9 | #define __ASM_AVR32_PGALLOC_H |
10 | 10 | ||
11 | #include <linux/mm.h> | 11 | #include <linux/mm.h> |
12 | #include <linux/sched.h> | ||
13 | #include <linux/slab.h> | ||
14 | 12 | ||
15 | static inline void pmd_populate_kernel(struct mm_struct *mm, | 13 | static inline void pmd_populate_kernel(struct mm_struct *mm, |
16 | pmd_t *pmd, pte_t *pte) | 14 | pmd_t *pmd, pte_t *pte) |
@@ -30,12 +28,20 @@ static inline void pmd_populate(struct mm_struct *mm, pmd_t *pmd, | |||
30 | */ | 28 | */ |
31 | static inline pgd_t *pgd_alloc(struct mm_struct *mm) | 29 | static inline pgd_t *pgd_alloc(struct mm_struct *mm) |
32 | { | 30 | { |
33 | return kcalloc(USER_PTRS_PER_PGD, sizeof(pgd_t), GFP_KERNEL); | 31 | pgd_t *pgd; |
32 | |||
33 | pgd = (pgd_t *)get_zeroed_page(GFP_KERNEL | __GFP_REPEAT); | ||
34 | if (likely(pgd)) | ||
35 | memcpy(pgd + USER_PTRS_PER_PGD, | ||
36 | swapper_pg_dir + USER_PTRS_PER_PGD, | ||
37 | (PTRS_PER_PGD - USER_PTRS_PER_PGD) * sizeof(pgd_t)); | ||
38 | |||
39 | return pgd; | ||
34 | } | 40 | } |
35 | 41 | ||
36 | static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd) | 42 | static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd) |
37 | { | 43 | { |
38 | kfree(pgd); | 44 | free_page((unsigned long)pgd); |
39 | } | 45 | } |
40 | 46 | ||
41 | static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm, | 47 | static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm, |