aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ppc64/mm/init.c
diff options
context:
space:
mode:
authorJeff Garzik <jgarzik@pobox.com>2005-08-10 13:46:28 -0400
committerJeff Garzik <jgarzik@pobox.com>2005-08-10 13:46:28 -0400
commit2f058256cb64e346f4fb4499ff4e0f1c2791a4b4 (patch)
tree91e06602f4d3abb6812ea8c9bc9ba4501e14c84e /arch/ppc64/mm/init.c
parent0274aa2506fd2fe89a58dd6cd64d3b3f7b976af8 (diff)
parent86b3786078d63242d3194ffc58ae8dae1d1bbef3 (diff)
Merge /spare/repo/linux-2.6/
Diffstat (limited to 'arch/ppc64/mm/init.c')
-rw-r--r--arch/ppc64/mm/init.c29
1 files changed, 19 insertions, 10 deletions
diff --git a/arch/ppc64/mm/init.c b/arch/ppc64/mm/init.c
index 6fa1e6490b57..e58a24d42879 100644
--- a/arch/ppc64/mm/init.c
+++ b/arch/ppc64/mm/init.c
@@ -98,7 +98,7 @@ void show_mem(void)
98 printk("Free swap: %6ldkB\n", nr_swap_pages<<(PAGE_SHIFT-10)); 98 printk("Free swap: %6ldkB\n", nr_swap_pages<<(PAGE_SHIFT-10));
99 for_each_pgdat(pgdat) { 99 for_each_pgdat(pgdat) {
100 for (i = 0; i < pgdat->node_spanned_pages; i++) { 100 for (i = 0; i < pgdat->node_spanned_pages; i++) {
101 page = pgdat->node_mem_map + i; 101 page = pgdat_page_nr(pgdat, i);
102 total++; 102 total++;
103 if (PageReserved(page)) 103 if (PageReserved(page))
104 reserved++; 104 reserved++;
@@ -180,9 +180,10 @@ static int map_io_page(unsigned long ea, unsigned long pa, int flags)
180 hpteg = ((hash & htab_hash_mask) * HPTES_PER_GROUP); 180 hpteg = ((hash & htab_hash_mask) * HPTES_PER_GROUP);
181 181
182 /* Panic if a pte grpup is full */ 182 /* Panic if a pte grpup is full */
183 if (ppc_md.hpte_insert(hpteg, va, pa >> PAGE_SHIFT, 0, 183 if (ppc_md.hpte_insert(hpteg, va, pa >> PAGE_SHIFT,
184 _PAGE_NO_CACHE|_PAGE_GUARDED|PP_RWXX, 184 HPTE_V_BOLTED,
185 1, 0) == -1) { 185 _PAGE_NO_CACHE|_PAGE_GUARDED|PP_RWXX)
186 == -1) {
186 panic("map_io_page: could not insert mapping"); 187 panic("map_io_page: could not insert mapping");
187 } 188 }
188 } 189 }
@@ -531,7 +532,7 @@ EXPORT_SYMBOL(page_is_ram);
531 * Initialize the bootmem system and give it all the memory we 532 * Initialize the bootmem system and give it all the memory we
532 * have available. 533 * have available.
533 */ 534 */
534#ifndef CONFIG_DISCONTIGMEM 535#ifndef CONFIG_NEED_MULTIPLE_NODES
535void __init do_init_bootmem(void) 536void __init do_init_bootmem(void)
536{ 537{
537 unsigned long i; 538 unsigned long i;
@@ -553,12 +554,20 @@ void __init do_init_bootmem(void)
553 554
554 max_pfn = max_low_pfn; 555 max_pfn = max_low_pfn;
555 556
556 /* add all physical memory to the bootmem map. Also find the first */ 557 /* Add all physical memory to the bootmem map, mark each area
558 * present.
559 */
557 for (i=0; i < lmb.memory.cnt; i++) { 560 for (i=0; i < lmb.memory.cnt; i++) {
558 unsigned long physbase, size; 561 unsigned long physbase, size;
562 unsigned long start_pfn, end_pfn;
559 563
560 physbase = lmb.memory.region[i].physbase; 564 physbase = lmb.memory.region[i].physbase;
561 size = lmb.memory.region[i].size; 565 size = lmb.memory.region[i].size;
566
567 start_pfn = physbase >> PAGE_SHIFT;
568 end_pfn = start_pfn + (size >> PAGE_SHIFT);
569 memory_present(0, start_pfn, end_pfn);
570
562 free_bootmem(physbase, size); 571 free_bootmem(physbase, size);
563 } 572 }
564 573
@@ -597,7 +606,7 @@ void __init paging_init(void)
597 free_area_init_node(0, NODE_DATA(0), zones_size, 606 free_area_init_node(0, NODE_DATA(0), zones_size,
598 __pa(PAGE_OFFSET) >> PAGE_SHIFT, zholes_size); 607 __pa(PAGE_OFFSET) >> PAGE_SHIFT, zholes_size);
599} 608}
600#endif /* CONFIG_DISCONTIGMEM */ 609#endif /* ! CONFIG_NEED_MULTIPLE_NODES */
601 610
602static struct kcore_list kcore_vmem; 611static struct kcore_list kcore_vmem;
603 612
@@ -628,7 +637,7 @@ module_init(setup_kcore);
628 637
629void __init mem_init(void) 638void __init mem_init(void)
630{ 639{
631#ifdef CONFIG_DISCONTIGMEM 640#ifdef CONFIG_NEED_MULTIPLE_NODES
632 int nid; 641 int nid;
633#endif 642#endif
634 pg_data_t *pgdat; 643 pg_data_t *pgdat;
@@ -639,7 +648,7 @@ void __init mem_init(void)
639 num_physpages = max_low_pfn; /* RAM is assumed contiguous */ 648 num_physpages = max_low_pfn; /* RAM is assumed contiguous */
640 high_memory = (void *) __va(max_low_pfn * PAGE_SIZE); 649 high_memory = (void *) __va(max_low_pfn * PAGE_SIZE);
641 650
642#ifdef CONFIG_DISCONTIGMEM 651#ifdef CONFIG_NEED_MULTIPLE_NODES
643 for_each_online_node(nid) { 652 for_each_online_node(nid) {
644 if (NODE_DATA(nid)->node_spanned_pages != 0) { 653 if (NODE_DATA(nid)->node_spanned_pages != 0) {
645 printk("freeing bootmem node %x\n", nid); 654 printk("freeing bootmem node %x\n", nid);
@@ -654,7 +663,7 @@ void __init mem_init(void)
654 663
655 for_each_pgdat(pgdat) { 664 for_each_pgdat(pgdat) {
656 for (i = 0; i < pgdat->node_spanned_pages; i++) { 665 for (i = 0; i < pgdat->node_spanned_pages; i++) {
657 page = pgdat->node_mem_map + i; 666 page = pgdat_page_nr(pgdat, i);
658 if (PageReserved(page)) 667 if (PageReserved(page))
659 reservedpages++; 668 reservedpages++;
660 } 669 }