On 14 September 2015 at 06:15, Bin Meng <bmeng...@gmail.com> wrote: > On Wed, Sep 9, 2015 at 7:52 AM, Simon Glass <s...@chromium.org> wrote: >> It's useful to get a a trace of memory allocations in early init. Add a >> debug() call to provide that. It can be enabled by adding '#define DEBUG' >> to the top of the file. >> >> Signed-off-by: Simon Glass <s...@chromium.org> >> --- >> >> common/malloc_simple.c | 4 ++++ >> 1 file changed, 4 insertions(+) >> >> diff --git a/common/malloc_simple.c b/common/malloc_simple.c >> index 134e059..e357827 100644 >> --- a/common/malloc_simple.c >> +++ b/common/malloc_simple.c >> @@ -19,10 +19,13 @@ void *malloc_simple(size_t bytes) >> void *ptr; >> >> new_ptr = gd->malloc_ptr + bytes; >> + debug("%s: size=%zx, ptr=%lx, limit=%lx\n", __func__, bytes, new_ptr, >> + gd->malloc_limit); >> if (new_ptr > gd->malloc_limit) >> return NULL; >> ptr = map_sysmem(gd->malloc_base + gd->malloc_ptr, bytes); >> gd->malloc_ptr = ALIGN(new_ptr, sizeof(new_ptr)); >> + >> return ptr; >> } >> >> @@ -37,6 +40,7 @@ void *memalign_simple(size_t align, size_t bytes) >> return NULL; >> ptr = map_sysmem(addr, bytes); >> gd->malloc_ptr = ALIGN(new_ptr, sizeof(new_ptr)); >> + >> return ptr; >> } >> >> -- > > Reviewed-by: Bin Meng <bmeng...@gmail.com>
Applied to u-boot-x86. _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot