mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-28 15:41:40 +00:00
event: Add an event for main_loop
Add an event type EVT_MAIN_LOOP that can be used for registering events that need to be run after the platform has been initialised and before the main_loop function is called. Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@linaro.org>
This commit is contained in:
parent
95b5a7de30
commit
467bad5e36
3 changed files with 9 additions and 0 deletions
|
@ -579,6 +579,9 @@ static int run_main_loop(void)
|
|||
#ifdef CONFIG_SANDBOX
|
||||
sandbox_main_loop_init();
|
||||
#endif
|
||||
|
||||
event_notify_null(EVT_MAIN_LOOP);
|
||||
|
||||
/* main_loop() can return to retry autoboot, if so just run it again */
|
||||
for (;;)
|
||||
main_loop();
|
||||
|
|
|
@ -38,6 +38,9 @@ const char *const type_name[] = {
|
|||
|
||||
/* fdt hooks */
|
||||
"ft_fixup",
|
||||
|
||||
/* main loop events */
|
||||
"main_loop",
|
||||
};
|
||||
|
||||
_Static_assert(ARRAY_SIZE(type_name) == EVT_COUNT, "event type_name size");
|
||||
|
|
|
@ -34,6 +34,9 @@ enum event_t {
|
|||
/* Device tree fixups before booting */
|
||||
EVT_FT_FIXUP,
|
||||
|
||||
/* To be called once, before calling main_loop() */
|
||||
EVT_MAIN_LOOP,
|
||||
|
||||
EVT_COUNT
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue