} else {
debug("Unsupported OS image.. Jumping nevertheless..\n");
}
-#if CONFIG_IS_ENABLED(SYS_MALLOC_F) && !defined(CONFIG_SPL_SYS_MALLOC_SIZE)
- debug("SPL malloc() used 0x%lx bytes (%ld KB)\n", gd->malloc_ptr,
- gd->malloc_ptr / 1024);
-#endif
+ if (CONFIG_IS_ENABLED(SYS_MALLOC_F) &&
+ !IS_ENABLED(CONFIG_SPL_SYS_MALLOC_SIZE))
+ debug("SPL malloc() used 0x%lx bytes (%ld KB)\n",
+ gd_malloc_ptr(), gd_malloc_ptr() / 1024);
+
bootstage_mark_name(get_bootstage_id(false), "end phase");
#ifdef CONFIG_BOOTSTAGE_STASH
ret = bootstage_stash((void *)CONFIG_BOOTSTAGE_STASH_ADDR,
#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
*