]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
[PATCH] ppc64: Remove physbase from the lmb_property struct
authorMichael Ellerman <michael@ellerman.id.au>
Wed, 3 Aug 2005 10:21:26 +0000 (20:21 +1000)
committerPaul Mackerras <paulus@samba.org>
Mon, 29 Aug 2005 00:53:37 +0000 (10:53 +1000)
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>
arch/ppc64/kernel/lmb.c
arch/ppc64/mm/hash_utils.c
arch/ppc64/mm/init.c
arch/ppc64/mm/numa.c
include/asm-ppc64/lmb.h

index 111da736652bc72c167f9567ec41b82666bd318d..6ed6312d848fdf97e0b73f1cbe7850f95bdb87c6 100644 (file)
@@ -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;
 }
 
 /*
index 65d6e85279481f19c4eaca71be83acc9f1a73eb2..09475c8edf7caea33dfb37f641c13879b8fac666 100644 (file)
@@ -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);
index a16cf12c586b1a245522b4891cd4ada86a7e904b..c02dc9809ca57a2a3299c2c5c83efe9a360583ea 100644 (file)
@@ -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);
index 0b191f2de0163b64d20b302a92f5047aee23ed8e..c3116f0d788c359969fcd120eda6eb461451faad 100644 (file)
@@ -671,7 +671,7 @@ new_range:
                 * 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 &&
index a6cbca21ac1d7082147fa8800d3851d7c5bbe2b1..cb368bf0f264306decc6b7e00618a6bfb5f52174 100644 (file)
@@ -22,7 +22,6 @@
 
 struct lmb_property {
        unsigned long base;
-       unsigned long physbase;
        unsigned long size;
 };