aboutsummaryrefslogtreecommitdiff
path: root/include/asm-generic
diff options
context:
space:
mode:
authorSimon Glass2023-09-26 08:14:31 -0600
committerTom Rini2023-10-06 14:38:12 -0400
commit2003a83cc8b3937cda09e712c75f50f579eed3fa (patch)
tree0ee4fca536adb59c2862affa0cc240666cc1cfb1 /include/asm-generic
parent7907a7b99a582f511f93071896c6f8e9163f81d1 (diff)
spl: Avoid an #ifdef when printing gd->malloc_ptr
Use an accessor in the header file to avoid this. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/asm-generic')
-rw-r--r--include/asm-generic/global_data.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/asm-generic/global_data.h b/include/asm-generic/global_data.h
index f8fc87f1e46..937fb12516c 100644
--- a/include/asm-generic/global_data.h
+++ b/include/asm-generic/global_data.h
@@ -588,6 +588,12 @@ static_assert(sizeof(struct global_data) == GD_SIZE);
#define gd_set_pci_ram_top(val)
#endif
+#if CONFIG_VAL(SYS_MALLOC_F_LEN)
+#define gd_malloc_ptr() gd->malloc_ptr
+#else
+#define gd_malloc_ptr() 0L
+#endif
+
/**
* enum gd_flags - global data flags
*