aboutsummaryrefslogtreecommitdiffstats
path: root/arch/parisc/mm/init.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-02-26 15:48:06 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-02-26 15:48:06 -0500
commitb0138a6cb7923a997d278b47c176778534d1095b (patch)
tree4fcb8822a69631baba568e4e1942847747123887 /arch/parisc/mm/init.c
parent6572d6d7d0f965dda19d02af804ed3ae4b3bf1fc (diff)
parent1055a8af093fea7490445bd15cd671020e542035 (diff)
Merge master.kernel.org:/pub/scm/linux/kernel/git/kyle/parisc-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/kyle/parisc-2.6: (78 commits) [PARISC] Use symbolic last syscall in __NR_Linux_syscalls [PARISC] Add missing statfs64 and fstatfs64 syscalls Revert "[PARISC] Optimize TLB flush on SMP systems" [PARISC] Compat signal fixes for 64-bit parisc [PARISC] Reorder syscalls to match unistd.h Revert "[PATCH] make kernel/signal.c:kill_proc_info() static" [PARISC] fix sys_rt_sigqueueinfo [PARISC] fix section mismatch warnings in harmony sound driver [PARISC] do not export get_register/set_register [PARISC] add ENTRY()/ENDPROC() and simplify assembly of HP/UX emulation code [PARISC] convert to use CONFIG_64BIT instead of __LP64__ [PARISC] use CONFIG_64BIT instead of __LP64__ [PARISC] add ASM_EXCEPTIONTABLE_ENTRY() macro [PARISC] more ENTRY(), ENDPROC(), END() conversions [PARISC] fix ENTRY() and ENDPROC() for 64bit-parisc [PARISC] Fixes /proc/cpuinfo cache output on B160L [PARISC] implement standard ENTRY(), END() and ENDPROC() [PARISC] kill ENTRY_SYS_CPUS [PARISC] clean up debugging printks in smp.c [PARISC] factor syscall_restart code out of do_signal ... Fix conflict in include/linux/sched.h due to kill_proc_info() being made publicly available to PARISC again.
Diffstat (limited to 'arch/parisc/mm/init.c')
-rw-r--r--arch/parisc/mm/init.c72
1 files changed, 66 insertions, 6 deletions
diff --git a/arch/parisc/mm/init.c b/arch/parisc/mm/init.c
index 12117db0043b..75ea9f2a8a41 100644
--- a/arch/parisc/mm/init.c
+++ b/arch/parisc/mm/init.c
@@ -6,7 +6,7 @@
6 * changed by Philipp Rumpf 6 * changed by Philipp Rumpf
7 * Copyright 1999 Philipp Rumpf (prumpf@tux.org) 7 * Copyright 1999 Philipp Rumpf (prumpf@tux.org)
8 * Copyright 2004 Randolph Chung (tausq@debian.org) 8 * Copyright 2004 Randolph Chung (tausq@debian.org)
9 * Copyright 2006 Helge Deller (deller@gmx.de) 9 * Copyright 2006-2007 Helge Deller (deller@gmx.de)
10 * 10 *
11 */ 11 */
12 12
@@ -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>
@@ -65,11 +66,11 @@ static struct resource sysram_resources[MAX_PHYSMEM_RANGES] __read_mostly;
65physmem_range_t pmem_ranges[MAX_PHYSMEM_RANGES] __read_mostly; 66physmem_range_t pmem_ranges[MAX_PHYSMEM_RANGES] __read_mostly;
66int npmem_ranges __read_mostly; 67int npmem_ranges __read_mostly;
67 68
68#ifdef __LP64__ 69#ifdef CONFIG_64BIT
69#define MAX_MEM (~0UL) 70#define MAX_MEM (~0UL)
70#else /* !__LP64__ */ 71#else /* !CONFIG_64BIT */
71#define MAX_MEM (3584U*1024U*1024U) 72#define MAX_MEM (3584U*1024U*1024U)
72#endif /* !__LP64__ */ 73#endif /* !CONFIG_64BIT */
73 74
74static unsigned long mem_limit __read_mostly = MAX_MEM; 75static unsigned long mem_limit __read_mostly = MAX_MEM;
75 76
@@ -452,6 +453,8 @@ unsigned long pcxl_dma_start __read_mostly;
452 453
453void __init mem_init(void) 454void __init mem_init(void)
454{ 455{
456 int codesize, reservedpages, datasize, initsize;
457
455 high_memory = __va((max_pfn << PAGE_SHIFT)); 458 high_memory = __va((max_pfn << PAGE_SHIFT));
456 459
457#ifndef CONFIG_DISCONTIGMEM 460#ifndef CONFIG_DISCONTIGMEM
@@ -466,7 +469,32 @@ void __init mem_init(void)
466 } 469 }
467#endif 470#endif
468 471
469 printk(KERN_INFO "Memory: %luk available\n", num_physpages << (PAGE_SHIFT-10)); 472 codesize = (unsigned long)_etext - (unsigned long)_text;
473 datasize = (unsigned long)_edata - (unsigned long)_etext;
474 initsize = (unsigned long)__init_end - (unsigned long)__init_begin;
475
476 reservedpages = 0;
477{
478 unsigned long pfn;
479#ifdef CONFIG_DISCONTIGMEM
480 int i;
481
482 for (i = 0; i < npmem_ranges; i++) {
483 for (pfn = node_start_pfn(i); pfn < node_end_pfn(i); pfn++) {
484 if (PageReserved(pfn_to_page(pfn)))
485 reservedpages++;
486 }
487 }
488#else /* !CONFIG_DISCONTIGMEM */
489 for (pfn = 0; pfn < max_pfn; pfn++) {
490 /*
491 * Only count reserved RAM pages
492 */
493 if (PageReserved(pfn_to_page(pfn)))
494 reservedpages++;
495 }
496#endif
497}
470 498
471#ifdef CONFIG_PA11 499#ifdef CONFIG_PA11
472 if (hppa_dma_ops == &pcxl_dma_ops) { 500 if (hppa_dma_ops == &pcxl_dma_ops) {
@@ -480,6 +508,38 @@ void __init mem_init(void)
480 vmalloc_start = SET_MAP_OFFSET(MAP_START); 508 vmalloc_start = SET_MAP_OFFSET(MAP_START);
481#endif 509#endif
482 510
511 printk(KERN_INFO "Memory: %luk/%luk available (%dk kernel code, %dk reserved, %dk data, %dk init)\n",
512 (unsigned long)nr_free_pages() << (PAGE_SHIFT-10),
513 num_physpages << (PAGE_SHIFT-10),
514 codesize >> 10,
515 reservedpages << (PAGE_SHIFT-10),
516 datasize >> 10,
517 initsize >> 10
518 );
519
520#ifdef CONFIG_DEBUG_KERNEL /* double-sanity-check paranoia */
521 printk("virtual kernel memory layout:\n"
522 " vmalloc : 0x%p - 0x%p (%4ld MB)\n"
523 " memory : 0x%p - 0x%p (%4ld MB)\n"
524 " .init : 0x%p - 0x%p (%4ld kB)\n"
525 " .data : 0x%p - 0x%p (%4ld kB)\n"
526 " .text : 0x%p - 0x%p (%4ld kB)\n",
527
528 (void*)VMALLOC_START, (void*)VMALLOC_END,
529 (VMALLOC_END - VMALLOC_START) >> 20,
530
531 __va(0), high_memory,
532 ((unsigned long)high_memory - (unsigned long)__va(0)) >> 20,
533
534 __init_begin, __init_end,
535 ((unsigned long)__init_end - (unsigned long)__init_begin) >> 10,
536
537 _etext, _edata,
538 ((unsigned long)_edata - (unsigned long)_etext) >> 10,
539
540 _text, _etext,
541 ((unsigned long)_etext - (unsigned long)_text) >> 10);
542#endif
483} 543}
484 544
485unsigned long *empty_zero_page __read_mostly; 545unsigned long *empty_zero_page __read_mostly;
@@ -547,7 +607,7 @@ void show_mem(void)
547 607
548 printk("Zone list for zone %d on node %d: ", j, i); 608 printk("Zone list for zone %d on node %d: ", j, i);
549 for (k = 0; zl->zones[k] != NULL; k++) 609 for (k = 0; zl->zones[k] != NULL; k++)
550 printk("[%d/%s] ", zone_to_nid(zl->zones[k]), zl->zones[k]->name); 610 printk("[%ld/%s] ", zone_to_nid(zl->zones[k]), zl->zones[k]->name);
551 printk("\n"); 611 printk("\n");
552 } 612 }
553 } 613 }