Merge branch 'master' of git://git.denx.de/u-boot-arm
[oweals/u-boot.git] / common / dlmalloc.c
index f3bced463fd10773069ba14f5c23c6b781d84c69..735b3443e63a556e0af9dbd63f3def0286f85a0a 100644 (file)
@@ -1494,6 +1494,7 @@ static mbinptr av_[NAV * 2 + 2] = {
  IAV(120), IAV(121), IAV(122), IAV(123), IAV(124), IAV(125), IAV(126), IAV(127)
 };
 
+#ifndef CONFIG_RELOC_FIXUP_WORKS
 void malloc_bin_reloc (void)
 {
        unsigned long *p = (unsigned long *)(&av_[2]);
@@ -1502,6 +1503,7 @@ void malloc_bin_reloc (void)
                *p++ += gd->reloc_off;
        }
 }
+#endif
 
 ulong mem_malloc_start = 0;
 ulong mem_malloc_end = 0;
@@ -1520,6 +1522,15 @@ void *sbrk(ptrdiff_t increment)
        return (void *)old;
 }
 
+void mem_malloc_init(ulong start, ulong size)
+{
+       mem_malloc_start = start;
+       mem_malloc_end = start + size;
+       mem_malloc_brk = start;
+
+       memset((void *)mem_malloc_start, 0, size);
+}
+
 /* field-extraction macros */
 
 #define first(b) ((b)->fd)