aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/mm
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/mm')
-rw-r--r--arch/powerpc/mm/pgtable_32.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/arch/powerpc/mm/pgtable_32.c b/arch/powerpc/mm/pgtable_32.c
index f80f90c4d58b..ac3390f81900 100644
--- a/arch/powerpc/mm/pgtable_32.c
+++ b/arch/powerpc/mm/pgtable_32.c
@@ -107,19 +107,20 @@ __init_refok pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long add
107 return pte; 107 return pte;
108} 108}
109 109
110struct page *pte_alloc_one(struct mm_struct *mm, unsigned long address) 110pgtable_t pte_alloc_one(struct mm_struct *mm, unsigned long address)
111{ 111{
112 struct page *ptepage; 112 struct page *ptepage;
113 113
114#ifdef CONFIG_HIGHPTE 114#ifdef CONFIG_HIGHPTE
115 gfp_t flags = GFP_KERNEL | __GFP_HIGHMEM | __GFP_REPEAT; 115 gfp_t flags = GFP_KERNEL | __GFP_HIGHMEM | __GFP_REPEAT | __GFP_ZERO;
116#else 116#else
117 gfp_t flags = GFP_KERNEL | __GFP_REPEAT; 117 gfp_t flags = GFP_KERNEL | __GFP_REPEAT | __GFP_ZERO;
118#endif 118#endif
119 119
120 ptepage = alloc_pages(flags, 0); 120 ptepage = alloc_pages(flags, 0);
121 if (ptepage) 121 if (!ptepage)
122 clear_highpage(ptepage); 122 return NULL;
123 pgtable_page_ctor(ptepage);
123 return ptepage; 124 return ptepage;
124} 125}
125 126
@@ -131,11 +132,12 @@ void pte_free_kernel(struct mm_struct *mm, pte_t *pte)
131 free_page((unsigned long)pte); 132 free_page((unsigned long)pte);
132} 133}
133 134
134void pte_free(struct mm_struct *mm, struct page *ptepage) 135void pte_free(struct mm_struct *mm, pgtable_t ptepage)
135{ 136{
136#ifdef CONFIG_SMP 137#ifdef CONFIG_SMP
137 hash_page_sync(); 138 hash_page_sync();
138#endif 139#endif
140 pgtable_page_dtor(ptepage);
139 __free_page(ptepage); 141 __free_page(ptepage);
140} 142}
141 143