X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=include%2Fasm-xtensa%2Fpgalloc.h;h=4f4a7987eded7087251550e37204f227e293587e;hb=13c48c490208d9e70d8d66d56f96c5054db69af7;hp=1d51ba5463f9f2f215015c598b5ef51bb7ff06f2;hpb=26b6f2236615649a0ae6a0de2e9e71a2f9ffeba7;p=linux-2.6 diff --git a/include/asm-xtensa/pgalloc.h b/include/asm-xtensa/pgalloc.h index 1d51ba5463..4f4a7987ed 100644 --- a/include/asm-xtensa/pgalloc.h +++ b/include/asm-xtensa/pgalloc.h @@ -24,6 +24,7 @@ (pmd_val(*(pmdp)) = ((unsigned long)ptep)) #define pmd_populate(mm, pmdp, page) \ (pmd_val(*(pmdp)) = ((unsigned long)page_to_virt(page))) +#define pmd_pgtable(pmd) pmd_page(pmd) static inline pgd_t* pgd_alloc(struct mm_struct *mm) @@ -46,10 +47,14 @@ static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm, return kmem_cache_alloc(pgtable_cache, GFP_KERNEL|__GFP_REPEAT); } -static inline struct page *pte_alloc_one(struct mm_struct *mm, - unsigned long addr) +static inline pgtable_t pte_alloc_one(struct mm_struct *mm, + unsigned long addr) { - return virt_to_page(pte_alloc_one_kernel(mm, addr)); + struct page *page; + + page = virt_to_page(pte_alloc_one_kernel(mm, addr)); + pgtable_page_ctor(page); + return page; } static 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) kmem_cache_free(pgtable_cache, pte); } -static inline void pte_free(struct mm_struct *mm, struct page *page) +static inline void pte_free(struct mm_struct *mm, pgtable_t pte) { - kmem_cache_free(pgtable_cache, page_address(page)); + pgtable_page_dtor(pte); + kmem_cache_free(pgtable_cache, page_address(pte)); } +#define pmd_pgtable(pmd) pmd_page(pmd) #endif /* __KERNEL__ */ #endif /* _XTENSA_PGALLOC_H */