2011-12-22 15:19:25 +00:00
|
|
|
/*
|
2016-04-15 13:19:22 +00:00
|
|
|
* \brief Region-map session interface
|
2011-12-22 15:19:25 +00:00
|
|
|
* \author Norman Feske
|
2016-04-15 13:19:22 +00:00
|
|
|
* \date 2016-04-15
|
2011-12-22 15:19:25 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
2016-04-15 13:19:22 +00:00
|
|
|
* Copyright (C) 2016 Genode Labs GmbH
|
2011-12-22 15:19:25 +00:00
|
|
|
*
|
|
|
|
* 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_
|
|
|
|
|
2016-04-15 13:19:22 +00:00
|
|
|
#include <region_map/region_map.h>
|
2011-12-22 15:19:25 +00:00
|
|
|
#include <session/session.h>
|
|
|
|
|
2015-03-04 20:12:14 +00:00
|
|
|
namespace Genode { struct Rm_session; }
|
|
|
|
|
|
|
|
|
|
|
|
struct Genode::Rm_session : Session
|
|
|
|
{
|
|
|
|
static const char *service_name() { return "RM"; }
|
|
|
|
|
|
|
|
/**
|
2016-04-15 13:19:22 +00:00
|
|
|
* Exception types
|
2015-03-04 20:12:14 +00:00
|
|
|
*
|
2016-04-15 13:19:22 +00:00
|
|
|
* \deprecated The following type definitions will be removed after the
|
|
|
|
* transition to the 'Region_map' API is completed.
|
2015-03-04 20:12:14 +00:00
|
|
|
*/
|
2016-04-15 13:19:22 +00:00
|
|
|
typedef Region_map::Attach_failed Attach_failed;
|
|
|
|
typedef Region_map::Out_of_metadata Out_of_metadata;
|
|
|
|
typedef Region_map::Region_conflict Region_conflict;
|
2015-03-04 20:12:14 +00:00
|
|
|
|
|
|
|
/**
|
2016-04-15 13:19:22 +00:00
|
|
|
* Create region map
|
2015-03-04 20:12:14 +00:00
|
|
|
*
|
2016-04-15 13:19:22 +00:00
|
|
|
* \param size upper bound of region map
|
|
|
|
* \return region-map capability
|
|
|
|
* \throw Out_of_metadata
|
2015-03-04 20:12:14 +00:00
|
|
|
*/
|
2016-04-15 13:19:22 +00:00
|
|
|
virtual Capability<Region_map> create(size_t size) = 0;
|
2015-03-04 20:12:14 +00:00
|
|
|
|
|
|
|
/**
|
2016-04-15 13:19:22 +00:00
|
|
|
* Destroy region map
|
2015-03-04 20:12:14 +00:00
|
|
|
*/
|
2016-04-15 13:19:22 +00:00
|
|
|
virtual void destroy(Capability<Region_map>) = 0;
|
2015-03-04 20:12:14 +00:00
|
|
|
|
|
|
|
|
|
|
|
/*********************
|
|
|
|
** RPC declaration **
|
|
|
|
*********************/
|
|
|
|
|
2016-04-15 13:19:22 +00:00
|
|
|
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>);
|
2015-03-04 20:12:14 +00:00
|
|
|
|
2016-04-15 13:19:22 +00:00
|
|
|
GENODE_RPC_INTERFACE(Rpc_create, Rpc_destroy);
|
2015-03-04 20:12:14 +00:00
|
|
|
};
|
2011-12-22 15:19:25 +00:00
|
|
|
|
|
|
|
#endif /* _INCLUDE__RM_SESSION__RM_SESSION_H_ */
|