aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/powerpc/include/asm/book3s/32/pgalloc.h25
-rw-r--r--arch/powerpc/include/asm/book3s/64/pgalloc.h22
-rw-r--r--arch/powerpc/include/asm/nohash/32/pgalloc.h25
-rw-r--r--arch/powerpc/include/asm/nohash/64/pgalloc.h25
-rw-r--r--arch/powerpc/include/asm/pgalloc.h25
5 files changed, 25 insertions, 97 deletions
diff --git a/arch/powerpc/include/asm/book3s/32/pgalloc.h b/arch/powerpc/include/asm/book3s/32/pgalloc.h
index 0ed856068bb8..46422309d6e0 100644
--- a/arch/powerpc/include/asm/book3s/32/pgalloc.h
+++ b/arch/powerpc/include/asm/book3s/32/pgalloc.h
@@ -59,31 +59,6 @@ static inline void pmd_populate(struct mm_struct *mm, pmd_t *pmdp,
59 59
60#define pmd_pgtable(pmd) ((pgtable_t)pmd_page_vaddr(pmd)) 60#define pmd_pgtable(pmd) ((pgtable_t)pmd_page_vaddr(pmd))
61 61
62pte_t *pte_fragment_alloc(struct mm_struct *mm, int kernel);
63
64static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm)
65{
66 return (pte_t *)pte_fragment_alloc(mm, 1);
67}
68
69static inline pgtable_t pte_alloc_one(struct mm_struct *mm)
70{
71 return (pgtable_t)pte_fragment_alloc(mm, 0);
72}
73
74void pte_frag_destroy(void *pte_frag);
75void pte_fragment_free(unsigned long *table, int kernel);
76
77static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte)
78{
79 pte_fragment_free((unsigned long *)pte, 1);
80}
81
82static inline void pte_free(struct mm_struct *mm, pgtable_t ptepage)
83{
84 pte_fragment_free((unsigned long *)ptepage, 0);
85}
86
87static inline void pgtable_free(void *table, unsigned index_size) 62static inline void pgtable_free(void *table, unsigned index_size)
88{ 63{
89 if (!index_size) { 64 if (!index_size) {
diff --git a/arch/powerpc/include/asm/book3s/64/pgalloc.h b/arch/powerpc/include/asm/book3s/64/pgalloc.h
index 138bc2ecc0c4..cfd48d8cc055 100644
--- a/arch/powerpc/include/asm/book3s/64/pgalloc.h
+++ b/arch/powerpc/include/asm/book3s/64/pgalloc.h
@@ -39,9 +39,7 @@ extern struct vmemmap_backing *vmemmap_list;
39extern struct kmem_cache *pgtable_cache[]; 39extern struct kmem_cache *pgtable_cache[];
40#define PGT_CACHE(shift) pgtable_cache[shift] 40#define PGT_CACHE(shift) pgtable_cache[shift]
41 41
42extern pte_t *pte_fragment_alloc(struct mm_struct *, int);
43extern pmd_t *pmd_fragment_alloc(struct mm_struct *, unsigned long); 42extern pmd_t *pmd_fragment_alloc(struct mm_struct *, unsigned long);
44extern void pte_fragment_free(unsigned long *, int);
45extern void pmd_fragment_free(unsigned long *); 43extern void pmd_fragment_free(unsigned long *);
46extern void pgtable_free_tlb(struct mmu_gather *tlb, void *table, int shift); 44extern void pgtable_free_tlb(struct mmu_gather *tlb, void *table, int shift);
47#ifdef CONFIG_SMP 45#ifdef CONFIG_SMP
@@ -190,26 +188,6 @@ static inline pgtable_t pmd_pgtable(pmd_t pmd)
190 return (pgtable_t)pmd_page_vaddr(pmd); 188 return (pgtable_t)pmd_page_vaddr(pmd);
191} 189}
192 190
193static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm)
194{
195 return (pte_t *)pte_fragment_alloc(mm, 1);
196}
197
198static inline pgtable_t pte_alloc_one(struct mm_struct *mm)
199{
200 return (pgtable_t)pte_fragment_alloc(mm, 0);
201}
202
203static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte)
204{
205 pte_fragment_free((unsigned long *)pte, 1);
206}
207
208static inline void pte_free(struct mm_struct *mm, pgtable_t ptepage)
209{
210 pte_fragment_free((unsigned long *)ptepage, 0);
211}
212
213static inline void __pte_free_tlb(struct mmu_gather *tlb, pgtable_t table, 191static inline void __pte_free_tlb(struct mmu_gather *tlb, pgtable_t table,
214 unsigned long address) 192 unsigned long address)
215{ 193{
diff --git a/arch/powerpc/include/asm/nohash/32/pgalloc.h b/arch/powerpc/include/asm/nohash/32/pgalloc.h
index 1d41508f0676..e96ef2fde2ca 100644
--- a/arch/powerpc/include/asm/nohash/32/pgalloc.h
+++ b/arch/powerpc/include/asm/nohash/32/pgalloc.h
@@ -77,31 +77,6 @@ static inline void pmd_populate(struct mm_struct *mm, pmd_t *pmdp,
77#define pmd_pgtable(pmd) ((pgtable_t)pmd_page_vaddr(pmd)) 77#define pmd_pgtable(pmd) ((pgtable_t)pmd_page_vaddr(pmd))
78#endif 78#endif
79 79
80pte_t *pte_fragment_alloc(struct mm_struct *mm, int kernel);
81
82static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm)
83{
84 return (pte_t *)pte_fragment_alloc(mm, 1);
85}
86
87static inline pgtable_t pte_alloc_one(struct mm_struct *mm)
88{
89 return (pgtable_t)pte_fragment_alloc(mm, 0);
90}
91
92void pte_frag_destroy(void *pte_frag);
93void pte_fragment_free(unsigned long *table, int kernel);
94
95static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte)
96{
97 pte_fragment_free((unsigned long *)pte, 1);
98}
99
100static inline void pte_free(struct mm_struct *mm, pgtable_t ptepage)
101{
102 pte_fragment_free((unsigned long *)ptepage, 0);
103}
104
105static inline void pgtable_free(void *table, unsigned index_size) 80static inline void pgtable_free(void *table, unsigned index_size)
106{ 81{
107 if (!index_size) { 82 if (!index_size) {
diff --git a/arch/powerpc/include/asm/nohash/64/pgalloc.h b/arch/powerpc/include/asm/nohash/64/pgalloc.h
index 7fb87235f845..98de4f3b0306 100644
--- a/arch/powerpc/include/asm/nohash/64/pgalloc.h
+++ b/arch/powerpc/include/asm/nohash/64/pgalloc.h
@@ -92,31 +92,6 @@ static inline void pmd_free(struct mm_struct *mm, pmd_t *pmd)
92 kmem_cache_free(PGT_CACHE(PMD_CACHE_INDEX), pmd); 92 kmem_cache_free(PGT_CACHE(PMD_CACHE_INDEX), pmd);
93} 93}
94 94
95pte_t *pte_fragment_alloc(struct mm_struct *mm, int kernel);
96
97static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm)
98{
99 return (pte_t *)pte_fragment_alloc(mm, 1);
100}
101
102static inline pgtable_t pte_alloc_one(struct mm_struct *mm)
103{
104 return (pgtable_t)pte_fragment_alloc(mm, 0);
105}
106
107void pte_frag_destroy(void *pte_frag);
108void pte_fragment_free(unsigned long *table, int kernel);
109
110static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte)
111{
112 pte_fragment_free((unsigned long *)pte, 1);
113}
114
115static inline void pte_free(struct mm_struct *mm, pgtable_t ptepage)
116{
117 pte_fragment_free((unsigned long *)ptepage, 0);
118}
119
120static inline void pgtable_free(void *table, int shift) 95static inline void pgtable_free(void *table, int shift)
121{ 96{
122 if (!shift) { 97 if (!shift) {
diff --git a/arch/powerpc/include/asm/pgalloc.h b/arch/powerpc/include/asm/pgalloc.h
index e11f03007b57..c2c6fd438840 100644
--- a/arch/powerpc/include/asm/pgalloc.h
+++ b/arch/powerpc/include/asm/pgalloc.h
@@ -20,6 +20,31 @@ static inline gfp_t pgtable_gfp_flags(struct mm_struct *mm, gfp_t gfp)
20 20
21#define PGALLOC_GFP (GFP_KERNEL | __GFP_ZERO) 21#define PGALLOC_GFP (GFP_KERNEL | __GFP_ZERO)
22 22
23pte_t *pte_fragment_alloc(struct mm_struct *mm, int kernel);
24
25static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm)
26{
27 return (pte_t *)pte_fragment_alloc(mm, 1);
28}
29
30static inline pgtable_t pte_alloc_one(struct mm_struct *mm)
31{
32 return (pgtable_t)pte_fragment_alloc(mm, 0);
33}
34
35void pte_frag_destroy(void *pte_frag);
36void pte_fragment_free(unsigned long *table, int kernel);
37
38static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte)
39{
40 pte_fragment_free((unsigned long *)pte, 1);
41}
42
43static inline void pte_free(struct mm_struct *mm, pgtable_t ptepage)
44{
45 pte_fragment_free((unsigned long *)ptepage, 0);
46}
47
23#ifdef CONFIG_PPC_BOOK3S 48#ifdef CONFIG_PPC_BOOK3S
24#include <asm/book3s/pgalloc.h> 49#include <asm/book3s/pgalloc.h>
25#else 50#else