hello_tutorial: Made hello session stateful.

This commit is contained in:
Michael Müller
2022-07-11 14:26:28 +02:00
parent 481a26d286
commit f98359cbe6
4 changed files with 26 additions and 15 deletions

View File

@@ -22,14 +22,15 @@ namespace Hello { struct Connection; }
struct Hello::Connection : Genode::Connection<Session>, Session_client
{
Connection(Genode::Env &env)
:
/* create session */
Genode::Connection<Hello::Session>(env, session(env.parent(),
"ram_quota=6K, cap_quota=4")),
Connection(Genode::Env &env, unsigned short id)
: /* create session */
Genode::Connection<Hello::Session>(env, session(env.parent(),
"ram_quota=6K, cap_quota=4")),
/* initialize RPC interface */
Session_client(cap()) { }
/* initialize RPC interface */
Session_client(cap())
{
}
};
#endif /* _INCLUDE__HELLO_SESSION__CONNECTION_H_ */

View File

@@ -24,6 +24,8 @@ struct Hello::Session : Genode::Session
{
static const char *service_name() { return "Hello"; }
unsigned short _id;
enum { CAP_QUOTA = 2 };
virtual void say_hello() = 0;