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

[Minios-devel] [UNIKRAFT PATCH v3 2/4] lib/ukboot: Modify ctor iteration to end at uk_ctortab_end


  • To: "minios-devel@xxxxxxxxxxxxx" <minios-devel@xxxxxxxxxxxxx>
  • From: Vlad-Andrei BĂDOIU (78692) <vlad_andrei.badoiu@xxxxxxxxxxxxxxx>
  • Date: Thu, 29 Aug 2019 16:19:38 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=stud.acs.upb.ro; dmarc=pass action=none header.from=stud.acs.upb.ro; dkim=pass header.d=stud.acs.upb.ro; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=xXnoOhkDK596OQqp2Nso/kkNulrL3awP7Z7Cdsk7trY=; b=F4jGkjJzkszO7UJRtF9nCDw/GzWsOucW3OgTX4UzO3+blZSQUHEZYra/Z91pJtRiN4wQcpCW9m5S9YUhwiWC1PIQqFRENq5hEX455IiGsAOu9DPh3d71kQdpzijQr1WztaUU8gIZkKjpxD7MyRr4N5dNuhlDDV5XKkHdnAHAI6oAKYGZsys2Cq7opbCUC4aPNvYQB1LHOnctsigB95sciS7BdBVhtNCM3ULN91Sh3vIDyffW/o8Jnzn0sZvyOkEuiFAtLLWFAiNqS7KzMQuUR+dVj1xkJm5ZTc06G9nu6X7WKV1Zlxs8WC/SBalZxxeGdI/5n5oE0GyZoVvUNeFcXA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YnYZcNkZSS43dFGqS68wxGCStxtdMo1nOPitamN2Yp7pGKBSa5/mELDh31B3V5FMpIO3G9oq9fu/I8Uy307tIqHNk4DbFA/UsKFku3fQpM4Lq48Yw2r9d2qQlBfT4k52UgISBgd6CyJvNZxbFsa0Qi73CyeHEWhgCGvJo+Cqk1Ktb6CWgAdPARSfXVAnw3G8llh4rS15B5sInt6mawbLlSd8fjz8dS8FV2BzZGjsT7idMylNn9JfHN9mDjOQamExzhyKDg54o6szZ1DR3SOapB5yAPHB15f51zJz+h/146g98C6hJRw9MU51wqt0Fk2hv/U8kapyof/wwhLWJe6Hmw==
  • Authentication-results: spf=none (sender IP is ) smtp.mailfrom=vlad_andrei.badoiu@xxxxxxxxxxxxxxx;
  • Cc: "simon.kuenzer@xxxxxxxxx" <simon.kuenzer@xxxxxxxxx>, Vlad-Andrei BĂDOIU (78692) <vlad_andrei.badoiu@xxxxxxxxxxxxxxx>
  • Delivery-date: Thu, 29 Aug 2019 16:19:44 +0000
  • List-id: Mini-os development list <minios-devel.lists.xenproject.org>
  • Thread-index: AQHVXoWOOu/s6CuJAUGRgr/jHC+/DQ==
  • Thread-topic: [UNIKRAFT PATCH v3 2/4] lib/ukboot: Modify ctor iteration to end at uk_ctortab_end

From: Vlad-Andrei BĂDOIU (78692) <vlad_andrei.badoiu@xxxxxxxxxxxxxxx>

The iteration thourgh the ctortab array of constructors now ends at
uk_ctortab_end. We now use the ukplat_ctor_foreach macro.

Signed-off-by: Vlad-Andrei Badoiu <vlad_andrei.badoiu@xxxxxxxxxxxxxxx>
---
 include/uk/ctors.h | 1 +
 lib/ukboot/boot.c  | 8 ++++----
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/include/uk/ctors.h b/include/uk/ctors.h
index a3432e2b..8572cc4b 100644
--- a/include/uk/ctors.h
+++ b/include/uk/ctors.h
@@ -45,6 +45,7 @@ extern "C" {
 
 typedef void (*uk_ctor_func_t)(void);
 extern const uk_ctor_func_t uk_ctortab[];
+extern const uk_ctor_func_t uk_ctortab_end;
 
 /*
  * Register a constructor function that is
diff --git a/lib/ukboot/boot.c b/lib/ukboot/boot.c
index 9738a912..910cd61d 100644
--- a/lib/ukboot/boot.c
+++ b/lib/ukboot/boot.c
@@ -166,8 +166,8 @@ void ukplat_entry_argp(char *arg0, char *argb, __sz 
argb_len)
 /* defined in <uk/plat.h> */
 void ukplat_entry(int argc, char *argv[])
 {
-       const uk_ctor_func_t *cfn;
        struct thread_main_arg tma;
+       int i;
        int kern_args = 0;
        int rc __maybe_unused = 0;
 #if CONFIG_LIBUKALLOC
@@ -182,9 +182,9 @@ void ukplat_entry(int argc, char *argv[])
 #endif
 
        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)();
+       ukplat_ctor_foreach(uk_ctortab, uk_ctortab_end, i) {
+               uk_pr_debug("Call constructor %p\n", uk_ctortab[i]);
+               uk_ctortab[i]();
        }
 
 #ifdef CONFIG_LIBUKLIBPARAM
-- 
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®.