aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-xtensa/pgalloc.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-xtensa/pgalloc.h')
-rw-r--r--include/asm-xtensa/pgalloc.h17
1 files changed, 12 insertions, 5 deletions
diff --git a/include/asm-xtensa/pgalloc.h b/include/asm-xtensa/pgalloc.h
index 1d51ba5463f9..8d1544eb461e 100644
--- a/include/asm-xtensa/pgalloc.h
+++ b/include/asm-xtensa/pgalloc.h
@@ -24,6 +24,7 @@
24 (pmd_val(*(pmdp)) = ((unsigned long)ptep)) 24 (pmd_val(*(pmdp)) = ((unsigned long)ptep))
25#define pmd_populate(mm, pmdp, page) \ 25#define pmd_populate(mm, pmdp, page) \
26 (pmd_val(*(pmdp)) = ((unsigned long)page_to_virt(page))) 26 (pmd_val(*(pmdp)) = ((unsigned long)page_to_virt(page)))
27#define pmd_pgtable(pmd) pmd_page(pmd)
27 28
28static inline pgd_t* 29static inline pgd_t*
29pgd_alloc(struct mm_struct *mm) 30pgd_alloc(struct mm_struct *mm)
@@ -46,10 +47,14 @@ static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm,
46 return kmem_cache_alloc(pgtable_cache, GFP_KERNEL|__GFP_REPEAT); 47 return kmem_cache_alloc(pgtable_cache, GFP_KERNEL|__GFP_REPEAT);
47} 48}
48 49
49static inline struct page *pte_alloc_one(struct mm_struct *mm, 50static inline pte_token_t pte_alloc_one(struct mm_struct *mm,
50 unsigned long addr) 51 unsigned long addr)
51{ 52{
52 return virt_to_page(pte_alloc_one_kernel(mm, addr)); 53 struct page *page;
54
55 page = virt_to_page(pte_alloc_one_kernel(mm, addr));
56 pgtable_page_ctor(page);
57 return page;
53} 58}
54 59
55static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte) 60static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte)
@@ -57,10 +62,12 @@ static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte)
57 kmem_cache_free(pgtable_cache, pte); 62 kmem_cache_free(pgtable_cache, pte);
58} 63}
59 64
60static inline void pte_free(struct mm_struct *mm, struct page *page) 65static inline void pte_free(struct mm_struct *mm, pgtable_t pte)
61{ 66{
62 kmem_cache_free(pgtable_cache, page_address(page)); 67 pgtable_page_dtor(pte);
68 kmem_cache_free(pgtable_cache, page_address(pte));
63} 69}
70#define pmd_pgtable(pmd) pmd_page(pmd)
64 71
65#endif /* __KERNEL__ */ 72#endif /* __KERNEL__ */
66#endif /* _XTENSA_PGALLOC_H */ 73#endif /* _XTENSA_PGALLOC_H */