aboutsummaryrefslogtreecommitdiffstats
path: root/arch/parisc/mm/init.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/parisc/mm/init.c')
-rw-r--r--arch/parisc/mm/init.c60
1 files changed, 5 insertions, 55 deletions
diff --git a/arch/parisc/mm/init.c b/arch/parisc/mm/init.c
index 505b56c6b9b9..b0f96c0e6316 100644
--- a/arch/parisc/mm/init.c
+++ b/arch/parisc/mm/init.c
@@ -214,7 +214,6 @@ static void __init setup_bootmem(void)
214 mem_limit_func(); /* check for "mem=" argument */ 214 mem_limit_func(); /* check for "mem=" argument */
215 215
216 mem_max = 0; 216 mem_max = 0;
217 num_physpages = 0;
218 for (i = 0; i < npmem_ranges; i++) { 217 for (i = 0; i < npmem_ranges; i++) {
219 unsigned long rsize; 218 unsigned long rsize;
220 219
@@ -229,10 +228,8 @@ static void __init setup_bootmem(void)
229 npmem_ranges = i + 1; 228 npmem_ranges = i + 1;
230 mem_max = mem_limit; 229 mem_max = mem_limit;
231 } 230 }
232 num_physpages += pmem_ranges[i].pages;
233 break; 231 break;
234 } 232 }
235 num_physpages += pmem_ranges[i].pages;
236 mem_max += rsize; 233 mem_max += rsize;
237 } 234 }
238 235
@@ -532,7 +529,7 @@ void free_initmem(void)
532 * pages are no-longer executable */ 529 * pages are no-longer executable */
533 flush_icache_range(init_begin, init_end); 530 flush_icache_range(init_begin, init_end);
534 531
535 num_physpages += free_initmem_default(0); 532 free_initmem_default(-1);
536 533
537 /* set up a new led state on systems shipped LED State panel */ 534 /* set up a new led state on systems shipped LED State panel */
538 pdc_chassis_send_status(PDC_CHASSIS_DIRECT_BCOMPLETE); 535 pdc_chassis_send_status(PDC_CHASSIS_DIRECT_BCOMPLETE);
@@ -580,8 +577,6 @@ unsigned long pcxl_dma_start __read_mostly;
580 577
581void __init mem_init(void) 578void __init mem_init(void)
582{ 579{
583 int codesize, reservedpages, datasize, initsize;
584
585 /* Do sanity checks on page table constants */ 580 /* Do sanity checks on page table constants */
586 BUILD_BUG_ON(PTE_ENTRY_SIZE != sizeof(pte_t)); 581 BUILD_BUG_ON(PTE_ENTRY_SIZE != sizeof(pte_t));
587 BUILD_BUG_ON(PMD_ENTRY_SIZE != sizeof(pmd_t)); 582 BUILD_BUG_ON(PMD_ENTRY_SIZE != sizeof(pmd_t));
@@ -590,45 +585,8 @@ void __init mem_init(void)
590 > BITS_PER_LONG); 585 > BITS_PER_LONG);
591 586
592 high_memory = __va((max_pfn << PAGE_SHIFT)); 587 high_memory = __va((max_pfn << PAGE_SHIFT));
593 588 set_max_mapnr(page_to_pfn(virt_to_page(high_memory - 1)) + 1);
594#ifndef CONFIG_DISCONTIGMEM 589 free_all_bootmem();
595 max_mapnr = page_to_pfn(virt_to_page(high_memory - 1)) + 1;
596 totalram_pages += free_all_bootmem();
597#else
598 {
599 int i;
600
601 for (i = 0; i < npmem_ranges; i++)
602 totalram_pages += free_all_bootmem_node(NODE_DATA(i));
603 }
604#endif
605
606 codesize = (unsigned long)_etext - (unsigned long)_text;
607 datasize = (unsigned long)_edata - (unsigned long)_etext;
608 initsize = (unsigned long)__init_end - (unsigned long)__init_begin;
609
610 reservedpages = 0;
611{
612 unsigned long pfn;
613#ifdef CONFIG_DISCONTIGMEM
614 int i;
615
616 for (i = 0; i < npmem_ranges; i++) {
617 for (pfn = node_start_pfn(i); pfn < node_end_pfn(i); pfn++) {
618 if (PageReserved(pfn_to_page(pfn)))
619 reservedpages++;
620 }
621 }
622#else /* !CONFIG_DISCONTIGMEM */
623 for (pfn = 0; pfn < max_pfn; pfn++) {
624 /*
625 * Only count reserved RAM pages
626 */
627 if (PageReserved(pfn_to_page(pfn)))
628 reservedpages++;
629 }
630#endif
631}
632 590
633#ifdef CONFIG_PA11 591#ifdef CONFIG_PA11
634 if (hppa_dma_ops == &pcxl_dma_ops) { 592 if (hppa_dma_ops == &pcxl_dma_ops) {
@@ -643,15 +601,7 @@ void __init mem_init(void)
643 parisc_vmalloc_start = SET_MAP_OFFSET(MAP_START); 601 parisc_vmalloc_start = SET_MAP_OFFSET(MAP_START);
644#endif 602#endif
645 603
646 printk(KERN_INFO "Memory: %luk/%luk available (%dk kernel code, %dk reserved, %dk data, %dk init)\n", 604 mem_init_print_info(NULL);
647 nr_free_pages() << (PAGE_SHIFT-10),
648 num_physpages << (PAGE_SHIFT-10),
649 codesize >> 10,
650 reservedpages << (PAGE_SHIFT-10),
651 datasize >> 10,
652 initsize >> 10
653 );
654
655#ifdef CONFIG_DEBUG_KERNEL /* double-sanity-check paranoia */ 605#ifdef CONFIG_DEBUG_KERNEL /* double-sanity-check paranoia */
656 printk("virtual kernel memory layout:\n" 606 printk("virtual kernel memory layout:\n"
657 " vmalloc : 0x%p - 0x%p (%4ld MB)\n" 607 " vmalloc : 0x%p - 0x%p (%4ld MB)\n"
@@ -1101,6 +1051,6 @@ void flush_tlb_all(void)
1101#ifdef CONFIG_BLK_DEV_INITRD 1051#ifdef CONFIG_BLK_DEV_INITRD
1102void free_initrd_mem(unsigned long start, unsigned long end) 1052void free_initrd_mem(unsigned long start, unsigned long end)
1103{ 1053{
1104 num_physpages += free_reserved_area(start, end, 0, "initrd"); 1054 free_reserved_area((void *)start, (void *)end, -1, "initrd");
1105} 1055}
1106#endif 1056#endif