aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/mm/init_64.c
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@samba.org>2005-11-06 22:42:09 -0500
committerPaul Mackerras <paulus@samba.org>2005-11-06 22:42:09 -0500
commitc6135234550ed89a6fd0e8cb229633967e41d649 (patch)
tree22cef33e314839c4fb30d6fc888c0caa2a0f6602 /arch/powerpc/mm/init_64.c
parent76032de898f34db55b5048349db56557828a1390 (diff)
parent0b154bb7d0cce80e9c0bcf11d4f9e71b59409d26 (diff)
Merge ../linux-2.6
Diffstat (limited to 'arch/powerpc/mm/init_64.c')
-rw-r--r--arch/powerpc/mm/init_64.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/arch/powerpc/mm/init_64.c b/arch/powerpc/mm/init_64.c
index aa98b79e734c..ce974c83d88a 100644
--- a/arch/powerpc/mm/init_64.c
+++ b/arch/powerpc/mm/init_64.c
@@ -187,12 +187,21 @@ static void zero_ctor(void *addr, kmem_cache_t *cache, unsigned long flags)
187 memset(addr, 0, kmem_cache_size(cache)); 187 memset(addr, 0, kmem_cache_size(cache));
188} 188}
189 189
190#ifdef CONFIG_PPC_64K_PAGES
191static const int pgtable_cache_size[2] = {
192 PTE_TABLE_SIZE, PGD_TABLE_SIZE
193};
194static const char *pgtable_cache_name[ARRAY_SIZE(pgtable_cache_size)] = {
195 "pte_pmd_cache", "pgd_cache",
196};
197#else
190static const int pgtable_cache_size[2] = { 198static const int pgtable_cache_size[2] = {
191 PTE_TABLE_SIZE, PMD_TABLE_SIZE 199 PTE_TABLE_SIZE, PMD_TABLE_SIZE
192}; 200};
193static const char *pgtable_cache_name[ARRAY_SIZE(pgtable_cache_size)] = { 201static const char *pgtable_cache_name[ARRAY_SIZE(pgtable_cache_size)] = {
194 "pgd_pte_cache", "pud_pmd_cache", 202 "pgd_pte_cache", "pud_pmd_cache",
195}; 203};
204#endif /* CONFIG_PPC_64K_PAGES */
196 205
197kmem_cache_t *pgtable_cache[ARRAY_SIZE(pgtable_cache_size)]; 206kmem_cache_t *pgtable_cache[ARRAY_SIZE(pgtable_cache_size)];
198 207
@@ -200,19 +209,14 @@ void pgtable_cache_init(void)
200{ 209{
201 int i; 210 int i;
202 211
203 BUILD_BUG_ON(PTE_TABLE_SIZE != pgtable_cache_size[PTE_CACHE_NUM]);
204 BUILD_BUG_ON(PMD_TABLE_SIZE != pgtable_cache_size[PMD_CACHE_NUM]);
205 BUILD_BUG_ON(PUD_TABLE_SIZE != pgtable_cache_size[PUD_CACHE_NUM]);
206 BUILD_BUG_ON(PGD_TABLE_SIZE != pgtable_cache_size[PGD_CACHE_NUM]);
207
208 for (i = 0; i < ARRAY_SIZE(pgtable_cache_size); i++) { 212 for (i = 0; i < ARRAY_SIZE(pgtable_cache_size); i++) {
209 int size = pgtable_cache_size[i]; 213 int size = pgtable_cache_size[i];
210 const char *name = pgtable_cache_name[i]; 214 const char *name = pgtable_cache_name[i];
211 215
212 pgtable_cache[i] = kmem_cache_create(name, 216 pgtable_cache[i] = kmem_cache_create(name,
213 size, size, 217 size, size,
214 SLAB_HWCACHE_ALIGN 218 SLAB_HWCACHE_ALIGN |
215 | SLAB_MUST_HWCACHE_ALIGN, 219 SLAB_MUST_HWCACHE_ALIGN,
216 zero_ctor, 220 zero_ctor,
217 NULL); 221 NULL);
218 if (! pgtable_cache[i]) 222 if (! pgtable_cache[i])