mirror of
https://github.com/u-boot/u-boot.git
synced 2025-05-09 03:21:51 +00:00
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>
This commit is contained in:
parent
0879361fd3
commit
fb5cf7f16b
3 changed files with 15 additions and 11 deletions
|
@ -23,6 +23,7 @@
|
||||||
#include <i2c.h>
|
#include <i2c.h>
|
||||||
#include <initcall.h>
|
#include <initcall.h>
|
||||||
#include <logbuff.h>
|
#include <logbuff.h>
|
||||||
|
#include <malloc.h>
|
||||||
#include <mapmem.h>
|
#include <mapmem.h>
|
||||||
|
|
||||||
/* TODO: Can we move these into arch/ headers? */
|
/* TODO: Can we move these into arch/ headers? */
|
||||||
|
@ -721,17 +722,6 @@ static int mark_bootstage(void)
|
||||||
return 0;
|
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)
|
static int initf_dm(void)
|
||||||
{
|
{
|
||||||
#if defined(CONFIG_DM) && defined(CONFIG_SYS_MALLOC_F_LEN)
|
#if defined(CONFIG_DM) && defined(CONFIG_SYS_MALLOC_F_LEN)
|
||||||
|
|
|
@ -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:
|
History:
|
||||||
|
|
|
@ -906,6 +906,9 @@ void *realloc_simple(void *ptr, size_t size);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* Set up pre-relocation malloc() ready for use */
|
||||||
|
int initf_malloc(void);
|
||||||
|
|
||||||
/* Public routines */
|
/* Public routines */
|
||||||
|
|
||||||
/* Simple versions which can be used when space is tight */
|
/* Simple versions which can be used when space is tight */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue