]> git.ozlabs.org Git - yaboot.git/commitdiff
Use prom_claim_chunk to allocate malloc area
authorAnton Blanchard <anton@samba.org>
Thu, 8 Jul 2010 19:03:33 +0000 (19:03 +0000)
committerTony Breeds <tony@bakeyournoodle.com>
Fri, 16 Jul 2010 05:51:51 +0000 (15:51 +1000)
prom_claim_chunk does the same thing as this loop, so we can
use it instead.

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

index 5c8c8ea2310344d081b97473d2c19d64b65c48bd..765c7bf46618d47a4d67872349360ac70461c147 100644 (file)
@@ -177,7 +177,6 @@ yaboot_start (unsigned long r3, unsigned long r4, unsigned long r5)
 {
      int result;
      void* malloc_base = NULL;
-     unsigned long addr;
      prom_handle root;
 
      /* OF seems to do it, but I'm not very confident */
@@ -187,10 +186,7 @@ yaboot_start (unsigned long r3, unsigned long r4, unsigned long r5)
      prom_init ((prom_entry) r5);
 
      /* Allocate some memory for malloc'ator */
-     for (addr = MALLOCADDR; addr <= MALLOCADDR * 16 ;addr+=0x100000) {
-         malloc_base = prom_claim((void *)addr, MALLOCSIZE, 0);
-         if (malloc_base != (void *)-1) break;
-     }
+     malloc_base = prom_claim_chunk((void *)MALLOCADDR, MALLOCSIZE, 0);
      if (malloc_base == (void *)-1) {
          prom_printf("Can't claim malloc buffer (%d bytes at 0x%08x)\n",
                      MALLOCSIZE, MALLOCADDR);