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>
This commit is contained in:
@@ -860,10 +860,11 @@ void board_init_r(gd_t *dummy1, ulong dummy2)
|
|||||||
} else {
|
} else {
|
||||||
debug("Unsupported OS image.. Jumping nevertheless..\n");
|
debug("Unsupported OS image.. Jumping nevertheless..\n");
|
||||||
}
|
}
|
||||||
#if CONFIG_IS_ENABLED(SYS_MALLOC_F) && !defined(CONFIG_SPL_SYS_MALLOC_SIZE)
|
if (CONFIG_IS_ENABLED(SYS_MALLOC_F) &&
|
||||||
debug("SPL malloc() used 0x%lx bytes (%ld KB)\n", gd->malloc_ptr,
|
!IS_ENABLED(CONFIG_SPL_SYS_MALLOC_SIZE))
|
||||||
gd->malloc_ptr / 1024);
|
debug("SPL malloc() used 0x%lx bytes (%ld KB)\n",
|
||||||
#endif
|
gd_malloc_ptr(), gd_malloc_ptr() / 1024);
|
||||||
|
|
||||||
bootstage_mark_name(get_bootstage_id(false), "end phase");
|
bootstage_mark_name(get_bootstage_id(false), "end phase");
|
||||||
#ifdef CONFIG_BOOTSTAGE_STASH
|
#ifdef CONFIG_BOOTSTAGE_STASH
|
||||||
ret = bootstage_stash((void *)CONFIG_BOOTSTAGE_STASH_ADDR,
|
ret = bootstage_stash((void *)CONFIG_BOOTSTAGE_STASH_ADDR,
|
||||||
|
@@ -588,6 +588,12 @@ static_assert(sizeof(struct global_data) == GD_SIZE);
|
|||||||
#define gd_set_pci_ram_top(val)
|
#define gd_set_pci_ram_top(val)
|
||||||
#endif
|
#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
|
* enum gd_flags - global data flags
|
||||||
*
|
*
|
||||||
|
Reference in New Issue
Block a user