36 typedef T
const **ptr_type;
41 Ret_array(T *v,
unsigned max) : value(v), max(max) {}
46template<
typename A>
struct Elem<
Ret_array<A> >
48 enum { Is_optional =
false };
49 typedef Ret_array<A> type;
50 typedef typename type::ptr_type arg_type;
51 typedef type svr_type;
52 typedef type svr_arg_type;
64template<
typename A>
struct Class< Ret_array<A> > : Class<A>::type {};
65template<
typename A>
struct Direction< Ret_array<A> > : Dir_out {};
67template<
typename A,
typename CLASS>
68struct 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);
83template<
typename A,
typename CLASS>
84struct Svr_val_ops<Ret_array<A>, Dir_out, CLASS> :
85 Svr_noops<Ret_array<A> >
87 typedef Ret_array<A> ret_array;
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));
#define L4_UNLIKELY(x)
Expression is unlikely to execute.
#define L4_EXPORT
Attribute to mark functions, variables, and data types as being exported from a library.
L4 low-level kernel interface.
Dynamically sized output array of type T.