genode/repos/base-hw/src/core/spec/arndale/platform_services.cc
Stefan Kalkowski 4e97a6511b hw: switch page-tables only when necessary
* Instead of always re-load page-tables when a thread context is switched
  only do this when another user PD's thread is the next target,
  core-threads are always executed within the last PD's page-table set
* remove the concept of the mode transition
* instead map the exception vector once in bootstrap code into kernel's
  memory segment
* when a new page directory is constructed for a user PD, copy over the
  top-level kernel segment entries on RISCV and X86, on ARM we use a designated
  page directory register for the kernel segment
* transfer the current CPU id from bootstrap to core/kernel in a register
  to ease first stack address calculation
* align cpu context member of threads and vms, because of x86 constraints
  regarding the stack-pointer loading
* introduce Align_at template for members with alignment constraints
* let the x86 hardware do part of the context saving in ISS, by passing
  the thread context into the TSS before leaving to user-land
* use one exception vector for all ARM platforms including Arm_v6

Fix #2091
2017-10-19 13:31:18 +02:00

44 lines
1.1 KiB
C++

/*
* \brief Platform specific services for Arndale
* \author Stefan Kalkowski
* \date 2014-07-08
*/
/*
* Copyright (C) 2014-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.
*/
/* Genode includes */
#include <base/service.h>
#include <base/heap.h>
/* core includes */
#include <platform.h>
#include <platform_services.h>
#include <core_service.h>
#include <map_local.h>
#include <vm_root.h>
#include <platform.h>
extern Genode::addr_t hypervisor_exception_vector;
/*
* Add ARM virtualization specific vm service
*/
void Genode::platform_add_local_services(Rpc_entrypoint *ep,
Sliced_heap *sh,
Registry<Service> *services)
{
using namespace Genode;
map_local(Platform::core_phys_addr((addr_t)&hypervisor_exception_vector),
Hw::Mm::hypervisor_exception_vector().base, 1,
Hw::PAGE_FLAGS_KERN_TEXT);
static Vm_root vm_root(ep, sh);
static Core_service<Vm_session_component> vm_service(*services, vm_root);
}