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

Re: [Minios-devel] [UNIKRAFT PATCH 17/17] lib/ukboot: Updates for inlining with platform and scheduling changes



Reviewed-by: Simon Kuenzer <simon.kuenzer@xxxxxxxxx>

On 04.04.2018 15:54, Costin Lupu wrote:
Changes:
* init the IRQ subsystem
* init the timer after memory allocator initialization
* enable the interrupts just before starting the application when scheduling is 
not enabled
* using uk_sched_default_init for scheduler init
* using uk_sched_start which also starts the idle thread and enables the 
interrupts

Signed-off-by: Costin Lupu <costin.lupu@xxxxxxxxx>
---
  lib/ukboot/boot.c | 21 +++++++++++++++------
  1 file changed, 15 insertions(+), 6 deletions(-)

diff --git a/lib/ukboot/boot.c b/lib/ukboot/boot.c
index acbae6e..758ee50 100644
--- a/lib/ukboot/boot.c
+++ b/lib/ukboot/boot.c
@@ -43,12 +43,14 @@
  #if LIBUKALLOC && LIBUKALLOCBBUDDY && LIBUKBOOT_INITALLOC
  #include <uk/allocbbuddy.h>
  #endif
-#if LIBUKSCHED && LIBUKSCHEDCOOP
-#include <uk/schedcoop.h>
+#if LIBUKSCHED
+#include <uk/sched.h>
  #endif
  #include <uk/arch/lcpu.h>
  #include <uk/plat/bootstrap.h>
  #include <uk/plat/memory.h>
+#include <uk/plat/lcpu.h>
+#include <uk/plat/irq.h>
  #include <uk/plat/time.h>
  #include <uk/essentials.h>
  #include <uk/print.h>
@@ -109,6 +111,7 @@ void ukplat_entry(int argc, char *argv[])
        struct thread_main_arg tma;
  #if LIBUKALLOC || LIBUKSCHED
        struct uk_alloc *a = NULL;
+       int rc;
  #endif
  #if LIBUKALLOC && LIBUKALLOCBBUDDY && LIBUKBOOT_INITALLOC
        struct ukplat_memregion_desc md;
@@ -127,7 +130,6 @@ void ukplat_entry(int argc, char *argv[])
                  STRINGIFY(UK_CODENAME) " " STRINGIFY(UK_FULLVERSION));
  #endif
- ukplat_time_init(); #if LIBUKALLOC && LIBUKALLOCBBUDDY && LIBUKBOOT_INITALLOC
        /* initialize memory allocator
@@ -180,11 +182,17 @@ void ukplat_entry(int argc, char *argv[])
        }
        if (unlikely(!a))
                uk_printd(DLVL_WARN, "No suitable memory region for memory 
allocator. Continue without heap\n");
+
+       rc = ukplat_irq_init(a);
+       if (unlikely(rc != 0))
+               UK_CRASH("Could not initialize the platform IRQ subsystem.");
  #endif
+ ukplat_time_init();
+
  #if HAVE_SCHED
        /* Init scheduler. */
-       s = uk_schedcoop_init(a);
+       s = uk_sched_default_init(a);
        if (unlikely(!s))
                UK_CRASH("Could not initialize the scheduler.");
  #endif
@@ -196,9 +204,10 @@ void ukplat_entry(int argc, char *argv[])
        main_thread = uk_thread_create("main", main_thread_func, &tma);
        if (unlikely(!main_thread))
                UK_CRASH("Could not create main thread.");
-       uk_thread_start(main_thread);
-       uk_sched_run(s);
+       uk_sched_start(s);
  #else
+       /* Enable interrupts before starting the application */
+       ukplat_lcpu_enable_irq();
        main_thread_func(&tma);
  #endif
  }


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