summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2015-02-27 22:06:36 -0700
committerSimon Glass <sjg@chromium.org>2015-04-23 09:05:53 -0600
commitfb5cf7f16be725aec7ab0016268b3b4e26460bee (patch)
tree755959683c0f163b7911e57d059fe467f585ab9a /common
parent0879361fd3bc33eb52bcfb2574a78f1e52a36429 (diff)
downloadtalos-obmc-uboot-fb5cf7f16be725aec7ab0016268b3b4e26460bee.tar.gz
talos-obmc-uboot-fb5cf7f16be725aec7ab0016268b3b4e26460bee.zip
Move initf_malloc() to a common place
To allow this function to be used from SPL, move it to the malloc() code. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'common')
-rw-r--r--common/board_f.c12
-rw-r--r--common/dlmalloc.c11
2 files changed, 12 insertions, 11 deletions
diff --git a/common/board_f.c b/common/board_f.c
index 90f3b8847f..322e0700d7 100644
--- a/common/board_f.c
+++ b/common/board_f.c
@@ -23,6 +23,7 @@
#include <i2c.h>
#include <initcall.h>
#include <logbuff.h>
+#include <malloc.h>
#include <mapmem.h>
/* TODO: Can we move these into arch/ headers? */
@@ -721,17 +722,6 @@ static int mark_bootstage(void)
return 0;
}
-static int initf_malloc(void)
-{
-#ifdef CONFIG_SYS_MALLOC_F_LEN
- assert(gd->malloc_base); /* Set up by crt0.S */
- gd->malloc_limit = gd->malloc_base + CONFIG_SYS_MALLOC_F_LEN;
- gd->malloc_ptr = 0;
-#endif
-
- return 0;
-}
-
static int initf_dm(void)
{
#if defined(CONFIG_DM) && defined(CONFIG_SYS_MALLOC_F_LEN)
diff --git a/common/dlmalloc.c b/common/dlmalloc.c
index b2ce063c5f..b5bb05191c 100644
--- a/common/dlmalloc.c
+++ b/common/dlmalloc.c
@@ -3261,6 +3261,17 @@ int mALLOPt(param_number, value) int param_number; int value;
}
}
+int initf_malloc(void)
+{
+#ifdef CONFIG_SYS_MALLOC_F_LEN
+ assert(gd->malloc_base); /* Set up by crt0.S */
+ gd->malloc_limit = CONFIG_SYS_MALLOC_F_LEN;
+ gd->malloc_ptr = 0;
+#endif
+
+ return 0;
+}
+
/*
History:
OpenPOWER on IntegriCloud