2016-01-22 15:36:25 +01:00
|
|
|
/*
|
2016-04-15 15:19:22 +02:00
|
|
|
* \brief Pseudo RM session client stub targeting the process-local implementation
|
2016-01-22 15:36:25 +01:00
|
|
|
* \author Norman Feske
|
|
|
|
* \date 2011-11-21
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
2017-02-20 13:23:52 +01:00
|
|
|
* Copyright (C) 2011-2017 Genode Labs GmbH
|
2016-01-22 15:36:25 +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.
|
2016-01-22 15:36:25 +01:00
|
|
|
*/
|
|
|
|
|
2016-01-22 22:18:03 +01:00
|
|
|
/* Genode includes */
|
2016-01-22 15:36:25 +01:00
|
|
|
#include <rm_session/client.h>
|
|
|
|
|
2016-01-22 22:18:03 +01:00
|
|
|
/* base-internal includes */
|
|
|
|
#include <base/internal/local_capability.h>
|
|
|
|
|
2016-01-22 15:36:25 +01:00
|
|
|
using namespace Genode;
|
|
|
|
|
2016-01-22 22:18:03 +01:00
|
|
|
|
2016-01-22 15:36:25 +01:00
|
|
|
/**
|
|
|
|
* Return pointer to locally implemented RM session
|
|
|
|
*
|
|
|
|
* \throw Local_interface::Non_local_capability
|
|
|
|
*/
|
2016-04-15 15:19:22 +02:00
|
|
|
static Rm_session *_local(Capability<Rm_session> cap)
|
2016-01-22 15:36:25 +01:00
|
|
|
{
|
|
|
|
return Local_capability<Rm_session>::deref(cap);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2016-04-15 15:19:22 +02:00
|
|
|
Rm_session_client::Rm_session_client(Capability<Rm_session> session)
|
2016-01-22 15:36:25 +01:00
|
|
|
: Rpc_client<Rm_session>(session) { }
|
|
|
|
|
|
|
|
|
2016-04-15 15:19:22 +02:00
|
|
|
Capability<Region_map> Rm_session_client::create(size_t size) {
|
2019-01-30 17:53:16 +01:00
|
|
|
return _local(rpc_cap())->create(size); }
|
2016-01-22 15:36:25 +01:00
|
|
|
|
|
|
|
|
2016-04-15 15:19:22 +02:00
|
|
|
void Rm_session_client::destroy(Capability<Region_map> cap) {
|
2019-01-30 17:53:16 +01:00
|
|
|
_local(rpc_cap())->destroy(cap); }
|