global_data: Reduce size of early-malloc vars

The early malloc region is normally quite small and is certainly less
than 4GB, so use a 32-bit value for the limit and pointer. Update the
comments for clarity while we are here.

Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Simon Glass
2024-08-23 14:27:04 -06:00
committed by Tom Rini
parent c283a2664e
commit 92aa3ec321
5 changed files with 10 additions and 10 deletions

View File

@@ -23,7 +23,7 @@ static void *alloc_simple(size_t bytes, int align)
addr = ALIGN(gd->malloc_base + gd->malloc_ptr, align);
new_ptr = addr + bytes - gd->malloc_base;
log_debug("size=%lx, ptr=%lx, limit=%lx: ", (ulong)bytes, new_ptr,
log_debug("size=%lx, ptr=%lx, limit=%x: ", (ulong)bytes, new_ptr,
gd->malloc_limit);
if (new_ptr > gd->malloc_limit) {
log_err("alloc space exhausted\n");
@@ -87,6 +87,6 @@ void free_simple(void *ptr)
void malloc_simple_info(void)
{
log_info("malloc_simple: %lx bytes used, %lx remain\n", gd->malloc_ptr,
log_info("malloc_simple: %x bytes used, %x remain\n", gd->malloc_ptr,
CONFIG_VAL(SYS_MALLOC_F_LEN) - gd->malloc_ptr);
}