kernel: Move _kernel from sched to init

_kernel struct can be used when multithreading is disabled.
In that case sched.c may not be compiled.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
This commit is contained in:
Krzysztof Chruscinski 2021-04-16 15:16:00 +02:00 committed by Carles Cufí
commit 7dcff6ecfe
2 changed files with 3 additions and 3 deletions

View file

@ -43,6 +43,9 @@ uint32_t __noinit z_timestamp_main; /* timestamp when main task starts */
uint32_t __noinit z_timestamp_idle; /* timestamp when CPU goes idle */
#endif
/* the only struct z_kernel instance */
struct z_kernel _kernel;
/* init/main and idle threads */
K_THREAD_STACK_DEFINE(z_main_stack, CONFIG_MAIN_STACK_SIZE);
struct k_thread z_main_thread;

View file

@ -46,9 +46,6 @@ LOG_MODULE_DECLARE(os, CONFIG_KERNEL_LOG_LEVEL);
#define _priq_wait_best z_priq_dumb_best
#endif
/* the only struct z_kernel instance */
struct z_kernel _kernel;
struct k_spinlock sched_spinlock;
static void update_cache(int);