[Concept,05/15] ulib: Disable the main loop
Commit Message
From: Simon Glass <sjg@chromium.org>
The application wants control once the U-Boot library is ready, so skip
the main loop and just return.
Signed-off-by: Simon Glass <sjg@chromium.org>
---
common/board_r.c | 8 ++++++++
include/init.h | 4 ++++
2 files changed, 12 insertions(+)
@@ -539,6 +539,9 @@ static int dm_announce(void)
static int run_main_loop(void)
{
+ if (gd_ulib())
+ return 0;
+
#ifdef CONFIG_SANDBOX
sandbox_main_loop_init();
#endif
@@ -768,6 +771,11 @@ void board_init_r(gd_t *new_gd, ulong dest_addr)
initcall_run_r();
+#ifdef CONFIG_ULIB
+ if (gd_ulib())
+ return;
+#endif
+
/* NOTREACHED - run_main_loop() does not return */
hang();
}
@@ -277,8 +277,12 @@ struct global_data;
void arch_setup_gd(struct global_data *gd_ptr);
/* common/board_r.c */
+#ifdef CONFIG_ULIB
+void board_init_r(struct global_data *id, ulong dest_addr);
+#else
void board_init_r(struct global_data *id, ulong dest_addr)
__attribute__ ((noreturn));
+#endif
int cpu_init_r(void);
int mac_read_from_eeprom(void);