diff options
Diffstat (limited to 'arch/mips/mm/init.c')
| -rw-r--r-- | arch/mips/mm/init.c | 43 |
1 files changed, 16 insertions, 27 deletions
diff --git a/arch/mips/mm/init.c b/arch/mips/mm/init.c index ec3b9e9f30f4..480dec04f552 100644 --- a/arch/mips/mm/init.c +++ b/arch/mips/mm/init.c | |||
| @@ -347,11 +347,8 @@ static int __init page_is_ram(unsigned long pagenr) | |||
| 347 | 347 | ||
| 348 | void __init paging_init(void) | 348 | void __init paging_init(void) |
| 349 | { | 349 | { |
| 350 | unsigned long zones_size[MAX_NR_ZONES] = { 0, }; | 350 | unsigned long max_zone_pfns[MAX_NR_ZONES]; |
| 351 | #ifndef CONFIG_FLATMEM | 351 | unsigned long lastpfn; |
| 352 | unsigned long zholes_size[MAX_NR_ZONES] = { 0, }; | ||
| 353 | unsigned long i, j, pfn; | ||
| 354 | #endif | ||
| 355 | 352 | ||
| 356 | pagetable_init(); | 353 | pagetable_init(); |
| 357 | 354 | ||
| @@ -361,35 +358,27 @@ void __init paging_init(void) | |||
| 361 | kmap_coherent_init(); | 358 | kmap_coherent_init(); |
| 362 | 359 | ||
| 363 | #ifdef CONFIG_ZONE_DMA | 360 | #ifdef CONFIG_ZONE_DMA |
| 364 | if (min_low_pfn < MAX_DMA_PFN && MAX_DMA_PFN <= max_low_pfn) { | 361 | max_zone_pfns[ZONE_DMA] = MAX_DMA_PFN; |
| 365 | zones_size[ZONE_DMA] = MAX_DMA_PFN - min_low_pfn; | ||
| 366 | zones_size[ZONE_NORMAL] = max_low_pfn - MAX_DMA_PFN; | ||
| 367 | } else if (max_low_pfn < MAX_DMA_PFN) | ||
| 368 | zones_size[ZONE_DMA] = max_low_pfn - min_low_pfn; | ||
| 369 | else | ||
| 370 | #endif | 362 | #endif |
| 371 | zones_size[ZONE_NORMAL] = max_low_pfn - min_low_pfn; | 363 | #ifdef CONFIG_ZONE_DMA32 |
| 372 | 364 | max_zone_pfns[ZONE_DMA32] = MAX_DMA32_PFN; | |
| 365 | #endif | ||
| 366 | max_zone_pfns[ZONE_NORMAL] = max_low_pfn; | ||
| 367 | lastpfn = max_low_pfn; | ||
| 373 | #ifdef CONFIG_HIGHMEM | 368 | #ifdef CONFIG_HIGHMEM |
| 374 | zones_size[ZONE_HIGHMEM] = highend_pfn - highstart_pfn; | 369 | max_zone_pfns[ZONE_HIGHMEM] = highend_pfn; |
| 370 | lastpfn = highend_pfn; | ||
| 375 | 371 | ||
| 376 | if (cpu_has_dc_aliases && zones_size[ZONE_HIGHMEM]) { | 372 | if (cpu_has_dc_aliases && max_low_pfn != highend_pfn) { |
| 377 | printk(KERN_WARNING "This processor doesn't support highmem." | 373 | printk(KERN_WARNING "This processor doesn't support highmem." |
| 378 | " %ldk highmem ignored\n", zones_size[ZONE_HIGHMEM]); | 374 | " %ldk highmem ignored\n", |
| 379 | zones_size[ZONE_HIGHMEM] = 0; | 375 | (highend_pfn - max_low_pfn) << (PAGE_SHIFT - 10)); |
| 376 | max_zone_pfns[ZONE_HIGHMEM] = max_low_pfn; | ||
| 377 | lastpfn = max_low_pfn; | ||
| 380 | } | 378 | } |
| 381 | #endif | 379 | #endif |
| 382 | 380 | ||
| 383 | #ifdef CONFIG_FLATMEM | 381 | free_area_init_nodes(max_zone_pfns); |
| 384 | free_area_init(zones_size); | ||
| 385 | #else | ||
| 386 | pfn = min_low_pfn; | ||
| 387 | for (i = 0; i < MAX_NR_ZONES; i++) | ||
| 388 | for (j = 0; j < zones_size[i]; j++, pfn++) | ||
| 389 | if (!page_is_ram(pfn)) | ||
| 390 | zholes_size[i]++; | ||
| 391 | free_area_init_node(0, NODE_DATA(0), zones_size, 0, zholes_size); | ||
| 392 | #endif | ||
| 393 | } | 382 | } |
| 394 | 383 | ||
| 395 | static struct kcore_list kcore_mem, kcore_vmalloc; | 384 | static struct kcore_list kcore_mem, kcore_vmalloc; |
