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

[Minios-devel] [UNIKRAFT PATCH v2 4/4] lib/ukboot: Call library constructors



Call library constructors listed in ukplat_ctortab
(include/uk/plat/ctors.h) during bootstrapping.

Signed-off-by: Simon Kuenzer <simon.kuenzer@xxxxxxxxx>
---
 lib/ukboot/boot.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/lib/ukboot/boot.c b/lib/ukboot/boot.c
index acbae6e..0bfd3ad 100644
--- a/lib/ukboot/boot.c
+++ b/lib/ukboot/boot.c
@@ -48,6 +48,7 @@
 #endif
 #include <uk/arch/lcpu.h>
 #include <uk/plat/bootstrap.h>
+#include <uk/plat/ctors.h>
 #include <uk/plat/memory.h>
 #include <uk/plat/time.h>
 #include <uk/essentials.h>
@@ -105,6 +106,7 @@ void ukplat_entry_argp(char *arg0, char *argb, __sz 
argb_len)
 /* defined in <uk/plat.h> */
 void ukplat_entry(int argc, char *argv[])
 {
+       const ukplat_ctor_func_t *cfn;
        int i;
        struct thread_main_arg tma;
 #if LIBUKALLOC || LIBUKSCHED
@@ -127,6 +129,13 @@ void ukplat_entry(int argc, char *argv[])
                  STRINGIFY(UK_CODENAME) " " STRINGIFY(UK_FULLVERSION));
 #endif
 
+       /* Call constructor functions */
+       uk_printd(DLVL_INFO, "Call constructors...\n");
+       for (cfn = ukplat_ctortab; *cfn != NULL; ++cfn) {
+               uk_printd(DLVL_EXTRA, "Call constructor %p\n", *cfn);
+               (*cfn)();
+       }
+
        ukplat_time_init();
 
 #if LIBUKALLOC && LIBUKALLOCBBUDDY && LIBUKBOOT_INITALLOC
-- 
2.7.4


_______________________________________________
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®.