From 467bad5e368abfb8bca218b988567799e53f9e03 Mon Sep 17 00:00:00 2001 From: Sughosh Ganu Date: Fri, 21 Oct 2022 18:16:01 +0530 Subject: 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 Reviewed-by: Simon Glass Reviewed-by: Ilias Apalodimas Acked-by: Etienne Carriere --- common/board_r.c | 3 +++ common/event.c | 3 +++ 2 files changed, 6 insertions(+) (limited to 'common') diff --git a/common/board_r.c b/common/board_r.c index 98653de0553..828ad448668 100644 --- a/common/board_r.c +++ b/common/board_r.c @@ -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(); diff --git a/common/event.c b/common/event.c index 3e345509783..231b9e6ffdd 100644 --- a/common/event.c +++ b/common/event.c @@ -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"); -- cgit v1.2.3