mirror of
https://github.com/genodelabs/genode.git
synced 2025-01-29 15:44:02 +00:00
parent
772616bf38
commit
a6af6c80ab
@ -115,8 +115,8 @@ void Ipc_client::_call()
|
||||
}
|
||||
|
||||
|
||||
Ipc_client::Ipc_client(Native_capability const &srv,
|
||||
Msgbuf_base *snd_msg, Msgbuf_base *rcv_msg)
|
||||
Ipc_client::Ipc_client(Native_capability const &srv, Msgbuf_base *snd_msg,
|
||||
Msgbuf_base *rcv_msg, unsigned short)
|
||||
: Ipc_istream(rcv_msg), Ipc_ostream(srv, snd_msg), _result(0)
|
||||
{ }
|
||||
|
||||
|
@ -152,7 +152,7 @@ void Ipc_client::_call()
|
||||
|
||||
|
||||
Ipc_client::Ipc_client(Native_capability const &srv, Msgbuf_base *snd_msg,
|
||||
Msgbuf_base *rcv_msg):
|
||||
Msgbuf_base *rcv_msg, unsigned short):
|
||||
Ipc_istream(rcv_msg), Ipc_ostream(srv, snd_msg), _result(0)
|
||||
{ }
|
||||
|
||||
|
@ -291,8 +291,8 @@ void Ipc_client::_call()
|
||||
}
|
||||
|
||||
|
||||
Ipc_client::Ipc_client(Native_capability const &srv,
|
||||
Msgbuf_base *snd_msg, Msgbuf_base *rcv_msg)
|
||||
Ipc_client::Ipc_client(Native_capability const &srv, Msgbuf_base *snd_msg,
|
||||
Msgbuf_base *rcv_msg, unsigned short)
|
||||
: Ipc_istream(rcv_msg), Ipc_ostream(srv, snd_msg), _result(0) { }
|
||||
|
||||
|
||||
|
@ -52,8 +52,8 @@ Ipc_istream::~Ipc_istream() { }
|
||||
void Ipc_client::_call() { }
|
||||
|
||||
|
||||
Ipc_client::Ipc_client(Native_capability const &srv,
|
||||
Msgbuf_base *snd_msg, Msgbuf_base *rcv_msg)
|
||||
Ipc_client::Ipc_client(Native_capability const &srv, Msgbuf_base *snd_msg,
|
||||
Msgbuf_base *rcv_msg, unsigned short)
|
||||
: Ipc_istream(rcv_msg), Ipc_ostream(srv, snd_msg), _result(0)
|
||||
{ }
|
||||
|
||||
|
@ -134,8 +134,8 @@ void Ipc_client::_call()
|
||||
}
|
||||
|
||||
|
||||
Ipc_client::Ipc_client(Native_capability const &srv,
|
||||
Msgbuf_base *snd_msg, Msgbuf_base *rcv_msg)
|
||||
Ipc_client::Ipc_client(Native_capability const &srv, Msgbuf_base *snd_msg,
|
||||
Msgbuf_base *rcv_msg, unsigned short)
|
||||
: Ipc_istream(rcv_msg), Ipc_ostream(srv, snd_msg), _result(0) { }
|
||||
|
||||
|
||||
|
@ -546,8 +546,8 @@ void Ipc_client::_call()
|
||||
}
|
||||
|
||||
|
||||
Ipc_client::Ipc_client(Native_capability const &srv,
|
||||
Msgbuf_base *snd_msg, Msgbuf_base *rcv_msg)
|
||||
Ipc_client::Ipc_client(Native_capability const &srv, Msgbuf_base *snd_msg,
|
||||
Msgbuf_base *rcv_msg, unsigned short)
|
||||
: Ipc_istream(rcv_msg), Ipc_ostream(srv, snd_msg), _result(0)
|
||||
{
|
||||
_prepare_next_call();
|
||||
|
@ -183,8 +183,8 @@ void Ipc_client::_call()
|
||||
}
|
||||
|
||||
|
||||
Ipc_client::Ipc_client(Native_capability const &srv,
|
||||
Msgbuf_base *snd_msg, Msgbuf_base *rcv_msg)
|
||||
Ipc_client::Ipc_client(Native_capability const &srv, Msgbuf_base *snd_msg,
|
||||
Msgbuf_base *rcv_msg, unsigned short const rcv_caps)
|
||||
: Ipc_istream(rcv_msg), Ipc_ostream(srv, snd_msg), _result(0)
|
||||
{ }
|
||||
|
||||
|
@ -203,8 +203,8 @@ void Ipc_client::_call()
|
||||
}
|
||||
|
||||
|
||||
Ipc_client::Ipc_client(Native_capability const &srv,
|
||||
Msgbuf_base *snd_msg, Msgbuf_base *rcv_msg)
|
||||
Ipc_client::Ipc_client(Native_capability const &srv, Msgbuf_base *snd_msg,
|
||||
Msgbuf_base *rcv_msg, unsigned short)
|
||||
: Ipc_istream(rcv_msg), Ipc_ostream(srv, snd_msg), _result(0) { }
|
||||
|
||||
|
||||
|
@ -219,7 +219,7 @@ void Ipc_client::_call()
|
||||
|
||||
|
||||
Ipc_client::Ipc_client(Native_capability const &srv, Msgbuf_base *snd_msg,
|
||||
Msgbuf_base *rcv_msg) :
|
||||
Msgbuf_base *rcv_msg, unsigned short) :
|
||||
Ipc_istream(rcv_msg), Ipc_ostream(srv, snd_msg), _result(0)
|
||||
{
|
||||
IPCDEBUG("Ipc_client constructed.\n");
|
||||
|
@ -435,7 +435,7 @@ namespace Genode {
|
||||
* Constructor
|
||||
*/
|
||||
Ipc_client(Native_capability const &srv, Msgbuf_base *snd_msg,
|
||||
Msgbuf_base *rcv_msg);
|
||||
Msgbuf_base *rcv_msg, unsigned short rcv_caps = ~0);
|
||||
|
||||
/**
|
||||
* Operator that issues an IPC call
|
||||
|
@ -38,6 +38,35 @@ namespace Genode {
|
||||
: Capability<RPC_INTERFACE>(cap) { }
|
||||
};
|
||||
|
||||
/**
|
||||
* Count capabilities of a RPC_FUNCTION which are out parameters.
|
||||
*/
|
||||
template <typename T> struct Cap_para_out { enum { Value = 0 }; };
|
||||
template <typename T> struct Cap_para_out<Capability<T> *> { enum { Value = 1 }; };
|
||||
template <typename T> struct Cap_para_out<Capability<T> &> { enum { Value = 1 }; };
|
||||
template <> struct Cap_para_out<Native_capability *> { enum { Value = 1 }; };
|
||||
template <> struct Cap_para_out<Native_capability &> { enum { Value = 1 }; };
|
||||
|
||||
template <typename T> struct Cap_return { enum { Value = 0 }; };
|
||||
template <typename T> struct Cap_return<Capability<T> > { enum { Value = 1 }; };
|
||||
template <typename T> struct Cap_return<Capability<T> *> { enum { Value = 1 }; };
|
||||
template <typename T> struct Cap_return<Capability<T> &> { enum { Value = 1 }; };
|
||||
template <> struct Cap_return<Native_capability> { enum { Value = 1 }; };
|
||||
template <> struct Cap_return<Native_capability *> { enum { Value = 1 }; };
|
||||
template <> struct Cap_return<Native_capability &> { enum { Value = 1 }; };
|
||||
|
||||
template <typename ARGS>
|
||||
struct Rpc_caps_out {
|
||||
enum { Value = Cap_para_out<typename ARGS::Head>::Value
|
||||
+ Rpc_caps_out<typename ARGS::Tail>::Value }; };
|
||||
|
||||
template <>
|
||||
struct Rpc_caps_out<Meta::Empty> { enum { Value = 0 }; };
|
||||
|
||||
template <typename RPC_FUNCTION>
|
||||
struct Rpc_function_caps_out {
|
||||
enum { Value = Rpc_caps_out<typename RPC_FUNCTION::Server_args>::Value +
|
||||
Cap_return <typename RPC_FUNCTION::Ret_type>::Value}; };
|
||||
|
||||
/*********************************************************
|
||||
** Implementation of 'Capability:call' functions **
|
||||
@ -106,12 +135,13 @@ namespace Genode {
|
||||
*/
|
||||
enum { PROTOCOL_OVERHEAD = 4*sizeof(long),
|
||||
CALL_MSG_SIZE = Rpc_function_msg_size<IF, RPC_CALL>::Value,
|
||||
REPLY_MSG_SIZE = Rpc_function_msg_size<IF, RPC_REPLY>::Value };
|
||||
REPLY_MSG_SIZE = Rpc_function_msg_size<IF, RPC_REPLY>::Value,
|
||||
CAP_BY_VALUE = Rpc_function_caps_out<IF>::Value };
|
||||
|
||||
Msgbuf<CALL_MSG_SIZE + PROTOCOL_OVERHEAD> call_buf;
|
||||
Msgbuf<REPLY_MSG_SIZE + PROTOCOL_OVERHEAD> reply_buf;
|
||||
|
||||
Ipc_client ipc_client(*this, &call_buf, &reply_buf);
|
||||
Ipc_client ipc_client(*this, &call_buf, &reply_buf, CAP_BY_VALUE);
|
||||
|
||||
/* determine opcode of RPC function */
|
||||
typedef typename RPC_INTERFACE::Rpc_functions Rpc_functions;
|
||||
|
Loading…
x
Reference in New Issue
Block a user