2015-02-19 14:50:27 +01:00
|
|
|
/*
|
|
|
|
* \brief Core-specific instance of the VM session interface
|
|
|
|
* \author Stefan Kalkowski
|
|
|
|
* \date 2012-10-08
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
2017-02-20 13:23:52 +01:00
|
|
|
* Copyright (C) 2012-2017 Genode Labs GmbH
|
2015-02-19 14:50:27 +01:00
|
|
|
*
|
|
|
|
* This file is part of the Genode OS framework, which is distributed
|
2017-02-20 13:23:52 +01:00
|
|
|
* under the terms of the GNU Affero General Public License version 3.
|
2015-02-19 14:50:27 +01:00
|
|
|
*/
|
|
|
|
|
2017-04-12 10:06:29 +02:00
|
|
|
#ifndef _CORE__SPEC__ARM_V7__TRUSTZONE__VM_SESSION_COMPONENT_H_
|
|
|
|
#define _CORE__SPEC__ARM_V7__TRUSTZONE__VM_SESSION_COMPONENT_H_
|
2015-02-19 14:50:27 +01:00
|
|
|
|
|
|
|
/* Genode includes */
|
|
|
|
#include <base/allocator.h>
|
|
|
|
#include <base/rpc_server.h>
|
|
|
|
#include <vm_session/vm_session.h>
|
|
|
|
#include <dataspace/capability.h>
|
|
|
|
|
|
|
|
/* Core includes */
|
|
|
|
#include <dataspace_component.h>
|
2015-05-19 14:18:40 +02:00
|
|
|
#include <object.h>
|
2015-02-19 14:50:27 +01:00
|
|
|
#include <kernel/vm.h>
|
|
|
|
|
|
|
|
namespace Genode {
|
|
|
|
class Vm_session_component;
|
|
|
|
}
|
|
|
|
|
2015-05-19 14:18:40 +02:00
|
|
|
class Genode::Vm_session_component
|
|
|
|
: public Genode::Rpc_object<Genode::Vm_session>,
|
|
|
|
public Kernel_object<Kernel::Vm>
|
2015-02-19 14:50:27 +01:00
|
|
|
{
|
|
|
|
private:
|
|
|
|
|
|
|
|
Rpc_entrypoint *_ds_ep;
|
|
|
|
Range_allocator *_ram_alloc;
|
|
|
|
Dataspace_component _ds;
|
|
|
|
Dataspace_capability _ds_cap;
|
|
|
|
addr_t _ds_addr;
|
|
|
|
|
|
|
|
static size_t _ds_size() {
|
|
|
|
return align_addr(sizeof(Cpu_state_modes),
|
|
|
|
get_page_size_log2()); }
|
|
|
|
|
|
|
|
addr_t _alloc_ds(size_t &ram_quota);
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
Vm_session_component(Rpc_entrypoint *ds_ep,
|
|
|
|
size_t ram_quota);
|
|
|
|
~Vm_session_component();
|
|
|
|
|
|
|
|
|
|
|
|
/**************************
|
|
|
|
** Vm session interface **
|
|
|
|
**************************/
|
|
|
|
|
|
|
|
Dataspace_capability cpu_state(void) { return _ds_cap; }
|
|
|
|
void exception_handler(Signal_context_capability handler);
|
|
|
|
void run(void);
|
|
|
|
void pause(void);
|
|
|
|
|
|
|
|
void attach(Dataspace_capability ds_cap, addr_t vm_addr) {
|
2016-10-10 16:22:43 +02:00
|
|
|
warning("Not implemented for TrustZone case"); }
|
2015-02-19 14:50:27 +01:00
|
|
|
|
|
|
|
void attach_pic(addr_t vm_addr) {
|
2016-10-10 16:22:43 +02:00
|
|
|
warning("Not implemented for TrustZone case"); }
|
2015-02-19 14:50:27 +01:00
|
|
|
|
|
|
|
void detach(addr_t vm_addr, size_t size) {
|
2016-10-10 16:22:43 +02:00
|
|
|
warning("Not implemented for TrustZone case"); }
|
2015-02-19 14:50:27 +01:00
|
|
|
};
|
|
|
|
|
2017-04-12 10:06:29 +02:00
|
|
|
#endif /* _CORE__SPEC__ARM_V7__TRUSTZONE__VM_SESSION_COMPONENT_H_ */
|