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

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


  • To: minios-devel@xxxxxxxxxxxxx
  • From: Costin Lupu <costin.lupu@xxxxxxxxx>
  • Date: Wed, 4 Apr 2018 16:54:08 +0300
  • Cc: simon.kuenzer@xxxxxxxxx
  • Delivery-date: Wed, 04 Apr 2018 13:54:24 +0000
  • Ironport-phdr: 9a23:a2a39xCmIHLT6WvfUvtyUyQJP3N1i/DPJgcQr6AfoPdwSPT7ocbcNUDSrc9gkEXOFd2Cra4c0KyO6+jJYi8p2d65qncMcZhBBVcuqP49uEgeOvODElDxN/XwbiY3T4xoXV5h+GynYwAOQJ6tL1LdrWev4jEMBx7xKRR6JvjvGo7Vks+7y/2+94fcbglUijexe69+IAmrpgjNq8cahpdvJLwswRXTuHtIfOpWxWJsJV2Nmhv3+9m98p1+/SlOovwt78FPX7n0cKQ+VrxYES8pM3sp683xtBnMVhWA630BWWgLiBVIAgzF7BbnXpfttybxq+Rw1DWGMcDwULs5Xymp4aV2Rx/ykCoJNyA3/nzZhMJzi6xUohyhqgdjz4LIeoyZKOBzcr/Bcd4cWGFPXtxRVytEAo6kcYYPCPEBPfpZr4n7ulAAqwa+BRGxBOjyzTJHmnj23bYm0+QgFwHKxgggH88WsHTJt9j6KLwSXfqtzKnV1jrPdelW2TDk5YXObxsvoumMUKptfcfe1EUjDQDIg1WKpYD7IT+Y1P4BvmaD4+Z9Wu+jlnQrpgJxrzS12MshhIfEipgIxl3L6yl0xps+K8eiR05he9GkFYNdtySdN4RrXMwvW3pouCMmyr0evp67YTQKxIwnxxHBb/yHdJCF4gzmVOmLIDd4gGhpd66khxqo6Uig1/bzWtOu0FZNtiZFk9/MuW4R1xHL98SKReZx8l2i1DuPzQzf9P9ILEIumafVM5Ihx6Q/lpsXsUTNBC/2n0D2gbeKeUUj4eio9+XnYrP8qp+YKo90khz+P78ylcykG+g4KhUOUHOB9eSm073v5Vf5T6lSjv0qjqnZt4jXJcEapq6/Ag9V1Z0j5w+iADi4ztQXg30HIUlBeBKGlIjpJ0rOLOr3DPihhVSgijBrx+rJPrf5GJXCMmDDkKv9fbZ680Nc0wszzdVY55JSEL0BI+/zVVH3tN3ZEBA5KRe5w+D5B9ph0oMRQ3mADrWHP6PP4he04bcqIu+NY5RQtDvjJvwN4//1kWR/iVIbO66z0sg5cne9S99hOFmYZzLIn88cWTMBuREiTeqsjECaTBZYfDCqQqh6/DZtW9HuNpvKWo342O/J5yy8BJADPm0=
  • List-id: Mini-os development list <minios-devel.lists.xenproject.org>

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
 }
-- 
2.1.4


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