|
[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
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
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |