2018-09-26 11:03:46 +00:00
|
|
|
/*
|
|
|
|
* \brief Client-side VM session interface
|
|
|
|
* \author Stefan Kalkowski
|
|
|
|
* \date 2012-10-02
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Copyright (C) 2012-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.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _INCLUDE__VM_SESSION__CLIENT_H_
|
|
|
|
#define _INCLUDE__VM_SESSION__CLIENT_H_
|
|
|
|
|
|
|
|
/* Genode includes */
|
|
|
|
#include <vm_session/capability.h>
|
2018-09-26 13:53:18 +00:00
|
|
|
#include <vm_session/handler.h>
|
2018-09-26 11:03:46 +00:00
|
|
|
#include <base/rpc_client.h>
|
|
|
|
|
2018-09-26 13:53:18 +00:00
|
|
|
namespace Genode { struct Vm_session_client; class Allocator; class Vm_state; }
|
2018-09-26 11:03:46 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Client-side VM session interface
|
|
|
|
*/
|
|
|
|
struct Genode::Vm_session_client : Rpc_client<Vm_session>
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Constructor
|
|
|
|
*/
|
|
|
|
explicit Vm_session_client(Vm_session_capability session)
|
|
|
|
: Rpc_client<Vm_session>(session) { }
|
|
|
|
|
|
|
|
|
|
|
|
/**************************
|
|
|
|
** Vm_session interface **
|
|
|
|
**************************/
|
|
|
|
|
2018-09-26 13:53:18 +00:00
|
|
|
Dataspace_capability cpu_state(Vcpu_id);
|
2018-09-26 11:03:46 +00:00
|
|
|
|
2018-09-26 13:53:18 +00:00
|
|
|
void run(Vcpu_id);
|
|
|
|
void pause(Vcpu_id);
|
2018-09-26 11:03:46 +00:00
|
|
|
|
2019-02-14 21:39:08 +00:00
|
|
|
void attach(Dataspace_capability ds,addr_t vm_addr) override {
|
2018-09-26 11:03:46 +00:00
|
|
|
call<Rpc_attach>(ds, vm_addr); }
|
|
|
|
|
2019-02-14 21:39:08 +00:00
|
|
|
void detach(addr_t vm_addr, size_t size) override {
|
2018-09-26 11:03:46 +00:00
|
|
|
call<Rpc_detach>(vm_addr, size); }
|
|
|
|
|
2019-02-14 21:39:08 +00:00
|
|
|
void attach_pic(addr_t vm_addr) override {
|
2018-09-26 11:03:46 +00:00
|
|
|
call<Rpc_attach_pic>(vm_addr); }
|
2018-09-26 13:53:18 +00:00
|
|
|
|
|
|
|
Vcpu_id create_vcpu(Allocator &, Env &, Vm_handler_base &);
|
2018-09-26 11:03:46 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* _INCLUDE__VM_SESSION__CLIENT_H_ */
|