[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Minios-devel] [UNIKRAFT PATCH 2/3] lib/ukboot: Call internal constructors



Signed-off-by: Vlad-Andrei Badoiu <vlad_andrei.badoiu@xxxxxxxxxxxxxxx>
---
 lib/ukboot/boot.c | 26 +++++++++++++++++---------
 1 file changed, 17 insertions(+), 9 deletions(-)

diff --git a/lib/ukboot/boot.c b/lib/ukboot/boot.c
index 48467828..53b32ba4 100644
--- a/lib/ukboot/boot.c
+++ b/lib/ukboot/boot.c
@@ -56,6 +56,7 @@
 #include <uk/plat/time.h>
 #include <uk/essentials.h>
 #include <uk/print.h>
+#include <uk/ctors.h>
 #include <uk/argparse.h>
 #if CONFIG_LIBUKBUS
 #include <uk/bus.h>
@@ -141,6 +142,7 @@ void ukplat_entry_argp(char *arg0, char *argb, __sz 
argb_len)
 void ukplat_entry(int argc, char *argv[])
 {
        int i;
+       const uk_ctor_func_t *cfn;
        struct thread_main_arg tma;
 #if CONFIG_LIBUKALLOC
        struct uk_alloc *a = NULL;
@@ -165,15 +167,10 @@ void ukplat_entry(int argc, char *argv[])
                }
        }
 
-       uk_pr_info("Constructor table at %p - %p\n",
-                  __init_array_start, &__init_array_end);
-       ukplat_ctor_foreach(__init_array_start, __init_array_end, i) {
-               if (__init_array_start[i]) {
-                       uk_pr_debug("Call constructor (entry %d (%p): 
%p())...\n",
-                                   i, &__init_array_start[i],
-                                   __init_array_start[i]);
-                       __init_array_start[i]();
-               }
+       uk_pr_info("Unikraft constructors table at %p\n", uk_ctortab);
+       for (cfn = uk_ctortab; *cfn != NULL; ++cfn) {
+               uk_pr_debug("Call constructor %p\n", *cfn);
+               (*cfn)();
        }
 
 #if CONFIG_LIBUKALLOC && CONFIG_LIBUKALLOCBBUDDY && CONFIG_LIBUKBOOT_INITALLOC
@@ -255,6 +252,17 @@ void ukplat_entry(int argc, char *argv[])
        tma.argc = argc;
        tma.argv = argv;
 
+       uk_pr_info("Constructor table at %p - %p\n",
+                       __init_array_start, &__init_array_end);
+       ukplat_ctor_foreach(__init_array_start, __init_array_end, i) {
+               if (__init_array_start[i]) {
+                       uk_pr_debug("Call constructor (entry %d (%p): 
%p())...\n",
+                                       i, &__init_array_start[i],
+                                       __init_array_start[i]);
+                       __init_array_start[i]();
+               }
+       }
+
 #if CONFIG_LIBUKSCHED
        main_thread = uk_thread_create("main", main_thread_func, &tma);
        if (unlikely(!main_thread))
-- 
2.20.1


_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.