From fb5cf7f16be725aec7ab0016268b3b4e26460bee Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Fri, 27 Feb 2015 22:06:36 -0700 Subject: 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 --- common/dlmalloc.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'common/dlmalloc.c') 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: -- cgit v1.2.3