diff options
Diffstat (limited to 'include/asm-sparc64/pgalloc.h')
-rw-r--r-- | include/asm-sparc64/pgalloc.h | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/include/asm-sparc64/pgalloc.h b/include/asm-sparc64/pgalloc.h index b48f73c2274e..3ee2d406373b 100644 --- a/include/asm-sparc64/pgalloc.h +++ b/include/asm-sparc64/pgalloc.h | |||
@@ -43,11 +43,18 @@ static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm, | |||
43 | return quicklist_alloc(0, GFP_KERNEL, NULL); | 43 | return quicklist_alloc(0, GFP_KERNEL, NULL); |
44 | } | 44 | } |
45 | 45 | ||
46 | static inline struct page *pte_alloc_one(struct mm_struct *mm, | 46 | static inline pgtable_t pte_alloc_one(struct mm_struct *mm, |
47 | unsigned long address) | 47 | unsigned long address) |
48 | { | 48 | { |
49 | void *pg = quicklist_alloc(0, GFP_KERNEL, NULL); | 49 | struct page *page; |
50 | return pg ? virt_to_page(pg) : NULL; | 50 | void *pg; |
51 | |||
52 | pg = quicklist_alloc(0, GFP_KERNEL, NULL); | ||
53 | if (!pg) | ||
54 | return NULL; | ||
55 | page = virt_to_page(pg); | ||
56 | pgtable_page_ctor(page); | ||
57 | return page; | ||
51 | } | 58 | } |
52 | 59 | ||
53 | static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte) | 60 | static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte) |
@@ -55,8 +62,9 @@ static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte) | |||
55 | quicklist_free(0, NULL, pte); | 62 | quicklist_free(0, NULL, pte); |
56 | } | 63 | } |
57 | 64 | ||
58 | static inline void pte_free(struct mm_struct *mm, struct page *ptepage) | 65 | static inline void pte_free(struct mm_struct *mm, pgtable_t ptepage) |
59 | { | 66 | { |
67 | pgtable_page_dtor(ptepage); | ||
60 | quicklist_free_page(0, NULL, ptepage); | 68 | quicklist_free_page(0, NULL, ptepage); |
61 | } | 69 | } |
62 | 70 | ||
@@ -64,6 +72,7 @@ static inline void pte_free(struct mm_struct *mm, struct page *ptepage) | |||
64 | #define pmd_populate_kernel(MM, PMD, PTE) pmd_set(PMD, PTE) | 72 | #define pmd_populate_kernel(MM, PMD, PTE) pmd_set(PMD, PTE) |
65 | #define pmd_populate(MM,PMD,PTE_PAGE) \ | 73 | #define pmd_populate(MM,PMD,PTE_PAGE) \ |
66 | pmd_populate_kernel(MM,PMD,page_address(PTE_PAGE)) | 74 | pmd_populate_kernel(MM,PMD,page_address(PTE_PAGE)) |
75 | #define pmd_pgtable(pmd) pmd_page(pmd) | ||
67 | 76 | ||
68 | static inline void check_pgt_cache(void) | 77 | static inline void check_pgt_cache(void) |
69 | { | 78 | { |