summaryrefslogtreecommitdiff
path: root/common/dlmalloc.c
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2024-10-25 14:22:36 -0600
committerTom Rini <trini@konsulko.com>2024-10-25 14:22:36 -0600
commitdeafcdc8e014dc83f154cc448cf8cf6a24b29136 (patch)
tree853fc8fe04e1235d55b077f86e22dfc0ba0a41f2 /common/dlmalloc.c
parent3fbc657669591ca893613f14d42e07069b7d56cd (diff)
parent9252b7f867f7638ba3f6af85058fee7b3993222d (diff)
Merge patch series "Allow showing the memory map"
Simon Glass <sjg@chromium.org> says: This little series adds a new 'memmap' command, intended to show the layout of memory within U-Boot and how much memory is available for loading images. Link: https://lore.kernel.org/r/20241021081934.289473-1-sjg@chromium.org
Diffstat (limited to 'common/dlmalloc.c')
-rw-r--r--common/dlmalloc.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/common/dlmalloc.c b/common/dlmalloc.c
index 1ac7ce3f43c..cc4d3a0a028 100644
--- a/common/dlmalloc.c
+++ b/common/dlmalloc.c
@@ -16,6 +16,8 @@
#include <asm/global_data.h>
#include <malloc.h>
+#include <mapmem.h>
+#include <string.h>
#include <asm/io.h>
#include <valgrind/memcheck.h>
@@ -598,9 +600,9 @@ void *sbrk(ptrdiff_t increment)
void mem_malloc_init(ulong start, ulong size)
{
- mem_malloc_start = start;
- mem_malloc_end = start + size;
- mem_malloc_brk = start;
+ mem_malloc_start = (ulong)map_sysmem(start, size);
+ mem_malloc_end = mem_malloc_start + size;
+ mem_malloc_brk = mem_malloc_start;
#ifdef CONFIG_SYS_MALLOC_DEFAULT_TO_INIT
malloc_init();