Consolidate arch-specific sbrk() implementations

Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
This commit is contained in:
Peter Tyser
2009-08-21 23:05:19 -05:00
committed by Wolfgang Denk
parent 65f6f07b72
commit 5e93bd1c9a
14 changed files with 28 additions and 230 deletions

View File

@ -1502,7 +1502,23 @@ void malloc_bin_reloc (void)
*p++ += gd->reloc_off;
}
}
ulong mem_malloc_start = 0;
ulong mem_malloc_end = 0;
ulong mem_malloc_brk = 0;
void *sbrk(ptrdiff_t increment)
{
ulong old = mem_malloc_brk;
ulong new = old + increment;
if ((new < mem_malloc_start) || (new > mem_malloc_end))
return NULL;
mem_malloc_brk = new;
return (void *)old;
}
/* field-extraction macros */