From 7b395232da84ae59bd32985bf944a0a9f417a543 Mon Sep 17 00:00:00 2001 From: Gabor Juhos Date: Mon, 21 Jan 2013 21:10:38 +0000 Subject: malloc: make malloc_bin_reloc static MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On architectures where manual relocation is needed, the 'malloc_bin_reloc' function must be called after 'mem_malloc_init'. Make the 'malloc_bin_reloc' function static and call it directly from 'mem_malloc_init' instead of calling that from board_init_{r,f} functions of the affected architectures. Signed-off-by: Gabor Juhos Cc: Wolfgang Denk Cc: Andreas Bießmann Cc: Jason Jin Cc: Macpaul Lin Cc: Daniel Hellstrom Cc: Daniel Schwierzeck --- common/dlmalloc.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'common/dlmalloc.c') diff --git a/common/dlmalloc.c b/common/dlmalloc.c index b2f0a1ad52..2a9d169f92 100644 --- a/common/dlmalloc.c +++ b/common/dlmalloc.c @@ -1485,7 +1485,7 @@ static mbinptr av_[NAV * 2 + 2] = { }; #ifdef CONFIG_NEEDS_MANUAL_RELOC -void malloc_bin_reloc (void) +static void malloc_bin_reloc(void) { mbinptr *p = &av_[2]; size_t i; @@ -1493,6 +1493,8 @@ void malloc_bin_reloc (void) 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 ulong mem_malloc_start = 0; @@ -1526,6 +1528,8 @@ void mem_malloc_init(ulong start, ulong size) mem_malloc_brk = start; memset((void *)mem_malloc_start, 0, size); + + malloc_bin_reloc(); } /* field-extraction macros */ -- cgit v1.2.3