]> xenbits.xensource.com Git - unikraft/libs/pthread-embedded.git/commitdiff
Use Unikraft initcall for initialization
authorSimon Kuenzer <simon.kuenzer@neclab.eu>
Wed, 8 Jan 2020 09:14:50 +0000 (10:14 +0100)
committerSimon Kuenzer <simon.kuenzer@neclab.eu>
Wed, 8 Jan 2020 14:17:14 +0000 (15:17 +0100)
Initialize the library by using an Unikraft initcall instead of the
constructor attribute. This is to make sure that pthread-embedded is
initialized before Unikraft calls any application constructors and
after Unikraft initialized the depending scheduler.

Signed-off-by: Simon Kuenzer <simon.kuenzer@neclab.eu>
Reviewed-by: Sharan Santhanam <sharan.santhanam@neclab.eu>
pte_osal.c

index 3ce2a8c3b3fff20c5af96db2f53cdad87d404860..cfd5b3b925590bfde7a7b113bdff779d6dbe367f 100644 (file)
@@ -25,7 +25,7 @@
 
 #include <string.h>
 #include <uk/essentials.h>
-#include <uk/ctors_prio.h>
+#include <uk/init.h>
 #include <uk/arch/time.h>
 #include <uk/arch/atomic.h>
 #include <uk/print.h>
@@ -59,12 +59,12 @@ typedef struct {
  *
  ***************************************************************************/
 
-UK_CTOR_ATTR(UK_CTOR_PRIO_PTHREAD_EMBEDDED)
-int pthread_constructor(void)
+static int pthread_initcall(void)
 {
-       uk_pr_debug("pthread-embedded constructor\n");
+       uk_pr_debug("Initialize pthread-embedded\n");
        return pthread_init();
 }
+uk_lib_initcall(pthread_initcall);
 
 pte_osResult pte_osInit(void)
 {