]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
event: Add an event for main_loop
authorSughosh Ganu <sughosh.ganu@linaro.org>
Fri, 21 Oct 2022 12:46:01 +0000 (18:16 +0530)
committerTom Rini <trini@konsulko.com>
Mon, 31 Oct 2022 18:47:32 +0000 (14:47 -0400)
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>
common/board_r.c
common/event.c
include/event.h

index 98653de0553b61214105628677d7b039b21e74f6..828ad448668042087903044e9461ae2033b848a2 100644 (file)
@@ -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();
index 3e345509783918fe3742074ba2785f87e0809b05..231b9e6ffdd27e46e2e16cd96b57664fa45a55a0 100644 (file)
@@ -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");
index 3e6dcbc3dd62128d2e13ef6e6332914969211e63..e4580b683502c710f7a88b88223c5d70795074ac 100644 (file)
@@ -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
 };