ARM: renesas: Drop unused mmc.h
[pandora-u-boot.git] / common / dlmalloc.c
index dcecdb8..de3f042 100644 (file)
@@ -8,14 +8,14 @@
  * as file malloc-2.6.6.c.
  */
 
-#include <common.h>
-#include <log.h>
-#include <asm/global_data.h>
-
 #if CONFIG_IS_ENABLED(UNIT_TEST)
 #define DEBUG
 #endif
 
+#include <common.h>
+#include <log.h>
+#include <asm/global_data.h>
+
 #include <malloc.h>
 #include <asm/io.h>
 #include <valgrind/memcheck.h>
@@ -575,19 +575,6 @@ static mbinptr av_[NAV * 2 + 2] = {
  IAV(120), IAV(121), IAV(122), IAV(123), IAV(124), IAV(125), IAV(126), IAV(127)
 };
 
-#ifdef CONFIG_NEEDS_MANUAL_RELOC
-static void malloc_bin_reloc(void)
-{
-       mbinptr *p = &av_[2];
-       size_t i;
-
-       for (i = 2; i < ARRAY_SIZE(av_); ++i, ++p)
-               *p = (mbinptr)((ulong)*p + gd->reloc_off);
-}
-#else
-static inline void malloc_bin_reloc(void) {}
-#endif
-
 #ifdef CONFIG_SYS_MALLOC_DEFAULT_TO_INIT
 static void malloc_init(void);
 #endif
@@ -634,7 +621,6 @@ void mem_malloc_init(ulong start, ulong size)
 #if CONFIG_IS_ENABLED(SYS_MALLOC_CLEAR_ON_INIT)
        memset((void *)mem_malloc_start, 0x0, size);
 #endif
-       malloc_bin_reloc();
 }
 
 /* field-extraction macros */
@@ -1305,7 +1291,7 @@ Void_t* mALLOc(bytes) size_t bytes;
 
   INTERNAL_SIZE_T nb;
 
-#if CONFIG_VAL(SYS_MALLOC_F_LEN)
+#if CONFIG_IS_ENABLED(SYS_MALLOC_F)
        if (!(gd->flags & GD_FLG_FULL_MALLOC_INIT))
                return malloc_simple(bytes);
 #endif
@@ -1586,7 +1572,7 @@ void fREe(mem) Void_t* mem;
   mchunkptr fwd;       /* misc temp for linking */
   int       islr;      /* track whether merging with last_remainder */
 
-#if CONFIG_VAL(SYS_MALLOC_F_LEN)
+#if CONFIG_IS_ENABLED(SYS_MALLOC_F)
        /* free() is a no-op - all the memory will be freed on relocation */
        if (!(gd->flags & GD_FLG_FULL_MALLOC_INIT)) {
                VALGRIND_FREELIKE_BLOCK(mem, SIZE_SZ);
@@ -1749,7 +1735,7 @@ Void_t* rEALLOc(oldmem, bytes) Void_t* oldmem; size_t bytes;
   /* realloc of null is supposed to be same as malloc */
   if (oldmem == NULL) return mALLOc(bytes);
 
-#if CONFIG_VAL(SYS_MALLOC_F_LEN)
+#if CONFIG_IS_ENABLED(SYS_MALLOC_F)
        if (!(gd->flags & GD_FLG_FULL_MALLOC_INIT)) {
                /* This is harder to support and should not be needed */
                panic("pre-reloc realloc() is not supported");
@@ -1971,7 +1957,7 @@ Void_t* mEMALIGn(alignment, bytes) size_t alignment; size_t bytes;
 
   if ((long)bytes < 0) return NULL;
 
-#if CONFIG_VAL(SYS_MALLOC_F_LEN)
+#if CONFIG_IS_ENABLED(SYS_MALLOC_F)
        if (!(gd->flags & GD_FLG_FULL_MALLOC_INIT)) {
                return memalign_simple(alignment, bytes);
        }
@@ -2167,7 +2153,7 @@ Void_t* cALLOc(n, elem_size) size_t n; size_t elem_size;
     return NULL;
   else
   {
-#if CONFIG_VAL(SYS_MALLOC_F_LEN)
+#if CONFIG_IS_ENABLED(SYS_MALLOC_F)
        if (!(gd->flags & GD_FLG_FULL_MALLOC_INIT)) {
                memset(mem, 0, sz);
                return mem;
@@ -2469,7 +2455,7 @@ int mALLOPt(param_number, value) int param_number; int value;
 
 int initf_malloc(void)
 {
-#if CONFIG_VAL(SYS_MALLOC_F_LEN)
+#if CONFIG_IS_ENABLED(SYS_MALLOC_F)
        assert(gd->malloc_base);        /* Set up by crt0.S */
        gd->malloc_limit = CONFIG_VAL(SYS_MALLOC_F_LEN);
        gd->malloc_ptr = 0;