]> git.ozlabs.org Git - yaboot.git/commitdiff
Allocate malloc region with prom_claim_chunk_top
authorAnton Blanchard <anton@samba.org>
Thu, 8 Jul 2010 19:03:41 +0000 (19:03 +0000)
committerTony Breeds <tony@bakeyournoodle.com>
Fri, 16 Jul 2010 05:51:57 +0000 (15:51 +1000)
We want the kernel and initrd to be as low as possible in the
address space. Allocate the temporary malloc region at the top
of the address space.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
Makefile
second/yaboot.c

index 336ac527b0b1c718eedd9abd859cc07f785efaa4..78184a0ccc6b701c537fbe4f258cdb2df1b150dd 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -17,8 +17,7 @@ GETROOT = fakeroot
 
 # Load the bootstrap at 2Mb
 TEXTADDR       = 0x200000
 
 # Load the bootstrap at 2Mb
 TEXTADDR       = 0x200000
-# Malloc block at 3Mb -> 4Mb
-MALLOCADDR     = 0x300000
+# Malloc block of 1MB
 MALLOCSIZE     = 0x100000
 # Load kernel and ramdisk at real-base.  If there is overlap, will retry until find open space
 KERNELADDR     = 0x00C00000
 MALLOCSIZE     = 0x100000
 # Load kernel and ramdisk at real-base.  If there is overlap, will retry until find open space
 KERNELADDR     = 0x00C00000
index c73348845721ee06eaadaff8bab1e5cb8497e37f..b7b9280b7577dc7ea8606ade10f002c64bc5d0fb 100644 (file)
@@ -180,10 +180,10 @@ yaboot_start (unsigned long r3, unsigned long r4, unsigned long r5)
      prom_print_available();
 
      /* Allocate some memory for malloc'ator */
      prom_print_available();
 
      /* Allocate some memory for malloc'ator */
-     malloc_base = prom_claim_chunk((void *)MALLOCADDR, MALLOCSIZE, 0);
+     malloc_base = prom_claim_chunk_top(MALLOCSIZE, 0);
      if (malloc_base == (void *)-1) {
      if (malloc_base == (void *)-1) {
-         prom_printf("Can't claim malloc buffer (%d bytes at 0x%08x)\n",
-                     MALLOCSIZE, MALLOCADDR);
+         prom_printf("Can't claim malloc buffer of %d bytes\n",
+                     MALLOCSIZE);
          return -1;
      }
      malloc_init(malloc_base, MALLOCSIZE);
          return -1;
      }
      malloc_init(malloc_base, MALLOCSIZE);