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

[Minios-devel] [UNIKRAFT PATCH v2 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:06:56 +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=hLMbJUSuKX7nYUk0MjQRQ4KJlb5LxGWGAobEC1OjQ6s=; b=mS8BHUqPJnWdWQ1CQrGsJVzSPP+KSrqrk8oRLIvdvH17WxE0KgRGqQ3VEkrUAN3aZSu1yhowUFfhOhChvsECCBgwGKQsTm7VfTiw3koMWidhR78l9NIR+56MHSAu+1p6v22tM2g4xsXmpJcIdVfjtaHhqN3l4HxS4LLma2780M7dWemZjVMeN59QsjNkDR9wj9JY+m4Eosew0QGadpn8Nr+rdfuuqwDHkihGZFPEOolteldG/PrPyuOWUAZ6AEt+4Kn7D+waYUe+KllNeJBNaFNztQfjegr122NNQPPm2CbGQNIiq7NUV8ym+Rrbd+iqJLztc0CJswC4EKNcrTNDBQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=j+qxwntqLqVSZvF+orHcy5CQRtr50wfnz1zdrjN31LD4RrCnHRn6rjJ02mQvGhwb5u2Kr3Bg5DlvntcdS8Y4LAVl4zql8qx+cwKtE+qnTlY32wUhGkCry9J/mk7bVPWN/r71eSSbjDYQOVHSpL9svA6GBOABQbqEuniApkcr7nzTXQPoIdUzuBqxvtNW0FvwxGVq7qtJqHt7c3Gng/FIvc10gQJL8FJriiY7Ilcp2q/j8X3GWBTkgrFrtTTye7TqOqvoBMM3Fhb91ljV/EXQm1MOgIKjWW2HgdQRKIzg7WtYeYfgZvfJZJsozSEOwOAvtNXHOJ7SeUAjGaPE1w+bNQ==
  • 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:07:10 +0000
  • List-id: Mini-os development list <minios-devel.lists.xenproject.org>
  • Thread-index: AQHVXoPHcEWD/zvqqkSDvQ3hl9/gtA==
  • Thread-topic: [UNIKRAFT PATCH v2 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  | 6 +++---
 2 files changed, 4 insertions(+), 3 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..0bc2c391 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) {
+       ukplat_ctor_foreach(uk_ctortab, uk_ctortab_end, i) {
                uk_pr_debug("Call constructor %p\n", *cfn);
-               (*cfn)();
+               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®.