]> xenbits.xensource.com Git - unikraft/unikraft.git/commitdiff
include/uk/init: Add main thread to init ctx
authorMichalis Pappas <michalis@unikraft.io>
Tue, 25 Mar 2025 14:46:10 +0000 (15:46 +0100)
committerUnikraft Bot <monkey@unikraft.io>
Thu, 17 Apr 2025 12:41:44 +0000 (12:41 +0000)
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 <michalis@unikraft.io>
Approved-by: Andrei Tatar <andrei@unikraft.io>
Approved-by: Sergiu Moga <sergiu@unikraft.io>
Reviewed-by: Andrei Tatar <andrei@unikraft.io>
Reviewed-by: Sergiu Moga <sergiu@unikraft.io>
GitHub-Closes: #1620

include/uk/init.h

index 4bd6472bd9152cba148373ddb14c2942387c6031..36b4bc1531cdae3fd992cbac108ac3df6ec2cb7d 100644 (file)
 #include <uk/essentials.h>
 #include <uk/prio.h>
 
+#if CONFIG_LIBUKSCHED
+#include <uk/thread.h>
+#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 */
 };