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

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



Hello Vlad,

Sorry I missed a comment, please find it inline.

Thanks & Regards
Sharan


On 4/12/19 5:11 PM, Sharan Santhanam wrote:
Hello Vlad,

this patch seems fine.

Reviewed-by: Sharan Santhanam <sharan.santhanam@xxxxxxxxx>

Thanks & Regards
Sharan

On 4/10/19 1:02 PM, Vlad-Andrei BĂDOIU (78692) wrote:
From: Vlad-Andrei BĂDOIU (78692) <vlad_andrei.badoiu@xxxxxxxxxxxxxxx>

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..90224986 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>
@@ -79,6 +80,17 @@ static void main_thread_func(void *arg)
      int ret;
      struct thread_main_arg *tma = arg;

We move the __init_array_start alone. We should also move the __preinit_array_start table. I moved it and tested it seems to work fine.
+    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]();
+        }
+    }
+
  #ifdef CONFIG_LIBUKBUS
      uk_pr_info("Initialize bus handlers...\n");
      uk_bus_init_all(uk_alloc_get_default());
@@ -141,6 +153,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 +178,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


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

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