Merge branch 'master' of github.com:mmueller41/genode

This commit is contained in:
Michael Mueller
2022-07-11 14:40:24 +02:00
4 changed files with 15 additions and 3 deletions

View File

@@ -37,6 +37,11 @@ struct Hello::Session_client : Genode::Rpc_client<Session>
{
return call<Rpc_add>(a, b);
}
unsigned short id() override
{
return call<Rpc_get_id>();
}
};
#endif /* _INCLUDE__HELLO_SESSION_H__CLIENT_H_ */

View File

@@ -28,7 +28,7 @@ struct Hello::Session : Genode::Session
virtual void say_hello() = 0;
virtual int add(int a, int b) = 0;
virtual unsigned short id() = 0;
/*******************
** RPC interface **
@@ -36,8 +36,9 @@ struct Hello::Session : Genode::Session
GENODE_RPC(Rpc_say_hello, void, say_hello);
GENODE_RPC(Rpc_add, int, add, int, int);
GENODE_RPC(Rpc_get_id, unsigned short, id);
GENODE_RPC_INTERFACE(Rpc_say_hello, Rpc_add);
GENODE_RPC_INTERFACE(Rpc_say_hello, Rpc_add, Rpc_get_id);
};
#endif /* _INCLUDE__HELLO_SESSION__HELLO_SESSION_H_ */

View File

@@ -53,7 +53,9 @@ struct HelloClient {
while (true) {
int const sum = _hello.add(_a, _b);
Genode::log("added ", _a, " + ", _b, " = ", sum);
unsigned short id = _hello.id();
Genode::log(id, ": added ", _a, " + ", _b, " = ", sum);
_timer.msleep(_a*1000);
_b += 2;
}

View File

@@ -37,6 +37,10 @@ struct Hello::Session_component : Genode::Rpc_object<Session>
int add(int a, int b) override {
return a + b; }
unsigned short id() override {
return _id;
}
};