23 namespace L4 {
namespace Ipc L4_EXPORT {
36 typedef T
const **ptr_type;
46 template<
typename A>
struct Elem< Ret_array<A> >
48 enum { Is_optional =
false };
50 typedef typename type::ptr_type arg_type;
51 typedef type svr_type;
52 typedef type svr_arg_type;
64 template<
typename A>
struct Class< Ret_array<A> > : Class<A>::type {};
65 template<
typename A>
struct Direction< Ret_array<A> > : Dir_out {};
67 template<
typename A,
typename CLASS>
68 struct Clnt_val_ops<A const *, Dir_out, CLASS> : Clnt_noops<A const *>
70 using Clnt_noops<A const *>::from_msg;
71 static int from_msg(
char *msg,
unsigned offset,
unsigned limit,
long ret,
72 A
const *&arg, Dir_out, Cls_data)
74 offset = align_to<A>(offset);
75 arg =
reinterpret_cast<A
const *
>(msg + offset);
76 if (
L4_UNLIKELY(!check_size<A>(offset, limit, ret)))
79 return offset + ret *
sizeof(A);
83 template<
typename A,
typename CLASS>
84 struct Svr_val_ops<Ret_array<A>, Dir_out, CLASS> :
85 Svr_noops<Ret_array<A> >
88 using Svr_noops<ret_array>::from_svr;
89 static int from_svr(
char *,
unsigned offset,
unsigned limit,
long ret,
90 ret_array
const &, Dir_out, CLASS)
92 offset = align_to<A>(offset);
93 if (
L4_UNLIKELY(!check_size<A>(offset, limit, ret)))
95 offset +=
sizeof(A) * ret;
99 using Svr_noops<ret_array>::to_svr;
100 static int to_svr(
char *msg,
unsigned offset,
unsigned limit,
101 ret_array &arg, Dir_out, CLASS)
107 offset = align_to<A>(offset);
108 arg = ret_array(reinterpret_cast<A*>(msg + offset),
109 (limit - offset) /
sizeof(A));
L4 low-level kernel interface.
T1 max(T1 a, T1 b)
Get the maximum of a and b.
#define L4_UNLIKELY(x)
Expression is unlikely to execute.
Dynamically sized output array of type T.