diff options
Diffstat (limited to 'arch/mips/mm')
-rw-r--r-- | arch/mips/mm/cache.c | 2 | ||||
-rw-r--r-- | arch/mips/mm/init.c | 50 |
2 files changed, 28 insertions, 24 deletions
diff --git a/arch/mips/mm/cache.c b/arch/mips/mm/cache.c index 1f954a238a63..31819c58bffa 100644 --- a/arch/mips/mm/cache.c +++ b/arch/mips/mm/cache.c | |||
@@ -107,8 +107,6 @@ void __update_cache(struct vm_area_struct *vma, unsigned long address, | |||
107 | } | 107 | } |
108 | } | 108 | } |
109 | 109 | ||
110 | #define __weak __attribute__((weak)) | ||
111 | |||
112 | static char cache_panic[] __initdata = "Yeee, unsupported cache architecture."; | 110 | static char cache_panic[] __initdata = "Yeee, unsupported cache architecture."; |
113 | 111 | ||
114 | void __init cpu_cache_init(void) | 112 | void __init cpu_cache_init(void) |
diff --git a/arch/mips/mm/init.c b/arch/mips/mm/init.c index 49065c133ebf..125a4a85ec05 100644 --- a/arch/mips/mm/init.c +++ b/arch/mips/mm/init.c | |||
@@ -341,7 +341,6 @@ static int __init page_is_ram(unsigned long pagenr) | |||
341 | void __init paging_init(void) | 341 | void __init paging_init(void) |
342 | { | 342 | { |
343 | unsigned long zones_size[MAX_NR_ZONES] = { 0, }; | 343 | unsigned long zones_size[MAX_NR_ZONES] = { 0, }; |
344 | unsigned long max_dma, low; | ||
345 | #ifndef CONFIG_FLATMEM | 344 | #ifndef CONFIG_FLATMEM |
346 | unsigned long zholes_size[MAX_NR_ZONES] = { 0, }; | 345 | unsigned long zholes_size[MAX_NR_ZONES] = { 0, }; |
347 | unsigned long i, j, pfn; | 346 | unsigned long i, j, pfn; |
@@ -354,19 +353,19 @@ void __init paging_init(void) | |||
354 | #endif | 353 | #endif |
355 | kmap_coherent_init(); | 354 | kmap_coherent_init(); |
356 | 355 | ||
357 | max_dma = virt_to_phys((char *)MAX_DMA_ADDRESS) >> PAGE_SHIFT; | ||
358 | low = max_low_pfn; | ||
359 | |||
360 | #ifdef CONFIG_ISA | 356 | #ifdef CONFIG_ISA |
361 | if (low < max_dma) | 357 | if (max_low_pfn >= MAX_DMA_PFN) |
362 | zones_size[ZONE_DMA] = low; | 358 | if (min_low_pfn >= MAX_DMA_PFN) { |
363 | else { | 359 | zones_size[ZONE_DMA] = 0; |
364 | zones_size[ZONE_DMA] = max_dma; | 360 | zones_size[ZONE_NORMAL] = max_low_pfn - min_low_pfn; |
365 | zones_size[ZONE_NORMAL] = low - max_dma; | 361 | } else { |
366 | } | 362 | zones_size[ZONE_DMA] = MAX_DMA_PFN - min_low_pfn; |
367 | #else | 363 | zones_size[ZONE_NORMAL] = max_low_pfn - MAX_DMA_PFN; |
368 | zones_size[ZONE_DMA] = low; | 364 | } |
365 | else | ||
369 | #endif | 366 | #endif |
367 | zones_size[ZONE_DMA] = max_low_pfn - min_low_pfn; | ||
368 | |||
370 | #ifdef CONFIG_HIGHMEM | 369 | #ifdef CONFIG_HIGHMEM |
371 | zones_size[ZONE_HIGHMEM] = highend_pfn - highstart_pfn; | 370 | zones_size[ZONE_HIGHMEM] = highend_pfn - highstart_pfn; |
372 | 371 | ||
@@ -467,7 +466,7 @@ void __init mem_init(void) | |||
467 | } | 466 | } |
468 | #endif /* !CONFIG_NEED_MULTIPLE_NODES */ | 467 | #endif /* !CONFIG_NEED_MULTIPLE_NODES */ |
469 | 468 | ||
470 | static void free_init_pages(char *what, unsigned long begin, unsigned long end) | 469 | void free_init_pages(const char *what, unsigned long begin, unsigned long end) |
471 | { | 470 | { |
472 | unsigned long pfn; | 471 | unsigned long pfn; |
473 | 472 | ||
@@ -493,18 +492,25 @@ void free_initrd_mem(unsigned long start, unsigned long end) | |||
493 | } | 492 | } |
494 | #endif | 493 | #endif |
495 | 494 | ||
496 | extern unsigned long prom_free_prom_memory(void); | ||
497 | |||
498 | void free_initmem(void) | 495 | void free_initmem(void) |
499 | { | 496 | { |
500 | unsigned long freed; | 497 | prom_free_prom_memory(); |
501 | |||
502 | freed = prom_free_prom_memory(); | ||
503 | if (freed) | ||
504 | printk(KERN_INFO "Freeing firmware memory: %ldkb freed\n", | ||
505 | freed >> 10); | ||
506 | |||
507 | free_init_pages("unused kernel memory", | 498 | free_init_pages("unused kernel memory", |
508 | __pa_symbol(&__init_begin), | 499 | __pa_symbol(&__init_begin), |
509 | __pa_symbol(&__init_end)); | 500 | __pa_symbol(&__init_end)); |
510 | } | 501 | } |
502 | |||
503 | unsigned long pgd_current[NR_CPUS]; | ||
504 | /* | ||
505 | * On 64-bit we've got three-level pagetables with a slightly | ||
506 | * different layout ... | ||
507 | */ | ||
508 | #define __page_aligned(order) __attribute__((__aligned__(PAGE_SIZE<<order))) | ||
509 | pgd_t swapper_pg_dir[PTRS_PER_PGD] __page_aligned(PGD_ORDER); | ||
510 | #ifdef CONFIG_64BIT | ||
511 | #ifdef MODULE_START | ||
512 | pgd_t module_pg_dir[PTRS_PER_PGD] __page_aligned(PGD_ORDER); | ||
513 | #endif | ||
514 | pmd_t invalid_pmd_table[PTRS_PER_PMD] __page_aligned(PMD_ORDER); | ||
515 | #endif | ||
516 | pte_t invalid_pte_table[PTRS_PER_PTE] __page_aligned(PTE_ORDER); | ||