summaryrefslogtreecommitdiff
path: root/arch/sparc64/mm/init.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-06-16 11:28:04 +0200
committerIngo Molnar <mingo@elte.hu>2008-06-16 11:28:04 +0200
commit7aaaec38fcd9ef3172e69f8c19f20113830a8498 (patch)
treeb12a1c359ad53ae10601f77b3438bb27c3c8f337 /arch/sparc64/mm/init.c
parent1ac97018169c5a13feaa90d9671f2d6ba2d9e86e (diff)
parent066519068ad2fbe98c7f45552b1f592903a9c8c8 (diff)
Merge branch 'linus' into x86/kconfigtip-x86-kconfig-2008-06-16_09.28_Mon
Diffstat (limited to 'arch/sparc64/mm/init.c')
-rw-r--r--arch/sparc64/mm/init.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/arch/sparc64/mm/init.c b/arch/sparc64/mm/init.c
index ec3e2c72302a..84898c44dd4d 100644
--- a/arch/sparc64/mm/init.c
+++ b/arch/sparc64/mm/init.c
@@ -1,4 +1,4 @@
-/* $Id: init.c,v 1.209 2002/02/09 19:49:31 davem Exp $
+/*
* arch/sparc64/mm/init.c
*
* Copyright (C) 1996-1999 David S. Miller (davem@caip.rutgers.edu)
@@ -610,8 +610,6 @@ static void __init remap_kernel(void)
static void __init inherit_prom_mappings(void)
{
- read_obp_translations();
-
/* Now fixup OBP's idea about where we really are mapped. */
printk("Remapping the kernel... ");
remap_kernel();
@@ -770,7 +768,7 @@ static void __init find_ramdisk(unsigned long phys_base)
initrd_start = ramdisk_image;
initrd_end = ramdisk_image + sparc_ramdisk_size;
- lmb_reserve(initrd_start, initrd_end);
+ lmb_reserve(initrd_start, sparc_ramdisk_size);
initrd_start += PAGE_OFFSET;
initrd_end += PAGE_OFFSET;
@@ -1747,7 +1745,17 @@ void __init paging_init(void)
lmb_init();
- /* Find available physical memory... */
+ /* Find available physical memory...
+ *
+ * Read it twice in order to work around a bug in openfirmware.
+ * The call to grab this table itself can cause openfirmware to
+ * allocate memory, which in turn can take away some space from
+ * the list of available memory. Reading it twice makes sure
+ * we really do get the final value.
+ */
+ read_obp_translations();
+ read_obp_memory("reg", &pall[0], &pall_ents);
+ read_obp_memory("available", &pavail[0], &pavail_ents);
read_obp_memory("available", &pavail[0], &pavail_ents);
phys_base = 0xffffffffffffffffUL;
@@ -1788,8 +1796,6 @@ void __init paging_init(void)
inherit_prom_mappings();
- read_obp_memory("reg", &pall[0], &pall_ents);
-
init_kpte_bitmap();
/* Ok, we can use our TLB miss and window trap handlers safely. */