aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ppc64/mm
diff options
context:
space:
mode:
authorMichael Ellerman <michael@ellerman.id.au>2005-08-03 06:21:25 -0400
committerPaul Mackerras <paulus@samba.org>2005-08-28 20:53:37 -0400
commite88bcd1b29f63738b702e57d831758706162347e (patch)
tree71304874af3f0c2601658e5c175968f0b5e46164 /arch/ppc64/mm
parenta4a0f97020444f83bf22bb9c8c20d8af2b4e6317 (diff)
[PATCH] ppc64: Remove redundant abs_to_phys() macro
abs_to_phys() is a macro that turns out to do nothing, and also has the unfortunate property that it's not the inverse of phys_to_abs() on iSeries. The following is for my benefit as much as everyone else. With CONFIG_MSCHUNKS enabled, the lmb code is changed such that it keeps a physbase variable for each lmb region. This is used to take the possibly discontiguous lmb regions and present them as a contiguous address space beginning from zero. In this context each lmb region's base address is its "absolute" base address, and its physbase is it's "physical" address (from Linux's point of view). The abs_to_phys() macro does the mapping from "absolute" to "physical". Note: This is not related to the iSeries mapping of physical to absolute (ie. Hypervisor) addresses which is maintained with the msChunks structure. And the msChunks structure is not controlled via CONFIG_MSCHUNKS. Once upon a time you could compile for non-iSeries with CONFIG_MSCHUNKS enabled. But these days CONFIG_MSCHUNKS depends on CONFIG_PPC_ISERIES, so for non-iSeries code abs_to_phys() is a no-op. On iSeries we always have one lmb region which spans from 0 to systemcfg->physicalMemorySize (arch/ppc64/kernel/iSeries_setup.c line 383). This region has a base (ie. absolute) address of 0, and a physbase address of 0 (as calculated in lmb_analyze() (arch/ppc64/kernel/lmb.c line 144)). On iSeries, abs_to_phys(aa) is defined as lmb_abs_to_phys(aa), which finds the lmb region containing aa (and there's only one, ie. 0), and then does: return lmb.memory.region[0].physbase + (aa - lmb.memory.region[0].base) physbase == base == 0, so you're left with "return aa". So remove abs_to_phys(), and lmb_abs_to_phys() which is the implementation of abs_to_phys() for iSeries. Signed-off-by: Michael Ellerman <michael@ellerman.id.au> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/ppc64/mm')
-rw-r--r--arch/ppc64/mm/init.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/arch/ppc64/mm/init.c b/arch/ppc64/mm/init.c
index 9edfe267123e..a16cf12c586b 100644
--- a/arch/ppc64/mm/init.c
+++ b/arch/ppc64/mm/init.c
@@ -42,7 +42,6 @@
42 42
43#include <asm/pgalloc.h> 43#include <asm/pgalloc.h>
44#include <asm/page.h> 44#include <asm/page.h>
45#include <asm/abs_addr.h>
46#include <asm/prom.h> 45#include <asm/prom.h>
47#include <asm/lmb.h> 46#include <asm/lmb.h>
48#include <asm/rtas.h> 47#include <asm/rtas.h>
@@ -167,7 +166,6 @@ static int map_io_page(unsigned long ea, unsigned long pa, int flags)
167 ptep = pte_alloc_kernel(&init_mm, pmdp, ea); 166 ptep = pte_alloc_kernel(&init_mm, pmdp, ea);
168 if (!ptep) 167 if (!ptep)
169 return -ENOMEM; 168 return -ENOMEM;
170 pa = abs_to_phys(pa);
171 set_pte_at(&init_mm, ea, ptep, pfn_pte(pa >> PAGE_SHIFT, 169 set_pte_at(&init_mm, ea, ptep, pfn_pte(pa >> PAGE_SHIFT,
172 __pgprot(flags))); 170 __pgprot(flags)));
173 spin_unlock(&init_mm.page_table_lock); 171 spin_unlock(&init_mm.page_table_lock);
@@ -547,7 +545,7 @@ void __init do_init_bootmem(void)
547 */ 545 */
548 bootmap_pages = bootmem_bootmap_pages(total_pages); 546 bootmap_pages = bootmem_bootmap_pages(total_pages);
549 547
550 start = abs_to_phys(lmb_alloc(bootmap_pages<<PAGE_SHIFT, PAGE_SIZE)); 548 start = lmb_alloc(bootmap_pages<<PAGE_SHIFT, PAGE_SIZE);
551 BUG_ON(!start); 549 BUG_ON(!start);
552 550
553 boot_mapsize = init_bootmem(start >> PAGE_SHIFT, total_pages); 551 boot_mapsize = init_bootmem(start >> PAGE_SHIFT, total_pages);