mirror of
https://github.com/mmueller41/genode.git
synced 2026-01-21 12:32:56 +01:00
Merge branch 'master' of github.com:mmueller41/genode
This commit is contained in:
@@ -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_ */
|
||||
|
||||
@@ -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_ */
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user