diff options
author | Jeremy Fitzhardinge <jeremy@goop.org> | 2008-06-25 00:19:03 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-07-08 07:10:28 -0400 |
commit | 4583ed514ea9ac844a6eb02d33120beaedf6837f (patch) | |
tree | 9df2d1e1a5d1726303f761954593defc483e2d20 /arch/x86/mm/init_64.c | |
parent | bb23e403e5162765dabe3dc78646724753d6359b (diff) |
x86, 64-bit: unify early_ioremap
The 32-bit early_ioremap will work equally well for 64-bit, so just use it.
Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Cc: xen-devel <xen-devel@lists.xensource.com>
Cc: Stephen Tweedie <sct@redhat.com>
Cc: Eduardo Habkost <ehabkost@redhat.com>
Cc: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/mm/init_64.c')
-rw-r--r-- | arch/x86/mm/init_64.c | 52 |
1 files changed, 0 insertions, 52 deletions
diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c index bfea7605eaab..9b6049133a82 100644 --- a/arch/x86/mm/init_64.c +++ b/arch/x86/mm/init_64.c | |||
@@ -257,58 +257,6 @@ static __meminit void unmap_low_page(void *adr) | |||
257 | early_iounmap(adr, PAGE_SIZE); | 257 | early_iounmap(adr, PAGE_SIZE); |
258 | } | 258 | } |
259 | 259 | ||
260 | /* Must run before zap_low_mappings */ | ||
261 | __meminit void *early_ioremap(unsigned long addr, unsigned long size) | ||
262 | { | ||
263 | pmd_t *pmd, *last_pmd; | ||
264 | unsigned long vaddr; | ||
265 | int i, pmds; | ||
266 | |||
267 | pmds = ((addr & ~PMD_MASK) + size + ~PMD_MASK) / PMD_SIZE; | ||
268 | vaddr = __START_KERNEL_map; | ||
269 | pmd = level2_kernel_pgt; | ||
270 | last_pmd = level2_kernel_pgt + PTRS_PER_PMD - 1; | ||
271 | |||
272 | for (; pmd <= last_pmd; pmd++, vaddr += PMD_SIZE) { | ||
273 | for (i = 0; i < pmds; i++) { | ||
274 | if (pmd_present(pmd[i])) | ||
275 | goto continue_outer_loop; | ||
276 | } | ||
277 | vaddr += addr & ~PMD_MASK; | ||
278 | addr &= PMD_MASK; | ||
279 | |||
280 | for (i = 0; i < pmds; i++, addr += PMD_SIZE) | ||
281 | set_pmd(pmd+i, __pmd(addr | __PAGE_KERNEL_LARGE_EXEC)); | ||
282 | __flush_tlb_all(); | ||
283 | |||
284 | return (void *)vaddr; | ||
285 | continue_outer_loop: | ||
286 | ; | ||
287 | } | ||
288 | printk(KERN_ERR "early_ioremap(0x%lx, %lu) failed\n", addr, size); | ||
289 | |||
290 | return NULL; | ||
291 | } | ||
292 | |||
293 | /* | ||
294 | * To avoid virtual aliases later: | ||
295 | */ | ||
296 | __meminit void early_iounmap(void *addr, unsigned long size) | ||
297 | { | ||
298 | unsigned long vaddr; | ||
299 | pmd_t *pmd; | ||
300 | int i, pmds; | ||
301 | |||
302 | vaddr = (unsigned long)addr; | ||
303 | pmds = ((vaddr & ~PMD_MASK) + size + ~PMD_MASK) / PMD_SIZE; | ||
304 | pmd = level2_kernel_pgt + pmd_index(vaddr); | ||
305 | |||
306 | for (i = 0; i < pmds; i++) | ||
307 | pmd_clear(pmd + i); | ||
308 | |||
309 | __flush_tlb_all(); | ||
310 | } | ||
311 | |||
312 | static unsigned long __meminit | 260 | static unsigned long __meminit |
313 | phys_pmd_init(pmd_t *pmd_page, unsigned long address, unsigned long end) | 261 | phys_pmd_init(pmd_t *pmd_page, unsigned long address, unsigned long end) |
314 | { | 262 | { |