2015-02-06 17:29:30 +01:00
|
|
|
/*
|
2015-03-13 09:20:28 +01:00
|
|
|
* \brief Class for kernel data that is needed to manage a specific CPU
|
|
|
|
* \author Reto Buerki
|
2016-01-11 11:02:52 +01:00
|
|
|
* \author Stefan Kalkowski
|
2015-03-13 09:20:28 +01:00
|
|
|
* \date 2015-02-09
|
2015-02-06 17:29:30 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
2016-01-11 11:02:52 +01:00
|
|
|
* Copyright (C) 2015-2016 Genode Labs GmbH
|
2015-02-06 17:29:30 +01:00
|
|
|
*
|
|
|
|
* This file is part of the Genode OS framework, which is distributed
|
|
|
|
* under the terms of the GNU General Public License version 2.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* core includes */
|
|
|
|
#include <kernel/cpu.h>
|
2015-03-02 14:36:06 +01:00
|
|
|
#include <kernel/kernel.h>
|
2015-05-19 14:18:40 +02:00
|
|
|
#include <kernel/pd.h>
|
2015-02-06 17:29:30 +01:00
|
|
|
|
|
|
|
using namespace Kernel;
|
|
|
|
|
|
|
|
|
2015-06-29 13:30:35 +02:00
|
|
|
Cpu_idle::Cpu_idle(Cpu * const cpu) : Cpu_job(Cpu_priority::MIN, 0)
|
2015-03-02 14:36:06 +01:00
|
|
|
{
|
|
|
|
Cpu_job::cpu(cpu);
|
|
|
|
ip = (addr_t)&_main;
|
|
|
|
sp = (addr_t)&_stack[stack_size];
|
2015-03-27 13:55:03 +01:00
|
|
|
init((addr_t)core_pd()->translation_table(), true);
|
2015-03-02 14:36:06 +01:00
|
|
|
}
|
2015-02-06 17:29:30 +01:00
|
|
|
|
|
|
|
|
2016-01-11 11:02:52 +01:00
|
|
|
void Kernel::Cpu::init(Pic &pic, Kernel::Pd &core_pd, Genode::Board&)
|
2015-12-09 12:02:00 +01:00
|
|
|
{
|
|
|
|
Timer::disable_pit();
|
|
|
|
|
2016-01-19 13:33:04 +01:00
|
|
|
fpu().init();
|
2015-12-09 12:02:00 +01:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Please do not remove the PINF(), because the serial constructor requires
|
|
|
|
* access to the Bios Data Area, which is available in the initial
|
|
|
|
* translation table set, but not in the final tables used after
|
|
|
|
* Cr3::write().
|
|
|
|
*/
|
|
|
|
PINF("Switch to core's final translation table");
|
|
|
|
|
|
|
|
Cr3::write(Cr3::init((addr_t)core_pd.translation_table()));
|
|
|
|
|
|
|
|
/* enable timer interrupt */
|
|
|
|
unsigned const cpu = Cpu::executing_id();
|
|
|
|
pic.unmask(Timer::interrupt_id(cpu), cpu);
|
|
|
|
}
|
2016-01-11 11:02:52 +01:00
|
|
|
|
|
|
|
|
|
|
|
void Cpu_domain_update::_domain_update() { }
|