From ce8420bb65d25335c3b48ddfb1b5a244f53bfb75 Mon Sep 17 00:00:00 2001 From: Helge Deller Date: Sat, 14 Oct 2006 22:10:44 +0200 Subject: [PARISC] Show more memory information and memory layout at bootup Signed-off-by: Helge Deller Signed-off-by: Kyle McMartin --- arch/parisc/mm/init.c | 48 +++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 47 insertions(+), 1 deletion(-) (limited to 'arch/parisc/mm/init.c') diff --git a/arch/parisc/mm/init.c b/arch/parisc/mm/init.c index 0667f2b4f977..d9e4ab545b38 100644 --- a/arch/parisc/mm/init.c +++ b/arch/parisc/mm/init.c @@ -24,6 +24,7 @@ #include /* for release_pages and page_cache_release */ #include +#include #include #include #include @@ -453,6 +454,9 @@ unsigned long pcxl_dma_start __read_mostly; void __init mem_init(void) { + int codesize, reservedpages, datasize, initsize; + int tmp; + high_memory = __va((max_pfn << PAGE_SHIFT)); #ifndef CONFIG_DISCONTIGMEM @@ -466,8 +470,17 @@ void __init mem_init(void) totalram_pages += free_all_bootmem_node(NODE_DATA(i)); } #endif + codesize = (unsigned long) &_etext - (unsigned long) &_text; + datasize = (unsigned long) &_edata - (unsigned long) &_etext; + initsize = (unsigned long) &__init_end - (unsigned long) &__init_begin; - printk(KERN_INFO "Memory: %luk available\n", num_physpages << (PAGE_SHIFT-10)); + reservedpages = 0; + for (tmp = 0; tmp < max_low_pfn; tmp++) + /* + * Only count reserved RAM pages + */ + if (PageReserved(pfn_to_page(tmp))) + reservedpages++; #ifdef CONFIG_PA11 if (hppa_dma_ops == &pcxl_dma_ops) { @@ -481,6 +494,39 @@ void __init mem_init(void) vmalloc_start = SET_MAP_OFFSET(MAP_START); #endif + printk(KERN_INFO "Memory: %luk/%luk available (%dk kernel code, %dk reserved, %dk data, %dk init, %ldk highmem)\n", + (unsigned long) nr_free_pages() << (PAGE_SHIFT-10), + num_physpages << (PAGE_SHIFT-10), + codesize >> 10, + reservedpages << (PAGE_SHIFT-10), + datasize >> 10, + initsize >> 10, + (unsigned long) (totalhigh_pages << (PAGE_SHIFT-10)) + ); + +#ifdef CONFIG_DEBUG_KERNEL /* double-sanity-check paranoia */ + printk("virtual kernel memory layout:\n" + " vmalloc : 0x%p - 0x%p (%4ld MB)\n" + " lowmem : 0x%p - 0x%p (%4ld MB)\n" + " .init : 0x%p - 0x%p (%4ld kB)\n" + " .data : 0x%p - 0x%p (%4ld kB)\n" + " .text : 0x%p - 0x%p (%4ld kB)\n", + + (void*)VMALLOC_START, (void*)VMALLOC_END, + (VMALLOC_END - VMALLOC_START) >> 20, + + __va(0), high_memory, + ((unsigned long)high_memory - (unsigned long)__va(0)) >> 20, + + &__init_begin, &__init_end, + ((unsigned long)&__init_end - (unsigned long)&__init_begin) >> 10, + + &_etext, &_edata, + ((unsigned long)&_edata - (unsigned long)&_etext) >> 10, + + &_text, &_etext, + ((unsigned long)&_etext - (unsigned long)&_text) >> 10); +#endif } unsigned long *empty_zero_page __read_mostly; -- cgit v1.2.3 From 53faf2910d3539a963d171674ad6364ff2854eea Mon Sep 17 00:00:00 2001 From: Kyle McMartin Date: Mon, 16 Oct 2006 20:34:00 -0400 Subject: [PARISC] Unbreak discontigmem mem_init() The `simple' way of walking and checking PageReserved is broken on discontigmem, instead we need to check each range explicitly. (Also rename a few things so they make more sense.) Signed-off-by: Kyle McMartin --- arch/parisc/mm/init.c | 50 ++++++++++++++++++++++++++++++++------------------ 1 file changed, 32 insertions(+), 18 deletions(-) (limited to 'arch/parisc/mm/init.c') diff --git a/arch/parisc/mm/init.c b/arch/parisc/mm/init.c index d9e4ab545b38..1c5fe8f5037b 100644 --- a/arch/parisc/mm/init.c +++ b/arch/parisc/mm/init.c @@ -455,7 +455,6 @@ unsigned long pcxl_dma_start __read_mostly; void __init mem_init(void) { int codesize, reservedpages, datasize, initsize; - int tmp; high_memory = __va((max_pfn << PAGE_SHIFT)); @@ -470,17 +469,33 @@ void __init mem_init(void) totalram_pages += free_all_bootmem_node(NODE_DATA(i)); } #endif - codesize = (unsigned long) &_etext - (unsigned long) &_text; - datasize = (unsigned long) &_edata - (unsigned long) &_etext; - initsize = (unsigned long) &__init_end - (unsigned long) &__init_begin; + + codesize = (unsigned long)_etext - (unsigned long)_text; + datasize = (unsigned long)_edata - (unsigned long)_etext; + initsize = (unsigned long)__init_end - (unsigned long)__init_begin; reservedpages = 0; - for (tmp = 0; tmp < max_low_pfn; tmp++) +{ + unsigned long pfn; +#ifdef CONFIG_DISCONTIGMEM + int i; + + for (i = 0; i < npmem_ranges; i++) { + for (pfn = node_start_pfn(i); pfn < node_end_pfn(i); pfn++) { + if (PageReserved(pfn_to_page(pfn))) + reservedpages++; + } + } +#else /* !CONFIG_DISCONTIGMEM */ + for (pfn = 0; pfn < max_pfn; pfn++) { /* * Only count reserved RAM pages */ - if (PageReserved(pfn_to_page(tmp))) + if (PageReserved(pfn_to_page(pfn))) reservedpages++; + } +#endif +} #ifdef CONFIG_PA11 if (hppa_dma_ops == &pcxl_dma_ops) { @@ -494,20 +509,19 @@ void __init mem_init(void) vmalloc_start = SET_MAP_OFFSET(MAP_START); #endif - printk(KERN_INFO "Memory: %luk/%luk available (%dk kernel code, %dk reserved, %dk data, %dk init, %ldk highmem)\n", - (unsigned long) nr_free_pages() << (PAGE_SHIFT-10), + printk(KERN_INFO "Memory: %luk/%luk available (%dk kernel code, %dk reserved, %dk data, %dk init)\n", + (unsigned long)nr_free_pages() << (PAGE_SHIFT-10), num_physpages << (PAGE_SHIFT-10), codesize >> 10, reservedpages << (PAGE_SHIFT-10), datasize >> 10, - initsize >> 10, - (unsigned long) (totalhigh_pages << (PAGE_SHIFT-10)) - ); + initsize >> 10 + ); #ifdef CONFIG_DEBUG_KERNEL /* double-sanity-check paranoia */ printk("virtual kernel memory layout:\n" " vmalloc : 0x%p - 0x%p (%4ld MB)\n" - " lowmem : 0x%p - 0x%p (%4ld MB)\n" + " memory : 0x%p - 0x%p (%4ld MB)\n" " .init : 0x%p - 0x%p (%4ld kB)\n" " .data : 0x%p - 0x%p (%4ld kB)\n" " .text : 0x%p - 0x%p (%4ld kB)\n", @@ -518,14 +532,14 @@ void __init mem_init(void) __va(0), high_memory, ((unsigned long)high_memory - (unsigned long)__va(0)) >> 20, - &__init_begin, &__init_end, - ((unsigned long)&__init_end - (unsigned long)&__init_begin) >> 10, + __init_begin, __init_end, + ((unsigned long)__init_end - (unsigned long)__init_begin) >> 10, - &_etext, &_edata, - ((unsigned long)&_edata - (unsigned long)&_etext) >> 10, + _etext, _edata, + ((unsigned long)_edata - (unsigned long)_etext) >> 10, - &_text, &_etext, - ((unsigned long)&_etext - (unsigned long)&_text) >> 10); + _text, _etext, + ((unsigned long)_etext - (unsigned long)_text) >> 10); #endif } -- cgit v1.2.3 From be10815f0eeb9578f103b79f696da4548f39e8ad Mon Sep 17 00:00:00 2001 From: Kyle McMartin Date: Sun, 15 Oct 2006 22:40:27 -0400 Subject: [PARISC] bloody printf fmt string warnings Signed-off-by: Kyle McMartin --- arch/parisc/mm/init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch/parisc/mm/init.c') diff --git a/arch/parisc/mm/init.c b/arch/parisc/mm/init.c index 1c5fe8f5037b..fc49a5ed78cc 100644 --- a/arch/parisc/mm/init.c +++ b/arch/parisc/mm/init.c @@ -608,7 +608,7 @@ void show_mem(void) printk("Zone list for zone %d on node %d: ", j, i); for (k = 0; zl->zones[k] != NULL; k++) - printk("[%d/%s] ", zone_to_nid(zl->zones[k]), zl->zones[k]->name); + printk("[%ld/%s] ", zone_to_nid(zl->zones[k]), zl->zones[k]->name); printk("\n"); } } -- cgit v1.2.3 From a8f44e3889b686813926b288bd4e51a0cf17d2c7 Mon Sep 17 00:00:00 2001 From: Helge Deller Date: Sun, 28 Jan 2007 14:58:52 +0100 Subject: [PARISC] use CONFIG_64BIT instead of __LP64__ - additionally update my copyright timestamps Signed-off-by: Helge Deller Signed-off-by: Kyle McMartin --- arch/parisc/mm/init.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'arch/parisc/mm/init.c') diff --git a/arch/parisc/mm/init.c b/arch/parisc/mm/init.c index fc49a5ed78cc..8a3b71a26fde 100644 --- a/arch/parisc/mm/init.c +++ b/arch/parisc/mm/init.c @@ -6,7 +6,7 @@ * changed by Philipp Rumpf * Copyright 1999 Philipp Rumpf (prumpf@tux.org) * Copyright 2004 Randolph Chung (tausq@debian.org) - * Copyright 2006 Helge Deller (deller@gmx.de) + * Copyright 2006-2007 Helge Deller (deller@gmx.de) * */ @@ -66,11 +66,11 @@ static struct resource sysram_resources[MAX_PHYSMEM_RANGES] __read_mostly; physmem_range_t pmem_ranges[MAX_PHYSMEM_RANGES] __read_mostly; int npmem_ranges __read_mostly; -#ifdef __LP64__ +#ifdef CONFIG_64BIT #define MAX_MEM (~0UL) -#else /* !__LP64__ */ +#else /* !CONFIG_64BIT */ #define MAX_MEM (3584U*1024U*1024U) -#endif /* !__LP64__ */ +#endif /* !CONFIG_64BIT */ static unsigned long mem_limit __read_mostly = MAX_MEM; -- cgit v1.2.3