7aff1895bf
This commit enables multi-processing for all Cortex A9 SoCs we currently support. Moreover, it thereby enables the L2 cache for i.MX6 that was not enabled until now. However, the QEMU variants hw_pbxa9 and hw_zynq still only use 1 core, because the busy cpu synchronization used when initializing multiple Cortex A9 cores leads to horrible boot times on QEMU. During this work the CPU initialization in general was reworked. From now on lots of hardware specifics were put into the 'spec' specific files, some generic hook functions and abstractions thereby were eliminated. This results to more lean implementations for instance on non-SMP platforms, or in the x86 case where cache maintainance is a non-issue. Due to the fact that memory/cache coherency and SMP are closely coupled on ARM Cortex A9 this commit combines so different aspects. Fix #1312 Fix #1807
56 lines
1.3 KiB
C++
56 lines
1.3 KiB
C++
/*
|
|
* \brief Kernel backend for protection domains
|
|
* \author Stefan Kalkowski
|
|
* \date 2015-03-20
|
|
*/
|
|
|
|
/*
|
|
* Copyright (C) 2015 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.
|
|
*/
|
|
|
|
/* Genode includes */
|
|
#include <util/bit_allocator.h>
|
|
|
|
/* core includes */
|
|
#include <assert.h>
|
|
#include <kernel/pd.h>
|
|
|
|
using Asid_allocator = Genode::Bit_allocator<256>;
|
|
|
|
static Asid_allocator &alloc() {
|
|
return *unmanaged_singleton<Asid_allocator>(); }
|
|
|
|
|
|
Kernel::Pd::Pd(Kernel::Pd::Table * const table,
|
|
Genode::Platform_pd * const platform_pd)
|
|
: Kernel::Cpu::Pd((Genode::uint8_t)alloc().alloc()),
|
|
_table(table), _platform_pd(platform_pd)
|
|
{
|
|
capid_t invalid = _capid_alloc.alloc();
|
|
assert(invalid == cap_id_invalid());
|
|
}
|
|
|
|
|
|
Kernel::Pd::~Pd() {
|
|
|
|
while (Object_identity_reference *oir = _cap_tree.first())
|
|
oir->~Object_identity_reference();
|
|
|
|
/* clean up buffers of memory management */
|
|
Cpu * const cpu = cpu_pool()->cpu(Cpu::executing_id());
|
|
cpu->clean_invalidate_data_cache();
|
|
cpu->invalidate_instr_cache();
|
|
cpu->invalidate_tlb_by_pid(asid);
|
|
alloc().free(asid);
|
|
}
|
|
|
|
|
|
void Kernel::Pd::admit(Kernel::Cpu::Context * const c)
|
|
{
|
|
c->protection_domain(asid);
|
|
c->translation_table((addr_t)translation_table());
|
|
}
|