25 typedef T
const **ptr_type;
30 Ret_array(T *v,
unsigned max) : value(v), max(max) {}
35template<
typename A>
struct Elem<
Ret_array<A> >
37 enum { Is_optional =
false };
38 typedef Ret_array<A> type;
39 typedef typename type::ptr_type arg_type;
40 typedef type svr_type;
41 typedef type svr_arg_type;
53template<
typename A>
struct Class< Ret_array<A> > : Class<A>::type {};
54template<
typename A>
struct Direction< Ret_array<A> > : Dir_out {};
56template<
typename A,
typename CLASS>
57struct Clnt_val_ops<A const *, Dir_out, CLASS> : Clnt_noops<A const *>
59 using Clnt_noops<A
const *>::from_msg;
60 static int from_msg(
char *msg,
unsigned offset,
unsigned limit,
long ret,
61 A
const *&arg, Dir_out, Cls_data)
63 offset = align_to<A>(offset);
64 arg =
reinterpret_cast<A
const *
>(msg + offset);
65 if (
L4_UNLIKELY(!check_size<A>(offset, limit, ret)))
68 return offset + ret *
sizeof(A);
72template<
typename A,
typename CLASS>
73struct Svr_val_ops<Ret_array<A>, Dir_out, CLASS> :
74 Svr_noops<Ret_array<A> >
76 typedef Ret_array<A> ret_array;
77 using Svr_noops<ret_array>::from_svr;
78 static int from_svr(
char *,
unsigned offset,
unsigned limit,
long ret,
79 ret_array
const &, Dir_out, CLASS)
81 offset = align_to<A>(offset);
82 if (
L4_UNLIKELY(!check_size<A>(offset, limit, ret)))
84 offset +=
sizeof(A) * ret;
88 using Svr_noops<ret_array>::to_svr;
89 static int to_svr(
char *msg,
unsigned offset,
unsigned limit,
90 ret_array &arg, Dir_out, CLASS)
96 offset = align_to<A>(offset);
97 arg = ret_array(
reinterpret_cast<A*
>(msg + offset),
98 (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.