diff options
Diffstat (limited to 'include/asm-alpha/pgalloc.h')
-rw-r--r-- | include/asm-alpha/pgalloc.h | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/include/asm-alpha/pgalloc.h b/include/asm-alpha/pgalloc.h index fdbedacc7375..fd090155dccd 100644 --- a/include/asm-alpha/pgalloc.h +++ b/include/asm-alpha/pgalloc.h | |||
@@ -11,10 +11,11 @@ | |||
11 | */ | 11 | */ |
12 | 12 | ||
13 | static inline void | 13 | static inline void |
14 | pmd_populate(struct mm_struct *mm, pmd_t *pmd, struct page *pte) | 14 | pmd_populate(struct mm_struct *mm, pmd_t *pmd, pgtable_t pte) |
15 | { | 15 | { |
16 | pmd_set(pmd, (pte_t *)(page_to_pa(pte) + PAGE_OFFSET)); | 16 | pmd_set(pmd, (pte_t *)(page_to_pa(pte) + PAGE_OFFSET)); |
17 | } | 17 | } |
18 | #define pmd_pgtable(pmd) pmd_page(pmd) | ||
18 | 19 | ||
19 | static inline void | 20 | static inline void |
20 | pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmd, pte_t *pte) | 21 | pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmd, pte_t *pte) |
@@ -57,18 +58,23 @@ pte_free_kernel(struct mm_struct *mm, pte_t *pte) | |||
57 | free_page((unsigned long)pte); | 58 | free_page((unsigned long)pte); |
58 | } | 59 | } |
59 | 60 | ||
60 | static inline struct page * | 61 | static inline pgtable_t |
61 | pte_alloc_one(struct mm_struct *mm, unsigned long addr) | 62 | pte_alloc_one(struct mm_struct *mm, unsigned long address) |
62 | { | 63 | { |
63 | pte_t *pte = pte_alloc_one_kernel(mm, addr); | 64 | pte_t *pte = pte_alloc_one_kernel(mm, address); |
64 | if (pte) | 65 | struct page *page; |
65 | return virt_to_page(pte); | 66 | |
66 | return NULL; | 67 | if (!pte) |
68 | return NULL; | ||
69 | page = virt_to_page(pte); | ||
70 | pgtable_page_ctor(page); | ||
71 | return page; | ||
67 | } | 72 | } |
68 | 73 | ||
69 | static inline void | 74 | static inline void |
70 | pte_free(struct mm_struct *mm, struct page *page) | 75 | pte_free(struct mm_struct *mm, pgtable_t page) |
71 | { | 76 | { |
77 | pgtable_page_dtor(page); | ||
72 | __free_page(page); | 78 | __free_page(page); |
73 | } | 79 | } |
74 | 80 | ||