base: remove Genode::parent_cap from the API

Components interact with their environments using the Genode::Env class
instead of directly using the parent capability.
This commit is contained in:
Norman Feske 2015-03-24 13:20:28 +01:00 committed by Christian Helmuth
parent 695ac957f4
commit 0d74435448
2 changed files with 21 additions and 16 deletions

View File

@ -32,18 +32,20 @@ namespace Genode {
struct Env; struct Env;
extern Env *env();
/** /**
* Return parent capability * Return the interface to the component's environment
*
* Platforms have to implement this function for environment
* initialization.
*/ */
Parent_capability parent_cap(); extern Env *env();
} }
/**
* Component runtime environment
*
* The environment of a Genode component is defined by its parent. The 'Env'
* class allows the component to interact with its environment. It is
* initialized at the startup of the component.
*/
struct Genode::Env struct Genode::Env
{ {
virtual ~Env() { } virtual ~Env() { }
@ -54,35 +56,35 @@ struct Genode::Env
virtual Parent *parent() = 0; virtual Parent *parent() = 0;
/** /**
* RAM session for the program * RAM session of the component
* *
* The RAM Session represents a quota of memory that is * The RAM Session represents a budget of memory (quota) that is
* available to the program. Quota can be used to allocate * available to the component. This budget can be used to allocate
* RAM-Dataspaces. * RAM dataspaces.
*/ */
virtual Ram_session *ram_session() = 0; virtual Ram_session *ram_session() = 0;
virtual Ram_session_capability ram_session_cap() = 0; virtual Ram_session_capability ram_session_cap() = 0;
/** /**
* CPU session for the program * CPU session of the component
* *
* This session is used to create threads. * This session is used to create the threads of the component.
*/ */
virtual Cpu_session *cpu_session() = 0; virtual Cpu_session *cpu_session() = 0;
virtual Cpu_session_capability cpu_session_cap() = 0; virtual Cpu_session_capability cpu_session_cap() = 0;
/** /**
* Region manager session of the program * Region-manager session of the component as created by the parent
*/ */
virtual Rm_session *rm_session() = 0; virtual Rm_session *rm_session() = 0;
/** /**
* Pd session of the program * PD session of the component as created by the parent
*/ */
virtual Pd_session *pd_session() = 0; virtual Pd_session *pd_session() = 0;
/** /**
* Heap backed by the ram_session of the environment. * Heap backed by the RAM session of the environment
*/ */
virtual Allocator *heap() = 0; virtual Allocator *heap() = 0;
}; };

View File

@ -25,10 +25,13 @@
#include <pd_session/client.h> #include <pd_session/client.h>
namespace Genode { namespace Genode {
class Expanding_rm_session_client; class Expanding_rm_session_client;
class Expanding_ram_session_client; class Expanding_ram_session_client;
class Expanding_cpu_session_client; class Expanding_cpu_session_client;
class Expanding_parent_client; class Expanding_parent_client;
Parent_capability parent_cap();
} }