[PATCH 13/14] [VOYAGER] x86/voyager: remove direct use of pg0 in favour of early_ioremap()

From: James Bottomley
Date: Tue Apr 14 2009 - 11:56:40 EST


This was a hold over from the days when we didn't actually have an
early_ioremap() and we had to fiddle with the kernel page table
directly to read voyager cmos clickmap entries.

Signed-off-by: James Bottomley <James.Bottomley@xxxxxxxxxxxxxxxxxxxxx>
---
arch/x86/mach-voyager/voyager_basic.c | 13 ++-----------
1 files changed, 2 insertions(+), 11 deletions(-)

diff --git a/arch/x86/mach-voyager/voyager_basic.c b/arch/x86/mach-voyager/voyager_basic.c
index 7c97c9a..5d37967 100644
--- a/arch/x86/mach-voyager/voyager_basic.c
+++ b/arch/x86/mach-voyager/voyager_basic.c
@@ -123,7 +123,6 @@ int __init voyager_memory_detect(int region, __u32 * start, __u32 * length)
__u8 cmos[4];
ClickMap_t *map;
unsigned long map_addr;
- unsigned long old;

if (region >= CLICK_ENTRIES) {
printk("Voyager: Illegal ClickMap region %d\n", region);
@@ -135,13 +134,7 @@ int __init voyager_memory_detect(int region, __u32 * start, __u32 * length)
voyager_extended_cmos_read(VOYAGER_MEMORY_CLICKMAP + i);

map_addr = *(unsigned long *)cmos;
-
- /* steal page 0 for this */
- old = pg0[0];
- pg0[0] = ((map_addr & PAGE_MASK) | _PAGE_RW | _PAGE_PRESENT);
- local_flush_tlb();
- /* now clear everything out but page 0 */
- map = (ClickMap_t *) (map_addr & (~PAGE_MASK));
+ map = (ClickMap_t *)early_ioremap(map_addr, sizeof(*map));

/* zero length is the end of the clickmap */
if (map->Entry[region].Length != 0) {
@@ -149,10 +142,8 @@ int __init voyager_memory_detect(int region, __u32 * start, __u32 * length)
*start = map->Entry[region].Address;
retval = 1;
}
+ early_iounmap(map, sizeof(*map));

- /* replace the mapping */
- pg0[0] = old;
- local_flush_tlb();
return retval;
}

--
1.6.2.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/