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
This commit is contained in:
Norman Feske
2016-04-15 15:19:22 +02:00
committed by Christian Helmuth
parent e20bbe7002
commit 511acad507
189 changed files with 3314 additions and 2934 deletions

View File

@ -17,6 +17,7 @@
#include <base/printf.h>
#include <dataspace/client.h>
#include <rm_session/connection.h>
#include <region_map/client.h>
#include <util/string.h>
/* local includes */
@ -42,7 +43,8 @@ namespace Bsd {
* Back-end allocator for Genode's slab allocator
*/
class Bsd::Slab_backend_alloc : public Genode::Allocator,
public Genode::Rm_connection
public Genode::Rm_connection,
public Genode::Region_map_client
{
private:
@ -68,7 +70,7 @@ class Bsd::Slab_backend_alloc : public Genode::Allocator,
try {
_ds_cap[_index] = _ram.alloc(BLOCK_SIZE);
Rm_connection::attach_at(_ds_cap[_index], _index * BLOCK_SIZE, BLOCK_SIZE, 0);
Region_map_client::attach_at(_ds_cap[_index], _index * BLOCK_SIZE, BLOCK_SIZE, 0);
} catch (...) { return false; }
/* return base + offset in VM area */
@ -83,7 +85,7 @@ class Bsd::Slab_backend_alloc : public Genode::Allocator,
Slab_backend_alloc(Genode::Ram_session &ram)
:
Rm_connection(0, VM_SIZE),
Region_map_client(Rm_connection::create(VM_SIZE)),
_index(0), _range(Genode::env()->heap()), _ram(ram)
{
/* reserver attach us, anywere */