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

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





On 02/12/2018 05:01 PM, Simon Kuenzer wrote:
Call library constructors listed in ukplat_ctortab
(include/uk/plat/ctors.h) during bootstrapping.

Signed-off-by: Simon Kuenzer <simon.kuenzer@xxxxxxxxx>

Reviewed-by: Florian Schmidt <florian.schmidt@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


--
Dr. Florian Schmidt
フローリアン・シュミット
Research Scientist,
Systems and Machine Learning Group
NEC Laboratories Europe
Kurfürsten-Anlage 36, D-69115 Heidelberg
Tel.     +49 (0)6221 4342-265
Fax:     +49 (0)6221 4342-155
e-mail:  florian.schmidt@xxxxxxxxx
============================================================
Registered at Amtsgericht Mannheim, Germany, HRB728558

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