2012-10-02 09:01:15 +00:00
|
|
|
/*
|
2012-10-23 15:12:09 +00:00
|
|
|
* \brief Client-side VM session interface
|
2012-10-02 09:01:15 +00:00
|
|
|
* \author Stefan Kalkowski
|
|
|
|
* \date 2012-10-02
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
2017-02-20 12:23:52 +00:00
|
|
|
* Copyright (C) 2012-2017 Genode Labs GmbH
|
2012-10-02 09:01:15 +00:00
|
|
|
*
|
|
|
|
* This file is part of the Genode OS framework, which is distributed
|
2017-02-20 12:23:52 +00:00
|
|
|
* under the terms of the GNU Affero General Public License version 3.
|
2012-10-02 09:01:15 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _INCLUDE__VM_SESSION__CLIENT_H_
|
|
|
|
#define _INCLUDE__VM_SESSION__CLIENT_H_
|
|
|
|
|
2012-10-23 15:12:09 +00:00
|
|
|
/* Genode includes */
|
2012-10-02 09:01:15 +00:00
|
|
|
#include <vm_session/capability.h>
|
|
|
|
#include <base/rpc_client.h>
|
|
|
|
|
2012-10-23 15:12:09 +00:00
|
|
|
namespace Genode
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Client-side VM session interface
|
|
|
|
*/
|
2012-10-02 09:01:15 +00:00
|
|
|
struct Vm_session_client : Rpc_client<Vm_session>
|
|
|
|
{
|
2012-10-23 15:12:09 +00:00
|
|
|
/**
|
|
|
|
* Constructor
|
|
|
|
*/
|
2012-10-02 09:01:15 +00:00
|
|
|
explicit Vm_session_client(Vm_session_capability session)
|
|
|
|
: Rpc_client<Vm_session>(session) { }
|
|
|
|
|
2015-02-19 13:50:27 +00:00
|
|
|
|
2012-10-23 15:12:09 +00:00
|
|
|
/**************************
|
|
|
|
** Vm_session interface **
|
|
|
|
**************************/
|
|
|
|
|
2012-10-02 09:01:15 +00:00
|
|
|
Dataspace_capability cpu_state() {
|
|
|
|
return call<Rpc_cpu_state>(); }
|
|
|
|
|
|
|
|
void exception_handler(Signal_context_capability handler) {
|
|
|
|
call<Rpc_exception_handler>(handler); }
|
|
|
|
|
2013-05-08 13:22:28 +00:00
|
|
|
void run() { call<Rpc_run>(); }
|
|
|
|
void pause() { call<Rpc_pause>(); }
|
2015-02-19 13:50:27 +00:00
|
|
|
|
|
|
|
void attach(Dataspace_capability ds,addr_t vm_addr) {
|
|
|
|
call<Rpc_attach>(ds, vm_addr); }
|
|
|
|
|
|
|
|
void detach(addr_t vm_addr, size_t size) {
|
|
|
|
call<Rpc_detach>(vm_addr, size); }
|
|
|
|
|
|
|
|
void attach_pic(addr_t vm_addr) {
|
|
|
|
call<Rpc_attach_pic>(vm_addr); }
|
2012-10-02 09:01:15 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif /* _INCLUDE__VM_SESSION__CLIENT_H_ */
|