X-Git-Url: https://git.karo-electronics.de/?a=blobdiff_plain;f=include%2Fasm-sh%2Fpgalloc.h;h=84dd2db7104c74f4f57eb4f1c7d0bfc1f4159869;hb=bb799dcadd60796ab13d32a698d92bfb92ce0d5c;hp=59ca16d77a1d79b20775362e8d76d7d9cc2d3594;hpb=a29961b33b089cf4d252ac125891a2784d20ef2f;p=karo-tx-linux.git diff --git a/include/asm-sh/pgalloc.h b/include/asm-sh/pgalloc.h index 59ca16d77a1d..84dd2db7104c 100644 --- a/include/asm-sh/pgalloc.h +++ b/include/asm-sh/pgalloc.h @@ -14,10 +14,11 @@ static inline void pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmd, } static inline void pmd_populate(struct mm_struct *mm, pmd_t *pmd, - struct page *pte) + pgtable_t pte) { set_pmd(pmd, __pmd((unsigned long)page_address(pte))); } +#define pmd_pgtable(pmd) pmd_page(pmd) static inline void pgd_ctor(void *x) { @@ -47,11 +48,18 @@ static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm, return quicklist_alloc(QUICK_PT, GFP_KERNEL | __GFP_REPEAT, NULL); } -static inline struct page *pte_alloc_one(struct mm_struct *mm, - unsigned long address) +static inline pgtable_t pte_alloc_one(struct mm_struct *mm, + unsigned long address) { - void *pg = quicklist_alloc(QUICK_PT, GFP_KERNEL | __GFP_REPEAT, NULL); - return pg ? virt_to_page(pg) : NULL; + struct page *page; + void *pg; + + pg = quicklist_alloc(QUICK_PT, GFP_KERNEL | __GFP_REPEAT, NULL); + if (!pg) + return NULL; + page = virt_to_page(pg); + pgtable_page_ctor(page); + return page; } static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte) @@ -59,12 +67,17 @@ static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte) quicklist_free(QUICK_PT, NULL, pte); } -static inline void pte_free(struct mm_struct *mm, struct page *pte) +static inline void pte_free(struct mm_struct *mm, pgtable_t pte) { + pgtable_page_dtor(pte); quicklist_free_page(QUICK_PT, NULL, pte); } -#define __pte_free_tlb(tlb,pte) tlb_remove_page((tlb),(pte)) +#define __pte_free_tlb(tlb,pte) \ +do { \ + pgtable_page_dtor(pte); \ + tlb_remove_page((tlb), (pte)); \ +} while (0) /* * allocating and freeing a pmd is trivial: the 1-entry pmd is