From 2c611ced5c7fa551d47da32e574bc7f2ff2df18b Mon Sep 17 00:00:00 2001 From: Anton Blanchard Date: Thu, 8 Jul 2010 19:03:33 +0000 Subject: [PATCH] Use prom_claim_chunk to allocate malloc area prom_claim_chunk does the same thing as this loop, so we can use it instead. Signed-off-by: Anton Blanchard Signed-off-by: Tony Breeds --- second/yaboot.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/second/yaboot.c b/second/yaboot.c index 5c8c8ea..765c7bf 100644 --- a/second/yaboot.c +++ b/second/yaboot.c @@ -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); -- 2.39.2