aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ppc64/mm
diff options
context:
space:
mode:
authorAndy Whitcroft <apw@shadowen.org>2005-06-23 03:08:03 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-06-23 12:45:06 -0400
commit145e664231648121026d470094c200851a446a73 (patch)
treec9362f4ec3e3114afb9b7134ae89152cbbc73cd4 /arch/ppc64/mm
parent74b30be2e183bd9a12d0350698996e3d1969f290 (diff)
[PATCH] ppc64: sparsemem memory model
Provide the architecture specific implementation for SPARSEMEM for PPC64 systems. Signed-off-by: Andy Whitcroft <apw@shadowen.org> Signed-off-by: Dave Hansen <haveblue@us.ibm.com> Signed-off-by: Mike Kravetz <kravetz@us.ibm.com> (in part) Signed-off-by: Martin Bligh <mbligh@aracnet.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/ppc64/mm')
-rw-r--r--arch/ppc64/mm/Makefile2
-rw-r--r--arch/ppc64/mm/init.c18
2 files changed, 14 insertions, 6 deletions
diff --git a/arch/ppc64/mm/Makefile b/arch/ppc64/mm/Makefile
index ac522d57b2a7..3695d00d347f 100644
--- a/arch/ppc64/mm/Makefile
+++ b/arch/ppc64/mm/Makefile
@@ -6,6 +6,6 @@ EXTRA_CFLAGS += -mno-minimal-toc
6 6
7obj-y := fault.o init.o imalloc.o hash_utils.o hash_low.o tlb.o \ 7obj-y := fault.o init.o imalloc.o hash_utils.o hash_low.o tlb.o \
8 slb_low.o slb.o stab.o mmap.o 8 slb_low.o slb.o stab.o mmap.o
9obj-$(CONFIG_DISCONTIGMEM) += numa.o 9obj-$(CONFIG_NEED_MULTIPLE_NODES) += numa.o
10obj-$(CONFIG_HUGETLB_PAGE) += hugetlbpage.o 10obj-$(CONFIG_HUGETLB_PAGE) += hugetlbpage.o
11obj-$(CONFIG_PPC_MULTIPLATFORM) += hash_native.o 11obj-$(CONFIG_PPC_MULTIPLATFORM) += hash_native.o
diff --git a/arch/ppc64/mm/init.c b/arch/ppc64/mm/init.c
index 29dbe084c21f..b50b3a446dbe 100644
--- a/arch/ppc64/mm/init.c
+++ b/arch/ppc64/mm/init.c
@@ -531,7 +531,7 @@ EXPORT_SYMBOL(page_is_ram);
531 * Initialize the bootmem system and give it all the memory we 531 * Initialize the bootmem system and give it all the memory we
532 * have available. 532 * have available.
533 */ 533 */
534#ifndef CONFIG_DISCONTIGMEM 534#ifndef CONFIG_NEED_MULTIPLE_NODES
535void __init do_init_bootmem(void) 535void __init do_init_bootmem(void)
536{ 536{
537 unsigned long i; 537 unsigned long i;
@@ -553,12 +553,20 @@ void __init do_init_bootmem(void)
553 553
554 max_pfn = max_low_pfn; 554 max_pfn = max_low_pfn;
555 555
556 /* add all physical memory to the bootmem map. Also find the first */ 556 /* Add all physical memory to the bootmem map, mark each area
557 * present.
558 */
557 for (i=0; i < lmb.memory.cnt; i++) { 559 for (i=0; i < lmb.memory.cnt; i++) {
558 unsigned long physbase, size; 560 unsigned long physbase, size;
561 unsigned long start_pfn, end_pfn;
559 562
560 physbase = lmb.memory.region[i].physbase; 563 physbase = lmb.memory.region[i].physbase;
561 size = lmb.memory.region[i].size; 564 size = lmb.memory.region[i].size;
565
566 start_pfn = physbase >> PAGE_SHIFT;
567 end_pfn = start_pfn + (size >> PAGE_SHIFT);
568 memory_present(0, start_pfn, end_pfn);
569
562 free_bootmem(physbase, size); 570 free_bootmem(physbase, size);
563 } 571 }
564 572
@@ -597,7 +605,7 @@ void __init paging_init(void)
597 free_area_init_node(0, NODE_DATA(0), zones_size, 605 free_area_init_node(0, NODE_DATA(0), zones_size,
598 __pa(PAGE_OFFSET) >> PAGE_SHIFT, zholes_size); 606 __pa(PAGE_OFFSET) >> PAGE_SHIFT, zholes_size);
599} 607}
600#endif /* CONFIG_DISCONTIGMEM */ 608#endif /* ! CONFIG_NEED_MULTIPLE_NODES */
601 609
602static struct kcore_list kcore_vmem; 610static struct kcore_list kcore_vmem;
603 611
@@ -628,7 +636,7 @@ module_init(setup_kcore);
628 636
629void __init mem_init(void) 637void __init mem_init(void)
630{ 638{
631#ifdef CONFIG_DISCONTIGMEM 639#ifdef CONFIG_NEED_MULTIPLE_NODES
632 int nid; 640 int nid;
633#endif 641#endif
634 pg_data_t *pgdat; 642 pg_data_t *pgdat;
@@ -639,7 +647,7 @@ void __init mem_init(void)
639 num_physpages = max_low_pfn; /* RAM is assumed contiguous */ 647 num_physpages = max_low_pfn; /* RAM is assumed contiguous */
640 high_memory = (void *) __va(max_low_pfn * PAGE_SIZE); 648 high_memory = (void *) __va(max_low_pfn * PAGE_SIZE);
641 649
642#ifdef CONFIG_DISCONTIGMEM 650#ifdef CONFIG_NEED_MULTIPLE_NODES
643 for_each_online_node(nid) { 651 for_each_online_node(nid) {
644 if (NODE_DATA(nid)->node_spanned_pages != 0) { 652 if (NODE_DATA(nid)->node_spanned_pages != 0) {
645 printk("freeing bootmem node %x\n", nid); 653 printk("freeing bootmem node %x\n", nid);