2016-01-11 11:02:52 +01:00
|
|
|
/*
|
|
|
|
* \brief Cpu class implementation specific to Cortex A9 SMP
|
|
|
|
* \author Stefan Kalkowski
|
|
|
|
* \date 2015-12-09
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Copyright (C) 2015-2016 Genode Labs GmbH
|
|
|
|
*
|
|
|
|
* 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 */
|
2016-11-07 18:00:24 +01:00
|
|
|
#include <kernel/perf_counter.h>
|
2016-01-11 11:02:52 +01:00
|
|
|
#include <kernel/lock.h>
|
|
|
|
#include <kernel/pd.h>
|
|
|
|
#include <pic.h>
|
2016-11-07 18:00:24 +01:00
|
|
|
#include <platform_pd.h>
|
2016-01-11 11:02:52 +01:00
|
|
|
|
2016-11-07 18:00:24 +01:00
|
|
|
extern int _mt_begin;
|
|
|
|
extern int _mt_master_context_begin;
|
2016-01-11 11:02:52 +01:00
|
|
|
|
|
|
|
|
2016-11-07 18:00:24 +01:00
|
|
|
void Kernel::Cpu::init(Kernel::Pic &pic)
|
2016-01-11 11:02:52 +01:00
|
|
|
{
|
|
|
|
pic.init_cpu_local();
|
|
|
|
|
2016-11-07 18:00:24 +01:00
|
|
|
static Hw::Address_space invalid_space(nullptr);
|
|
|
|
Cpu_context * c = (Cpu_context*) (Cpu::exception_entry + ((addr_t)&_mt_master_context_begin - (addr_t)&_mt_begin));
|
|
|
|
c->cpu_exception = Genode::Cpu::Ttbr0::init((addr_t)invalid_space.translation_table_phys());
|
2016-01-19 13:33:04 +01:00
|
|
|
_fpu.init();
|
2016-01-11 11:02:52 +01:00
|
|
|
|
|
|
|
{
|
|
|
|
Lock::Guard guard(data_lock());
|
|
|
|
|
|
|
|
/* enable performance counter */
|
|
|
|
perf_counter()->enable();
|
|
|
|
|
|
|
|
/* enable timer interrupt */
|
|
|
|
pic.unmask(Timer::interrupt_id(id()), id());
|
|
|
|
}
|
|
|
|
}
|