Created
February 7, 2019 08:14
-
-
Save chelmuth/d1bdeecb32a00784aac791d3c30ec2d6 to your computer and use it in GitHub Desktop.
Example patch for more RPC args
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
repos/base/include/util/meta.h | 27 ++++++++++++++++++++-- | |
.../include/hello_session/hello_session.h | 1 + | |
2 files changed, 26 insertions(+), 2 deletions(-) | |
diff --git a/repos/base/include/util/meta.h b/repos/base/include/util/meta.h | |
index 7faee55786..f3fbd453b8 100644 | |
--- a/repos/base/include/util/meta.h | |
+++ b/repos/base/include/util/meta.h | |
@@ -289,6 +289,22 @@ namespace Genode { | |
: Ref_tuple<T1, Ref_tuple_7<T2, T3, T4, T5, T6, T7, T8> >(v1, _t2), _t2(v2, v3, v4, v5, v6, v7, v8) { } | |
}; | |
+ template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9> | |
+ struct Ref_tuple_9 : public Ref_tuple<T1, Ref_tuple_8<T2, T3, T4, T5, T6, T7, T8, T9> > | |
+ { | |
+ Ref_tuple_8<T2, T3, T4, T5, T6, T7, T8, T9> _t2; | |
+ Ref_tuple_9(typename Trait::Reference<T1>::Type v1, | |
+ typename Trait::Reference<T2>::Type v2, | |
+ typename Trait::Reference<T3>::Type v3, | |
+ typename Trait::Reference<T4>::Type v4, | |
+ typename Trait::Reference<T5>::Type v5, | |
+ typename Trait::Reference<T6>::Type v6, | |
+ typename Trait::Reference<T7>::Type v7, | |
+ typename Trait::Reference<T8>::Type v8, | |
+ typename Trait::Reference<T9>::Type v9) | |
+ : Ref_tuple<T1, Ref_tuple_8<T2, T3, T4, T5, T6, T7, T8, T9> >(v1, _t2), _t2(v2, v3, v4, v5, v6, v7, v8, v9) { } | |
+ }; | |
+ | |
/** | |
* Tuple holding raw (plain old) data | |
* | |
@@ -350,7 +366,7 @@ namespace Genode { | |
*/ | |
template <typename T1 = Void, typename T2 = Void, typename T3 = Void, | |
typename T4 = Void, typename T5 = Void, typename T6 = Void, | |
- typename T7 = Void, typename T8 = Void> | |
+ typename T7 = Void, typename T8 = Void, typename T9 = Void> | |
struct Ref_args; | |
template <> | |
@@ -385,6 +401,10 @@ namespace Genode { | |
struct Ref_args<T1, T2, T3, T4, T5, T6, T7, Void> { | |
typedef Ref_tuple_8<T1, T2, T3, T4, T5, T6, T7, Empty> Type; }; | |
+ template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8> | |
+ struct Ref_args<T1, T2, T3, T4, T5, T6, T7, T8, Void> { | |
+ typedef Ref_tuple_9<T1, T2, T3, T4, T5, T6, T7, T8, Empty> Type; }; | |
+ | |
/** | |
* Return recursive type for storing the specified data types | |
@@ -394,7 +414,7 @@ namespace Genode { | |
*/ | |
template <typename T1 = Void, typename T2 = Void, typename T3 = Void, | |
typename T4 = Void, typename T5 = Void, typename T6 = Void, | |
- typename T7 = Void, typename T8 = Void> | |
+ typename T7 = Void, typename T8 = Void, typename T9 = Void> | |
struct Pod_args; | |
template <> | |
@@ -421,6 +441,9 @@ namespace Genode { | |
template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7> | |
struct Pod_args<T1, T2, T3, T4, T5, T6, T7, Void> { typedef Pod_tuple<T1, typename Pod_args<T2, T3, T4, T5, T6, T7, Void>::Type> Type; }; | |
+ template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8> | |
+ struct Pod_args<T1, T2, T3, T4, T5, T6, T7, T8, Void> { typedef Pod_tuple<T1, typename Pod_args<T2, T3, T4, T5, T6, T7, T8, Void>::Type> Type; }; | |
+ | |
/** | |
* Helper for calling member functions via a uniform interface | |
diff --git a/repos/hello_tutorial/include/hello_session/hello_session.h b/repos/hello_tutorial/include/hello_session/hello_session.h | |
index 8ff65e2ea8..cabfcba270 100644 | |
--- a/repos/hello_tutorial/include/hello_session/hello_session.h | |
+++ b/repos/hello_tutorial/include/hello_session/hello_session.h | |
@@ -36,6 +36,7 @@ struct Hello::Session : Genode::Session | |
GENODE_RPC(Rpc_say_hello, void, say_hello); | |
GENODE_RPC(Rpc_add, int, add, int, int); | |
+ GENODE_RPC(Rpc_test, int, test, int, int, int, int, int, int, int, int); | |
GENODE_RPC_INTERFACE(Rpc_say_hello, Rpc_add); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment