/* * \brief Common kernel initialization * \author Martin Stein * \author Stefan Kalkowski * \date 2015-12-20 */ /* * Copyright (C) 2015-2017 Genode Labs GmbH * * This file is part of the Genode OS framework, which is distributed * under the terms of the GNU Affero General Public License version 3. */ /* core includes */ #include #include #include #include #include #include #include /* base includes */ #include using namespace Kernel; static_assert(sizeof(Genode::sizet_arithm_t) >= 2 * sizeof(size_t), "Bad result type for size_t arithmetics."); Pd * Kernel::core_pd() { return &unmanaged_singleton()->kernel_pd(); } Pic * Kernel::pic() { return unmanaged_singleton(); } extern "C" void kernel_init(); /** * Setup kernel environment */ extern "C" void kernel_init() { static volatile bool initialized = false; if (Cpu::executing_id()) while (!initialized) ; else { Genode::log(""); Genode::log("kernel initialized"); } /* initialize cpu pool */ cpu_pool(); /* initialize current cpu */ cpu_pool()->cpu(Cpu::executing_id())->init(*pic()); Core_thread::singleton(); if (!Cpu::executing_id()) initialized = true; kernel(); }