From: Michalis Pappas Date: Tue, 25 Mar 2025 14:46:10 +0000 (+0100) Subject: include/uk/init: Add main thread to init ctx X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=d5a64db13f2143b6d268c7be8919957d7a541b46;p=unikraft%2Funikraft.git include/uk/init: Add main thread to init ctx Add a new field to init ctx for the thread that executes main(). If main() does not execute on a separate thread, this is set to NULL. Signed-off-by: Michalis Pappas Approved-by: Andrei Tatar Approved-by: Sergiu Moga Reviewed-by: Andrei Tatar Reviewed-by: Sergiu Moga GitHub-Closes: #1620 --- diff --git a/include/uk/init.h b/include/uk/init.h index 4bd6472bd..36b4bc153 100644 --- a/include/uk/init.h +++ b/include/uk/init.h @@ -39,6 +39,10 @@ #include #include +#if CONFIG_LIBUKSCHED +#include +#endif /* CONFIG_LIBUKSCHED */ + #ifdef __cplusplus extern "C" { #endif @@ -48,6 +52,12 @@ struct uk_init_ctx { int argc; char **argv; } cmdline; +#if CONFIG_LIBUKSCHED + /* Set if main() executes on a separate thread, + * otherwise NULL. + */ + struct uk_thread *tmain; +#endif /* CONFIG_LIBUKSCHED */ /* reserved for future additions */ };