linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] x86/voyager: Switch voyager memory detection to early_ioremap.
@ 2008-01-19 16:08 Ian Campbell
  2008-01-19 16:08 ` [PATCH] x86: Construct 32 bit boot time page tables in native format Ian Campbell
  0 siblings, 1 reply; 80+ messages in thread
From: Ian Campbell @ 2008-01-19 16:08 UTC (permalink / raw)
  To: linux-kernel
  Cc: Ian Campbell, Thomas Gleixner, Ingo Molnar, H. Peter Anvin,
	James Bottomley, Eric W. Biederman

Extracted from an earlier patch by Eric Biederman.

Signed-off-by: Ian Campbell <ijc@hellion.org.uk>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
CC: James Bottomley <James.Bottomley@HansenPartnership.com>
Cc: Eric W. Biederman <ebiederm@xmission.com>
---
 arch/x86/mach-voyager/voyager_basic.c |   19 +++++++------------
 1 files changed, 7 insertions(+), 12 deletions(-)

diff --git a/arch/x86/mach-voyager/voyager_basic.c b/arch/x86/mach-voyager/voyager_basic.c
index 6a949e4..ed41fd8 100644
--- a/arch/x86/mach-voyager/voyager_basic.c
+++ b/arch/x86/mach-voyager/voyager_basic.c
@@ -110,8 +110,9 @@ typedef struct ClickMap {
 	} Entry[CLICK_ENTRIES];
 } ClickMap_t;
 
-/* This routine is pretty much an awful hack to read the bios clickmap by
- * mapping it into page 0.  There are usually three regions in the map:
+/*
+ * This routine reads the bios clickmap.  There are usually three
+ * regions in the map:
  * 	Base Memory
  * 	Extended Memory
  *	zero length marker for end of map
@@ -125,7 +126,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);
@@ -138,12 +138,8 @@ int __init voyager_memory_detect(int region, __u32 * start, __u32 * length)
 
 	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));
+	/* Setup a temporary mapping for the clickmap */
+	map = early_ioremap(map_addr, sizeof(*map));
 
 	/* zero length is the end of the clickmap */
 	if (map->Entry[region].Length != 0) {
@@ -152,9 +148,8 @@ int __init voyager_memory_detect(int region, __u32 * start, __u32 * length)
 		retval = 1;
 	}
 
-	/* replace the mapping */
-	pg0[0] = old;
-	local_flush_tlb();
+	/* undo the mapping */
+	early_iounmap(map, sizeof(*map));
 	return retval;
 }
 
-- 
1.5.3.8


^ permalink raw reply related	[flat|nested] 80+ messages in thread

end of thread, other threads:[~2008-02-01 22:57 UTC | newest]

Thread overview: 80+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-01-19 16:08 [PATCH] x86/voyager: Switch voyager memory detection to early_ioremap Ian Campbell
2008-01-19 16:08 ` [PATCH] x86: Construct 32 bit boot time page tables in native format Ian Campbell
2008-01-19 23:07   ` Andi Kleen
2008-01-19 23:50     ` H. Peter Anvin
2008-01-20 16:44     ` Ian Campbell
2008-01-20 17:39       ` Andi Kleen
2008-01-20 18:48         ` H. Peter Anvin
2008-01-20 18:55           ` Andi Kleen
2008-01-20 18:54             ` H. Peter Anvin
2008-01-22 10:05           ` Ingo Molnar
2008-01-22 16:23             ` H. Peter Anvin
2008-01-20 18:30   ` Mika Penttilä
2008-01-21 21:23     ` Ian Campbell
2008-01-21 21:38       ` H. Peter Anvin
2008-01-21 21:46         ` Ian Campbell
2008-01-22  2:16           ` H. Peter Anvin
2008-01-22 17:36             ` Ian Campbell
2008-01-22 18:23               ` H. Peter Anvin
2008-01-22 19:48                 ` Ian Campbell
2008-01-22 20:00                   ` H. Peter Anvin
2008-01-22 20:36                     ` Ingo Molnar
2008-01-22 20:43                       ` H. Peter Anvin
2008-01-22 20:45                         ` Ingo Molnar
2008-01-22 20:52                       ` Ian Campbell
2008-01-22 21:00                         ` H. Peter Anvin
2008-01-22 22:21                           ` Ian Campbell
2008-01-22 21:00                       ` [PATCH] x86: make nx_enabled conditional on CONFIG_X86_PAE Harvey Harrison
2008-01-22 21:04                         ` Ingo Molnar
2008-01-22 21:35                           ` Harvey Harrison
2008-01-22 21:07                         ` Harvey Harrison
     [not found]                         ` <p73odbdlyiu.fsf@crumb.suse.de>
2008-01-23 11:21                           ` Harvey Harrison
2008-01-23 20:52                       ` [PATCH] x86: Construct 32 bit boot time page tables in native format Ian Campbell
2008-01-24  1:06                         ` Jeremy Fitzhardinge
2008-01-24  9:39                           ` Ian Campbell
2008-01-24 22:06                             ` H. Peter Anvin
2008-01-24 22:35                               ` Jeremy Fitzhardinge
2008-01-24 22:39                                 ` H. Peter Anvin
2008-01-24 22:58                                   ` Jeremy Fitzhardinge
2008-01-24 23:08                                     ` H. Peter Anvin
2008-01-24 23:40                                       ` Jeremy Fitzhardinge
2008-01-24 23:44                                         ` H. Peter Anvin
2008-01-24 23:51                                           ` Jeremy Fitzhardinge
2008-01-25  0:02                                             ` H. Peter Anvin
2008-01-25  0:11                                               ` Jeremy Fitzhardinge
2008-01-25  0:15                                                 ` H. Peter Anvin
2008-01-25  0:31                                                   ` Jeremy Fitzhardinge
2008-01-25  0:37                                                     ` H. Peter Anvin
2008-01-25  2:56                                                       ` Eric W. Biederman
2008-01-25  4:41                                                         ` Jeremy Fitzhardinge
2008-01-25 11:07                                                           ` Eric W. Biederman
2008-01-24 23:51                                         ` H. Peter Anvin
2008-01-25  0:20                                           ` Pavel Machek
2008-01-25  0:27                                             ` H. Peter Anvin
2008-01-25  0:46                                               ` Rafael J. Wysocki
2008-01-25  1:08                                                 ` H. Peter Anvin
2008-01-25  2:16                                               ` Eric W. Biederman
2008-01-25  2:25                                                 ` H. Peter Anvin
2008-01-25  7:49                                               ` Pavel Machek
2008-01-25 22:02                                                 ` Rafael J. Wysocki
2008-01-25 22:11                                                   ` Pavel Machek
2008-01-28 15:00                                                   ` Ingo Molnar
2008-01-28 15:25                                                     ` Rafael J. Wysocki
2008-01-28 19:40                                                       ` Pavel Machek
2008-01-28 19:51                                                         ` H. Peter Anvin
2008-01-28 20:03                                                           ` Jeremy Fitzhardinge
2008-01-28 20:06                                                             ` H. Peter Anvin
2008-01-28 20:28                                                               ` Rafael J. Wysocki
2008-01-28 20:26                                                         ` Rafael J. Wysocki
2008-01-28 20:31                                                           ` H. Peter Anvin
2008-01-28 20:59                                                             ` Rafael J. Wysocki
2008-01-28 20:44                                                           ` Jeremy Fitzhardinge
2008-01-28 20:50                                                             ` Rafael J. Wysocki
2008-01-28 21:28                                                               ` H. Peter Anvin
2008-01-28 22:02                                                                 ` Rafael J. Wysocki
2008-01-28 16:12                                                     ` Ingo Molnar
2008-01-28 17:02                                                       ` Rafael J. Wysocki
2008-02-01 13:51                                                         ` Ingo Molnar
2008-02-01 14:28                                                           ` Rafael J. Wysocki
2008-02-01 14:54                                                             ` Ingo Molnar
2008-02-01 22:55                                                               ` Len Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).