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>
{
int result;
void* malloc_base = NULL;
{
int result;
void* malloc_base = NULL;
prom_handle root;
/* OF seems to do it, but I'm not very confident */
prom_handle root;
/* OF seems to do it, but I'm not very confident */
prom_init ((prom_entry) r5);
/* Allocate some memory for malloc'ator */
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);
if (malloc_base == (void *)-1) {
prom_printf("Can't claim malloc buffer (%d bytes at 0x%08x)\n",
MALLOCSIZE, MALLOCADDR);