diff options
author | Michael Ellerman <michael@ellerman.id.au> | 2005-08-03 06:21:26 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2005-08-28 20:53:37 -0400 |
commit | 180379dcefb39e8bd05d562b0685e9084dffcc0a (patch) | |
tree | d4a3f2bec69481d3f21903b5bee7c2d1a5e86c16 /arch | |
parent | e88bcd1b29f63738b702e57d831758706162347e (diff) |
[PATCH] ppc64: Remove physbase from the lmb_property struct
We no longer need the lmb code to know about abs and phys addresses, so
remove the physbase variable from the lmb_property struct.
Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/ppc64/kernel/lmb.c | 23 | ||||
-rw-r--r-- | arch/ppc64/mm/hash_utils.c | 2 | ||||
-rw-r--r-- | arch/ppc64/mm/init.c | 27 | ||||
-rw-r--r-- | arch/ppc64/mm/numa.c | 2 |
4 files changed, 14 insertions, 40 deletions
diff --git a/arch/ppc64/kernel/lmb.c b/arch/ppc64/kernel/lmb.c index 111da736652..6ed6312d848 100644 --- a/arch/ppc64/kernel/lmb.c +++ b/arch/ppc64/kernel/lmb.c | |||
@@ -37,8 +37,6 @@ void lmb_dump_all(void) | |||
37 | for (i=0; i < lmb.memory.cnt ;i++) { | 37 | for (i=0; i < lmb.memory.cnt ;i++) { |
38 | udbg_printf(" memory.region[0x%x].base = 0x%lx\n", | 38 | udbg_printf(" memory.region[0x%x].base = 0x%lx\n", |
39 | i, lmb.memory.region[i].base); | 39 | i, lmb.memory.region[i].base); |
40 | udbg_printf(" .physbase = 0x%lx\n", | ||
41 | lmb.memory.region[i].physbase); | ||
42 | udbg_printf(" .size = 0x%lx\n", | 40 | udbg_printf(" .size = 0x%lx\n", |
43 | lmb.memory.region[i].size); | 41 | lmb.memory.region[i].size); |
44 | } | 42 | } |
@@ -50,8 +48,6 @@ void lmb_dump_all(void) | |||
50 | for (i=0; i < lmb.reserved.cnt ;i++) { | 48 | for (i=0; i < lmb.reserved.cnt ;i++) { |
51 | udbg_printf(" reserved.region[0x%x].base = 0x%lx\n", | 49 | udbg_printf(" reserved.region[0x%x].base = 0x%lx\n", |
52 | i, lmb.reserved.region[i].base); | 50 | i, lmb.reserved.region[i].base); |
53 | udbg_printf(" .physbase = 0x%lx\n", | ||
54 | lmb.reserved.region[i].physbase); | ||
55 | udbg_printf(" .size = 0x%lx\n", | 51 | udbg_printf(" .size = 0x%lx\n", |
56 | lmb.reserved.region[i].size); | 52 | lmb.reserved.region[i].size); |
57 | } | 53 | } |
@@ -97,7 +93,6 @@ lmb_coalesce_regions(struct lmb_region *rgn, unsigned long r1, unsigned long r2) | |||
97 | rgn->region[r1].size += rgn->region[r2].size; | 93 | rgn->region[r1].size += rgn->region[r2].size; |
98 | for (i=r2; i < rgn->cnt-1; i++) { | 94 | for (i=r2; i < rgn->cnt-1; i++) { |
99 | rgn->region[i].base = rgn->region[i+1].base; | 95 | rgn->region[i].base = rgn->region[i+1].base; |
100 | rgn->region[i].physbase = rgn->region[i+1].physbase; | ||
101 | rgn->region[i].size = rgn->region[i+1].size; | 96 | rgn->region[i].size = rgn->region[i+1].size; |
102 | } | 97 | } |
103 | rgn->cnt--; | 98 | rgn->cnt--; |
@@ -127,21 +122,12 @@ lmb_analyze(void) | |||
127 | unsigned long i; | 122 | unsigned long i; |
128 | unsigned long mem_size = 0; | 123 | unsigned long mem_size = 0; |
129 | unsigned long size_mask = 0; | 124 | unsigned long size_mask = 0; |
130 | #ifdef CONFIG_MSCHUNKS | ||
131 | unsigned long physbase = 0; | ||
132 | #endif | ||
133 | 125 | ||
134 | for (i=0; i < lmb.memory.cnt; i++) { | 126 | for (i=0; i < lmb.memory.cnt; i++) { |
135 | unsigned long lmb_size; | 127 | unsigned long lmb_size; |
136 | 128 | ||
137 | lmb_size = lmb.memory.region[i].size; | 129 | lmb_size = lmb.memory.region[i].size; |
138 | 130 | ||
139 | #ifdef CONFIG_MSCHUNKS | ||
140 | lmb.memory.region[i].physbase = physbase; | ||
141 | physbase += lmb_size; | ||
142 | #else | ||
143 | lmb.memory.region[i].physbase = lmb.memory.region[i].base; | ||
144 | #endif | ||
145 | mem_size += lmb_size; | 131 | mem_size += lmb_size; |
146 | size_mask |= lmb_size; | 132 | size_mask |= lmb_size; |
147 | } | 133 | } |
@@ -164,7 +150,6 @@ lmb_add_region(struct lmb_region *rgn, unsigned long base, unsigned long size) | |||
164 | adjacent = lmb_addrs_adjacent(base,size,rgnbase,rgnsize); | 150 | adjacent = lmb_addrs_adjacent(base,size,rgnbase,rgnsize); |
165 | if ( adjacent > 0 ) { | 151 | if ( adjacent > 0 ) { |
166 | rgn->region[i].base -= size; | 152 | rgn->region[i].base -= size; |
167 | rgn->region[i].physbase -= size; | ||
168 | rgn->region[i].size += size; | 153 | rgn->region[i].size += size; |
169 | coalesced++; | 154 | coalesced++; |
170 | break; | 155 | break; |
@@ -191,11 +176,9 @@ lmb_add_region(struct lmb_region *rgn, unsigned long base, unsigned long size) | |||
191 | for (i=rgn->cnt-1; i >= 0; i--) { | 176 | for (i=rgn->cnt-1; i >= 0; i--) { |
192 | if (base < rgn->region[i].base) { | 177 | if (base < rgn->region[i].base) { |
193 | rgn->region[i+1].base = rgn->region[i].base; | 178 | rgn->region[i+1].base = rgn->region[i].base; |
194 | rgn->region[i+1].physbase = rgn->region[i].physbase; | ||
195 | rgn->region[i+1].size = rgn->region[i].size; | 179 | rgn->region[i+1].size = rgn->region[i].size; |
196 | } else { | 180 | } else { |
197 | rgn->region[i+1].base = base; | 181 | rgn->region[i+1].base = base; |
198 | rgn->region[i+1].physbase = lmb_abs_to_phys(base); | ||
199 | rgn->region[i+1].size = size; | 182 | rgn->region[i+1].size = size; |
200 | break; | 183 | break; |
201 | } | 184 | } |
@@ -304,13 +287,7 @@ lmb_end_of_DRAM(void) | |||
304 | { | 287 | { |
305 | int idx = lmb.memory.cnt - 1; | 288 | int idx = lmb.memory.cnt - 1; |
306 | 289 | ||
307 | #ifdef CONFIG_MSCHUNKS | ||
308 | return (lmb.memory.region[idx].physbase + lmb.memory.region[idx].size); | ||
309 | #else | ||
310 | return (lmb.memory.region[idx].base + lmb.memory.region[idx].size); | 290 | return (lmb.memory.region[idx].base + lmb.memory.region[idx].size); |
311 | #endif /* CONFIG_MSCHUNKS */ | ||
312 | |||
313 | return 0; | ||
314 | } | 291 | } |
315 | 292 | ||
316 | /* | 293 | /* |
diff --git a/arch/ppc64/mm/hash_utils.c b/arch/ppc64/mm/hash_utils.c index 65d6e852794..09475c8edf7 100644 --- a/arch/ppc64/mm/hash_utils.c +++ b/arch/ppc64/mm/hash_utils.c | |||
@@ -210,7 +210,7 @@ void __init htab_initialize(void) | |||
210 | 210 | ||
211 | /* create bolted the linear mapping in the hash table */ | 211 | /* create bolted the linear mapping in the hash table */ |
212 | for (i=0; i < lmb.memory.cnt; i++) { | 212 | for (i=0; i < lmb.memory.cnt; i++) { |
213 | base = lmb.memory.region[i].physbase + KERNELBASE; | 213 | base = lmb.memory.region[i].base + KERNELBASE; |
214 | size = lmb.memory.region[i].size; | 214 | size = lmb.memory.region[i].size; |
215 | 215 | ||
216 | DBG("creating mapping for region: %lx : %lx\n", base, size); | 216 | DBG("creating mapping for region: %lx : %lx\n", base, size); |
diff --git a/arch/ppc64/mm/init.c b/arch/ppc64/mm/init.c index a16cf12c586..c02dc9809ca 100644 --- a/arch/ppc64/mm/init.c +++ b/arch/ppc64/mm/init.c | |||
@@ -482,9 +482,9 @@ void __init mm_init_ppc64(void) | |||
482 | for (i = 1; i < lmb.memory.cnt; i++) { | 482 | for (i = 1; i < lmb.memory.cnt; i++) { |
483 | unsigned long base, prevbase, prevsize; | 483 | unsigned long base, prevbase, prevsize; |
484 | 484 | ||
485 | prevbase = lmb.memory.region[i-1].physbase; | 485 | prevbase = lmb.memory.region[i-1].base; |
486 | prevsize = lmb.memory.region[i-1].size; | 486 | prevsize = lmb.memory.region[i-1].size; |
487 | base = lmb.memory.region[i].physbase; | 487 | base = lmb.memory.region[i].base; |
488 | if (base > (prevbase + prevsize)) { | 488 | if (base > (prevbase + prevsize)) { |
489 | io_hole_start = prevbase + prevsize; | 489 | io_hole_start = prevbase + prevsize; |
490 | io_hole_size = base - (prevbase + prevsize); | 490 | io_hole_size = base - (prevbase + prevsize); |
@@ -511,11 +511,8 @@ int page_is_ram(unsigned long pfn) | |||
511 | for (i=0; i < lmb.memory.cnt; i++) { | 511 | for (i=0; i < lmb.memory.cnt; i++) { |
512 | unsigned long base; | 512 | unsigned long base; |
513 | 513 | ||
514 | #ifdef CONFIG_MSCHUNKS | ||
515 | base = lmb.memory.region[i].physbase; | ||
516 | #else | ||
517 | base = lmb.memory.region[i].base; | 514 | base = lmb.memory.region[i].base; |
518 | #endif | 515 | |
519 | if ((paddr >= base) && | 516 | if ((paddr >= base) && |
520 | (paddr < (base + lmb.memory.region[i].size))) { | 517 | (paddr < (base + lmb.memory.region[i].size))) { |
521 | return 1; | 518 | return 1; |
@@ -556,25 +553,25 @@ void __init do_init_bootmem(void) | |||
556 | * present. | 553 | * present. |
557 | */ | 554 | */ |
558 | for (i=0; i < lmb.memory.cnt; i++) { | 555 | for (i=0; i < lmb.memory.cnt; i++) { |
559 | unsigned long physbase, size; | 556 | unsigned long base, size; |
560 | unsigned long start_pfn, end_pfn; | 557 | unsigned long start_pfn, end_pfn; |
561 | 558 | ||
562 | physbase = lmb.memory.region[i].physbase; | 559 | base = lmb.memory.region[i].base; |
563 | size = lmb.memory.region[i].size; | 560 | size = lmb.memory.region[i].size; |
564 | 561 | ||
565 | start_pfn = physbase >> PAGE_SHIFT; | 562 | start_pfn = base >> PAGE_SHIFT; |
566 | end_pfn = start_pfn + (size >> PAGE_SHIFT); | 563 | end_pfn = start_pfn + (size >> PAGE_SHIFT); |
567 | memory_present(0, start_pfn, end_pfn); | 564 | memory_present(0, start_pfn, end_pfn); |
568 | 565 | ||
569 | free_bootmem(physbase, size); | 566 | free_bootmem(base, size); |
570 | } | 567 | } |
571 | 568 | ||
572 | /* reserve the sections we're already using */ | 569 | /* reserve the sections we're already using */ |
573 | for (i=0; i < lmb.reserved.cnt; i++) { | 570 | for (i=0; i < lmb.reserved.cnt; i++) { |
574 | unsigned long physbase = lmb.reserved.region[i].physbase; | 571 | unsigned long base = lmb.reserved.region[i].base; |
575 | unsigned long size = lmb.reserved.region[i].size; | 572 | unsigned long size = lmb.reserved.region[i].size; |
576 | 573 | ||
577 | reserve_bootmem(physbase, size); | 574 | reserve_bootmem(base, size); |
578 | } | 575 | } |
579 | } | 576 | } |
580 | 577 | ||
@@ -613,10 +610,10 @@ static int __init setup_kcore(void) | |||
613 | int i; | 610 | int i; |
614 | 611 | ||
615 | for (i=0; i < lmb.memory.cnt; i++) { | 612 | for (i=0; i < lmb.memory.cnt; i++) { |
616 | unsigned long physbase, size; | 613 | unsigned long base, size; |
617 | struct kcore_list *kcore_mem; | 614 | struct kcore_list *kcore_mem; |
618 | 615 | ||
619 | physbase = lmb.memory.region[i].physbase; | 616 | base = lmb.memory.region[i].base; |
620 | size = lmb.memory.region[i].size; | 617 | size = lmb.memory.region[i].size; |
621 | 618 | ||
622 | /* GFP_ATOMIC to avoid might_sleep warnings during boot */ | 619 | /* GFP_ATOMIC to avoid might_sleep warnings during boot */ |
@@ -624,7 +621,7 @@ static int __init setup_kcore(void) | |||
624 | if (!kcore_mem) | 621 | if (!kcore_mem) |
625 | panic("mem_init: kmalloc failed\n"); | 622 | panic("mem_init: kmalloc failed\n"); |
626 | 623 | ||
627 | kclist_add(kcore_mem, __va(physbase), size); | 624 | kclist_add(kcore_mem, __va(base), size); |
628 | } | 625 | } |
629 | 626 | ||
630 | kclist_add(&kcore_vmem, (void *)VMALLOC_START, VMALLOC_END-VMALLOC_START); | 627 | kclist_add(&kcore_vmem, (void *)VMALLOC_START, VMALLOC_END-VMALLOC_START); |
diff --git a/arch/ppc64/mm/numa.c b/arch/ppc64/mm/numa.c index 0b191f2de01..c3116f0d788 100644 --- a/arch/ppc64/mm/numa.c +++ b/arch/ppc64/mm/numa.c | |||
@@ -671,7 +671,7 @@ new_range: | |||
671 | * Mark reserved regions on this node | 671 | * Mark reserved regions on this node |
672 | */ | 672 | */ |
673 | for (i = 0; i < lmb.reserved.cnt; i++) { | 673 | for (i = 0; i < lmb.reserved.cnt; i++) { |
674 | unsigned long physbase = lmb.reserved.region[i].physbase; | 674 | unsigned long physbase = lmb.reserved.region[i].base; |
675 | unsigned long size = lmb.reserved.region[i].size; | 675 | unsigned long size = lmb.reserved.region[i].size; |
676 | 676 | ||
677 | if (pa_to_nid(physbase) != nid && | 677 | if (pa_to_nid(physbase) != nid && |