summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2023-07-16 06:38:53 +0300
committerBin Meng <bmeng@tinylab.org>2023-07-17 12:12:21 +0300
commit0be0f205b974abb7b464e5b2819db47bbc6d5f1f (patch)
tree3ac91ea1c4be56aae610d6f1d81c9114c6f0051b /include
parent8f015d37813b398c9f2bde9bbf531278a399ad88 (diff)
downloadu-boot-0be0f205b974abb7b464e5b2819db47bbc6d5f1f.tar.xz
bdinfo: Show the malloc base with the bdinfo command
It is useful to see the base of the malloc region. This is visible when debugging but not in normal usage. Add it to the global data so that it can be shown. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Nikhil M Jain <n-jain1@ti.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Nikhil M Jain <n-jain1@ti.com>
Diffstat (limited to 'include')
-rw-r--r--include/asm-generic/global_data.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/asm-generic/global_data.h b/include/asm-generic/global_data.h
index a1e1b9d640..8fc205ded1 100644
--- a/include/asm-generic/global_data.h
+++ b/include/asm-generic/global_data.h
@@ -301,6 +301,12 @@ struct global_data {
* @timebase_l: low 32 bits of timer
*/
unsigned int timebase_l;
+ /**
+ * @malloc_start: start of malloc() region
+ */
+#if CONFIG_IS_ENABLED(CMD_BDINFO_EXTRA)
+ unsigned long malloc_start;
+#endif
#if CONFIG_VAL(SYS_MALLOC_F_LEN)
/**
* @malloc_base: base address of early malloc()
@@ -560,6 +566,13 @@ static_assert(sizeof(struct global_data) == GD_SIZE);
#define gd_event_state() NULL
#endif
+#if CONFIG_IS_ENABLED(CMD_BDINFO_EXTRA)
+#define gd_malloc_start() gd->malloc_start
+#define gd_set_malloc_start(_val) gd->malloc_start = (_val)
+#else
+#define gd_malloc_start() 0
+#define gd_set_malloc_start(val)
+#endif
/**
* enum gd_flags - global data flags
*