"Das U-Boot" Source Tree
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

sandbox: Set up global_data earlier

It is possible for U-Boot functions such as printf() to be called
within state_init(). This can end up checking gd->flags (e.g. in putc())
before global_data is set up.

Move the setup earlier to avoid this. This fixes the suppression of some
debug output in memory allocation (when enabled).

Signed-off-by: Simon Glass <sjg@chromium.org>

authored by

Simon Glass and committed by
Tom Rini
16b9c64c 5b33660c

+3 -2
+3 -2
arch/sandbox/cpu/start.c
··· 483 483 484 484 text_base = os_find_text_base(); 485 485 486 + memset(&data, '\0', sizeof(data)); 487 + gd = &data; 488 + 486 489 /* 487 490 * This must be the first invocation of os_malloc() to have 488 491 * state->ram_buf in the low 4 GiB. ··· 501 504 os_exit(1); 502 505 memcpy(os_argv, argv, size); 503 506 504 - memset(&data, '\0', sizeof(data)); 505 - gd = &data; 506 507 gd->arch.text_base = text_base; 507 508 508 509 state = state_get_current();