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.c64
1 files changed, 62 insertions, 2 deletions
diff --git a/arch/parisc/mm/init.c b/arch/parisc/mm/init.c
index 0667f2b4f977..fc49a5ed78cc 100644
--- a/arch/parisc/mm/init.c
+++ b/arch/parisc/mm/init.c
@@ -24,6 +24,7 @@
24#include <linux/pagemap.h> /* for release_pages and page_cache_release */ 24#include <linux/pagemap.h> /* for release_pages and page_cache_release */
25 25
26#include <asm/pgalloc.h> 26#include <asm/pgalloc.h>
27#include <asm/pgtable.h>
27#include <asm/tlb.h> 28#include <asm/tlb.h>
28#include <asm/pdc_chassis.h> 29#include <asm/pdc_chassis.h>
29#include <asm/mmzone.h> 30#include <asm/mmzone.h>
@@ -453,6 +454,8 @@ unsigned long pcxl_dma_start __read_mostly;
453 454
454void __init mem_init(void) 455void __init mem_init(void)
455{ 456{
457 int codesize, reservedpages, datasize, initsize;
458
456 high_memory = __va((max_pfn << PAGE_SHIFT)); 459 high_memory = __va((max_pfn << PAGE_SHIFT));
457 460
458#ifndef CONFIG_DISCONTIGMEM 461#ifndef CONFIG_DISCONTIGMEM
@@ -467,7 +470,32 @@ void __init mem_init(void)
467 } 470 }
468#endif 471#endif
469 472
470 printk(KERN_INFO "Memory: %luk available\n", num_physpages << (PAGE_SHIFT-10)); 473 codesize = (unsigned long)_etext - (unsigned long)_text;
474 datasize = (unsigned long)_edata - (unsigned long)_etext;
475 initsize = (unsigned long)__init_end - (unsigned long)__init_begin;
476
477 reservedpages = 0;
478{
479 unsigned long pfn;
480#ifdef CONFIG_DISCONTIGMEM
481 int i;
482
483 for (i = 0; i < npmem_ranges; i++) {
484 for (pfn = node_start_pfn(i); pfn < node_end_pfn(i); pfn++) {
485 if (PageReserved(pfn_to_page(pfn)))
486 reservedpages++;
487 }
488 }
489#else /* !CONFIG_DISCONTIGMEM */
490 for (pfn = 0; pfn < max_pfn; pfn++) {
491 /*
492 * Only count reserved RAM pages
493 */
494 if (PageReserved(pfn_to_page(pfn)))
495 reservedpages++;
496 }
497#endif
498}
471 499
472#ifdef CONFIG_PA11 500#ifdef CONFIG_PA11
473 if (hppa_dma_ops == &pcxl_dma_ops) { 501 if (hppa_dma_ops == &pcxl_dma_ops) {
@@ -481,6 +509,38 @@ void __init mem_init(void)
481 vmalloc_start = SET_MAP_OFFSET(MAP_START); 509 vmalloc_start = SET_MAP_OFFSET(MAP_START);
482#endif 510#endif
483 511
512 printk(KERN_INFO "Memory: %luk/%luk available (%dk kernel code, %dk reserved, %dk data, %dk init)\n",
513 (unsigned long)nr_free_pages() << (PAGE_SHIFT-10),
514 num_physpages << (PAGE_SHIFT-10),
515 codesize >> 10,
516 reservedpages << (PAGE_SHIFT-10),
517 datasize >> 10,
518 initsize >> 10
519 );
520
521#ifdef CONFIG_DEBUG_KERNEL /* double-sanity-check paranoia */
522 printk("virtual kernel memory layout:\n"
523 " vmalloc : 0x%p - 0x%p (%4ld MB)\n"
524 " memory : 0x%p - 0x%p (%4ld MB)\n"
525 " .init : 0x%p - 0x%p (%4ld kB)\n"
526 " .data : 0x%p - 0x%p (%4ld kB)\n"
527 " .text : 0x%p - 0x%p (%4ld kB)\n",
528
529 (void*)VMALLOC_START, (void*)VMALLOC_END,
530 (VMALLOC_END - VMALLOC_START) >> 20,
531
532 __va(0), high_memory,
533 ((unsigned long)high_memory - (unsigned long)__va(0)) >> 20,
534
535 __init_begin, __init_end,
536 ((unsigned long)__init_end - (unsigned long)__init_begin) >> 10,
537
538 _etext, _edata,
539 ((unsigned long)_edata - (unsigned long)_etext) >> 10,
540
541 _text, _etext,
542 ((unsigned long)_etext - (unsigned long)_text) >> 10);
543#endif
484} 544}
485 545
486unsigned long *empty_zero_page __read_mostly; 546unsigned long *empty_zero_page __read_mostly;
@@ -548,7 +608,7 @@ void show_mem(void)
548 608
549 printk("Zone list for zone %d on node %d: ", j, i); 609 printk("Zone list for zone %d on node %d: ", j, i);
550 for (k = 0; zl->zones[k] != NULL; k++) 610 for (k = 0; zl->zones[k] != NULL; k++)
551 printk("[%d/%s] ", zone_to_nid(zl->zones[k]), zl->zones[k]->name); 611 printk("[%ld/%s] ", zone_to_nid(zl->zones[k]), zl->zones[k]->name);
552 printk("\n"); 612 printk("\n");
553 } 613 }
554 } 614 }