diff options
Diffstat (limited to 'arch/sh/include/asm/pgalloc.h')
| -rw-r--r-- | arch/sh/include/asm/pgalloc.h | 32 |
1 files changed, 10 insertions, 22 deletions
diff --git a/arch/sh/include/asm/pgalloc.h b/arch/sh/include/asm/pgalloc.h index 63ca37bd9a95..8c00785c60d5 100644 --- a/arch/sh/include/asm/pgalloc.h +++ b/arch/sh/include/asm/pgalloc.h | |||
| @@ -4,8 +4,16 @@ | |||
| 4 | #include <linux/quicklist.h> | 4 | #include <linux/quicklist.h> |
| 5 | #include <asm/page.h> | 5 | #include <asm/page.h> |
| 6 | 6 | ||
| 7 | #define QUICK_PGD 0 /* We preserve special mappings over free */ | 7 | #define QUICK_PT 0 /* Other page table pages that are zero on free */ |
| 8 | #define QUICK_PT 1 /* Other page table pages that are zero on free */ | 8 | |
| 9 | extern pgd_t *pgd_alloc(struct mm_struct *); | ||
| 10 | extern void pgd_free(struct mm_struct *mm, pgd_t *pgd); | ||
| 11 | |||
| 12 | #if PAGETABLE_LEVELS > 2 | ||
| 13 | extern void pud_populate(struct mm_struct *mm, pud_t *pudp, pmd_t *pmd); | ||
| 14 | extern pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long address); | ||
| 15 | extern void pmd_free(struct mm_struct *mm, pmd_t *pmd); | ||
| 16 | #endif | ||
| 9 | 17 | ||
| 10 | static inline void pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmd, | 18 | static inline void pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmd, |
| 11 | pte_t *pte) | 19 | pte_t *pte) |
| @@ -20,28 +28,9 @@ static inline void pmd_populate(struct mm_struct *mm, pmd_t *pmd, | |||
| 20 | } | 28 | } |
| 21 | #define pmd_pgtable(pmd) pmd_page(pmd) | 29 | #define pmd_pgtable(pmd) pmd_page(pmd) |
| 22 | 30 | ||
| 23 | static inline void pgd_ctor(void *x) | ||
| 24 | { | ||
| 25 | pgd_t *pgd = x; | ||
| 26 | |||
| 27 | memcpy(pgd + USER_PTRS_PER_PGD, | ||
| 28 | swapper_pg_dir + USER_PTRS_PER_PGD, | ||
| 29 | (PTRS_PER_PGD - USER_PTRS_PER_PGD) * sizeof(pgd_t)); | ||
| 30 | } | ||
| 31 | |||
| 32 | /* | 31 | /* |
| 33 | * Allocate and free page tables. | 32 | * Allocate and free page tables. |
| 34 | */ | 33 | */ |
| 35 | static inline pgd_t *pgd_alloc(struct mm_struct *mm) | ||
| 36 | { | ||
| 37 | return quicklist_alloc(QUICK_PGD, GFP_KERNEL | __GFP_REPEAT, pgd_ctor); | ||
| 38 | } | ||
| 39 | |||
| 40 | static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd) | ||
| 41 | { | ||
| 42 | quicklist_free(QUICK_PGD, NULL, pgd); | ||
| 43 | } | ||
| 44 | |||
| 45 | static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm, | 34 | static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm, |
| 46 | unsigned long address) | 35 | unsigned long address) |
| 47 | { | 36 | { |
| @@ -81,7 +70,6 @@ do { \ | |||
| 81 | 70 | ||
| 82 | static inline void check_pgt_cache(void) | 71 | static inline void check_pgt_cache(void) |
| 83 | { | 72 | { |
| 84 | quicklist_trim(QUICK_PGD, NULL, 25, 16); | ||
| 85 | quicklist_trim(QUICK_PT, NULL, 25, 16); | 73 | quicklist_trim(QUICK_PT, NULL, 25, 16); |
| 86 | } | 74 | } |
| 87 | 75 | ||
