Commit 180379dc authored by Michael Ellerman's avatar Michael Ellerman Committed by Paul Mackerras

[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: default avatarMichael Ellerman <michael@ellerman.id.au>
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
parent e88bcd1b
......@@ -37,8 +37,6 @@ void lmb_dump_all(void)
for (i=0; i < lmb.memory.cnt ;i++) {
udbg_printf(" memory.region[0x%x].base = 0x%lx\n",
i, lmb.memory.region[i].base);
udbg_printf(" .physbase = 0x%lx\n",
lmb.memory.region[i].physbase);
udbg_printf(" .size = 0x%lx\n",
lmb.memory.region[i].size);
}
......@@ -50,8 +48,6 @@ void lmb_dump_all(void)
for (i=0; i < lmb.reserved.cnt ;i++) {
udbg_printf(" reserved.region[0x%x].base = 0x%lx\n",
i, lmb.reserved.region[i].base);
udbg_printf(" .physbase = 0x%lx\n",
lmb.reserved.region[i].physbase);
udbg_printf(" .size = 0x%lx\n",
lmb.reserved.region[i].size);
}
......@@ -97,7 +93,6 @@ lmb_coalesce_regions(struct lmb_region *rgn, unsigned long r1, unsigned long r2)
rgn->region[r1].size += rgn->region[r2].size;
for (i=r2; i < rgn->cnt-1; i++) {
rgn->region[i].base = rgn->region[i+1].base;
rgn->region[i].physbase = rgn->region[i+1].physbase;
rgn->region[i].size = rgn->region[i+1].size;
}
rgn->cnt--;
......@@ -127,21 +122,12 @@ lmb_analyze(void)
unsigned long i;
unsigned long mem_size = 0;
unsigned long size_mask = 0;
#ifdef CONFIG_MSCHUNKS
unsigned long physbase = 0;
#endif
for (i=0; i < lmb.memory.cnt; i++) {
unsigned long lmb_size;
lmb_size = lmb.memory.region[i].size;
#ifdef CONFIG_MSCHUNKS
lmb.memory.region[i].physbase = physbase;
physbase += lmb_size;
#else
lmb.memory.region[i].physbase = lmb.memory.region[i].base;
#endif
mem_size += lmb_size;
size_mask |= lmb_size;
}
......@@ -164,7 +150,6 @@ lmb_add_region(struct lmb_region *rgn, unsigned long base, unsigned long size)
adjacent = lmb_addrs_adjacent(base,size,rgnbase,rgnsize);
if ( adjacent > 0 ) {
rgn->region[i].base -= size;
rgn->region[i].physbase -= size;
rgn->region[i].size += size;
coalesced++;
break;
......@@ -191,11 +176,9 @@ lmb_add_region(struct lmb_region *rgn, unsigned long base, unsigned long size)
for (i=rgn->cnt-1; i >= 0; i--) {
if (base < rgn->region[i].base) {
rgn->region[i+1].base = rgn->region[i].base;
rgn->region[i+1].physbase = rgn->region[i].physbase;
rgn->region[i+1].size = rgn->region[i].size;
} else {
rgn->region[i+1].base = base;
rgn->region[i+1].physbase = lmb_abs_to_phys(base);
rgn->region[i+1].size = size;
break;
}
......@@ -304,13 +287,7 @@ lmb_end_of_DRAM(void)
{
int idx = lmb.memory.cnt - 1;
#ifdef CONFIG_MSCHUNKS
return (lmb.memory.region[idx].physbase + lmb.memory.region[idx].size);
#else
return (lmb.memory.region[idx].base + lmb.memory.region[idx].size);
#endif /* CONFIG_MSCHUNKS */
return 0;
}
/*
......
......@@ -210,7 +210,7 @@ void __init htab_initialize(void)
/* create bolted the linear mapping in the hash table */
for (i=0; i < lmb.memory.cnt; i++) {
base = lmb.memory.region[i].physbase + KERNELBASE;
base = lmb.memory.region[i].base + KERNELBASE;
size = lmb.memory.region[i].size;
DBG("creating mapping for region: %lx : %lx\n", base, size);
......
......@@ -482,9 +482,9 @@ void __init mm_init_ppc64(void)
for (i = 1; i < lmb.memory.cnt; i++) {
unsigned long base, prevbase, prevsize;
prevbase = lmb.memory.region[i-1].physbase;
prevbase = lmb.memory.region[i-1].base;
prevsize = lmb.memory.region[i-1].size;
base = lmb.memory.region[i].physbase;
base = lmb.memory.region[i].base;
if (base > (prevbase + prevsize)) {
io_hole_start = prevbase + prevsize;
io_hole_size = base - (prevbase + prevsize);
......@@ -511,11 +511,8 @@ int page_is_ram(unsigned long pfn)
for (i=0; i < lmb.memory.cnt; i++) {
unsigned long base;
#ifdef CONFIG_MSCHUNKS
base = lmb.memory.region[i].physbase;
#else
base = lmb.memory.region[i].base;
#endif
if ((paddr >= base) &&
(paddr < (base + lmb.memory.region[i].size))) {
return 1;
......@@ -556,25 +553,25 @@ void __init do_init_bootmem(void)
* present.
*/
for (i=0; i < lmb.memory.cnt; i++) {
unsigned long physbase, size;
unsigned long base, size;
unsigned long start_pfn, end_pfn;
physbase = lmb.memory.region[i].physbase;
base = lmb.memory.region[i].base;
size = lmb.memory.region[i].size;
start_pfn = physbase >> PAGE_SHIFT;
start_pfn = base >> PAGE_SHIFT;
end_pfn = start_pfn + (size >> PAGE_SHIFT);
memory_present(0, start_pfn, end_pfn);
free_bootmem(physbase, size);
free_bootmem(base, size);
}
/* reserve the sections we're already using */
for (i=0; i < lmb.reserved.cnt; i++) {
unsigned long physbase = lmb.reserved.region[i].physbase;
unsigned long base = lmb.reserved.region[i].base;
unsigned long size = lmb.reserved.region[i].size;
reserve_bootmem(physbase, size);
reserve_bootmem(base, size);
}
}
......@@ -613,10 +610,10 @@ static int __init setup_kcore(void)
int i;
for (i=0; i < lmb.memory.cnt; i++) {
unsigned long physbase, size;
unsigned long base, size;
struct kcore_list *kcore_mem;
physbase = lmb.memory.region[i].physbase;
base = lmb.memory.region[i].base;
size = lmb.memory.region[i].size;
/* GFP_ATOMIC to avoid might_sleep warnings during boot */
......@@ -624,7 +621,7 @@ static int __init setup_kcore(void)
if (!kcore_mem)
panic("mem_init: kmalloc failed\n");
kclist_add(kcore_mem, __va(physbase), size);
kclist_add(kcore_mem, __va(base), size);
}
kclist_add(&kcore_vmem, (void *)VMALLOC_START, VMALLOC_END-VMALLOC_START);
......
......@@ -671,7 +671,7 @@ void __init do_init_bootmem(void)
* Mark reserved regions on this node
*/
for (i = 0; i < lmb.reserved.cnt; i++) {
unsigned long physbase = lmb.reserved.region[i].physbase;
unsigned long physbase = lmb.reserved.region[i].base;
unsigned long size = lmb.reserved.region[i].size;
if (pa_to_nid(physbase) != nid &&
......
......@@ -22,7 +22,6 @@
struct lmb_property {
unsigned long base;
unsigned long physbase;
unsigned long size;
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment