genode/repos/base/include/rm_session/rm_session.h
Norman Feske 511acad507 Consolidate RM service into PD session
This patch integrates three region maps into each PD session to
reduce the session overhead and to simplify the PD creation procedure.
Please refer to the issue cited below for an elaborative discussion.

Note the API change:

With this patch, the semantics of core's RM service have changed. Now,
the service is merely a tool for creating and destroying managed
dataspaces, which are rarely needed. Regular components no longer need a
RM session. For this reason, the corresponding argument for the
'Process' and 'Child' constructors has been removed.

The former interface of the 'Rm_session' is not named 'Region_map'. As a
minor refinement, the 'Fault_type' enum values are now part of the
'Region_map::State' struct.

Issue #1938
2016-05-09 13:10:51 +02:00

64 lines
1.5 KiB
C++

/*
* \brief Region-map session interface
* \author Norman Feske
* \date 2016-04-15
*/
/*
* Copyright (C) 2016 Genode Labs GmbH
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU General Public License version 2.
*/
#ifndef _INCLUDE__RM_SESSION__RM_SESSION_H_
#define _INCLUDE__RM_SESSION__RM_SESSION_H_
#include <region_map/region_map.h>
#include <session/session.h>
namespace Genode { struct Rm_session; }
struct Genode::Rm_session : Session
{
static const char *service_name() { return "RM"; }
/**
* Exception types
*
* \deprecated The following type definitions will be removed after the
* transition to the 'Region_map' API is completed.
*/
typedef Region_map::Attach_failed Attach_failed;
typedef Region_map::Out_of_metadata Out_of_metadata;
typedef Region_map::Region_conflict Region_conflict;
/**
* Create region map
*
* \param size upper bound of region map
* \return region-map capability
* \throw Out_of_metadata
*/
virtual Capability<Region_map> create(size_t size) = 0;
/**
* Destroy region map
*/
virtual void destroy(Capability<Region_map>) = 0;
/*********************
** RPC declaration **
*********************/
GENODE_RPC_THROW(Rpc_create, Capability<Region_map>, create,
GENODE_TYPE_LIST(Out_of_metadata), size_t);
GENODE_RPC(Rpc_destroy, void, destroy, Capability<Region_map>);
GENODE_RPC_INTERFACE(Rpc_create, Rpc_destroy);
};
#endif /* _INCLUDE__RM_SESSION__RM_SESSION_H_ */