L4Re - L4 Runtime Environment
ipc_types
Go to the documentation of this file.
1 // vi:set ft=cpp: -*- Mode: C++ -*-
2 /*
3  * (c) 2014 Alexander Warg <alexander.warg@kernkonzept.com>
4  *
5  * This file is part of TUD:OS and distributed under the terms of the
6  * GNU General Public License 2.
7  * Please see the COPYING-GPL-2 file for details.
8  *
9  * As a special exception, you may use this file as part of a free software
10  * library without restriction. Specifically, if other files instantiate
11  * templates or use macros or inline functions from this file, or you compile
12  * this file and link it with other files to produce an executable, this
13  * file does not by itself cause the resulting executable to be covered by
14  * the GNU General Public License. This exception does not however
15  * invalidate any other reasons why the executable file might be covered by
16  * the GNU General Public License.
17  */
18 #pragma once
19 
20 #include "capability.h"
21 #include "types"
22 #include "ipc_basics"
27 namespace L4 {
28 
30 typedef int Opcode;
31 
32 namespace Ipc {
33 
42 template<typename T> struct L4_EXPORT Out;
43 
44 
52 template<typename T> struct L4_EXPORT In_out
53 {
54  T v;
55  In_out() {}
56  In_out(T v) : v(v) {}
57  operator T () const { return v; }
58  operator T & () { return v; }
59 };
60 
61 namespace Msg {
62 template<typename A> struct Elem< In_out<A *> > : Elem<A *> {};
63 
64 template<typename A>
65 struct Svr_xmit< In_out<A *> > : Svr_xmit<A *>, Svr_xmit<A const *>
66 {
67  using Svr_xmit<A *>::from_svr;
68  using Svr_xmit<A const *>::to_svr;
69 };
70 
71 template<typename A>
72 struct Clnt_xmit< In_out<A *> > : Clnt_xmit<A *>, Clnt_xmit<A const *>
73 {
74  using Clnt_xmit<A *>::from_msg;
75  using Clnt_xmit<A const *>::to_msg;
76 };
77 
78 template<typename A>
79 struct Is_valid_rpc_type< In_out<A *> > : Is_valid_rpc_type<A *> {};
80 template<typename A>
81 struct Is_valid_rpc_type< In_out<A const *> > : L4::Types::False {};
82 
83 #ifdef CONFIG_ALLOW_REFS
84 template<typename A> struct Elem< In_out<A &> > : Elem<A &> {};
85 
86 template<typename A>
87 struct Svr_xmit< In_out<A &> > : Svr_xmit<A &>, Svr_xmit<A const &>
88 {
89  using Svr_xmit<A &>::from_svr;
90  using Svr_xmit<A const &>::to_svr;
91 };
92 
93 template<typename A>
94 struct Clnt_xmit< In_out<A &> > : Clnt_xmit<A &>, Clnt_xmit<A const &>
95 {
96  using Clnt_xmit<A &>::from_msg;
97  using Clnt_xmit<A const &>::to_msg;
98 };
99 
100 template<typename A>
101 struct Is_valid_rpc_type< In_out<A &> > : Is_valid_rpc_type<A &> {};
102 template<typename A>
103 struct Is_valid_rpc_type< In_out<A const &> > : L4::Types::False {};
104 
105 #else
106 
107 template<typename A>
108 struct Is_valid_rpc_type< In_out<A &> > : L4::Types::False {};
109 
110 #endif
111 
112 // Value types don't make sense for output.
113 template<typename A>
114 struct Is_valid_rpc_type< In_out<A> > : L4::Types::False {};
115 
116 }
117 
118 
127 template<typename T> struct L4_EXPORT As_value
128 {
129  typedef T value_type;
130  T v;
131  As_value() noexcept {}
132  As_value(T v) noexcept : v(v) {}
133  operator T () const noexcept { return v; }
134  operator T & () noexcept { return v; }
135 };
136 
137 namespace Msg {
138 template<typename T> struct Class< As_value<T> > : Cls_data {};
139 template<typename T> struct Elem< As_value<T> > : Elem<T> {};
140 template<typename T> struct Elem< As_value<T> *> : Elem<T *> {};
141 }
142 
143 
147 template<typename T> struct L4_EXPORT Opt
148 {
149  T _value;
150  bool _valid;
151 
153  Opt() noexcept : _valid(false) {}
154 
156  Opt(T value) noexcept : _value(value), _valid(true) {}
157 
159  Opt &operator = (T value) noexcept
160  {
161  this->_value = value;
162  this->_valid = true;
163  return *this;
164  }
165 
167  void set_valid(bool valid = true) noexcept { _valid = valid; }
168 
170  T *operator -> () noexcept { return &this->_value; }
172  T const *operator -> () const noexcept { return &this->_value; }
174  T value() const noexcept { return this->_value; }
176  T &value() noexcept { return this->_value; }
178  bool is_valid() const noexcept { return this->_valid; }
179 };
180 
181 namespace Msg {
182 template<typename T> struct Elem< Opt<T &> > : Elem<T &>
183 {
184  enum { Is_optional = true };
185  typedef Opt<typename Elem<T &>::svr_type> &svr_arg_type;
186  typedef Opt<typename Elem<T &>::svr_type> svr_type;
187 };
188 
189 template<typename T> struct Elem< Opt<T *> > : Elem<T *>
190 {
191  enum { Is_optional = true };
192  typedef Opt<typename Elem<T *>::svr_type> &svr_arg_type;
193  typedef Opt<typename Elem<T *>::svr_type> svr_type;
194 };
195 
196 
197 
198 template<typename T, typename CLASS>
199 struct Svr_val_ops<Opt<T>, Dir_out, CLASS> : Svr_noops< Opt<T> >
200 {
201  typedef Opt<T> svr_type;
202  typedef Svr_val_ops<T, Dir_out, CLASS> Native;
203 
204  using Svr_noops< Opt<T> >::to_svr;
205  static int to_svr(char *msg, unsigned offset, unsigned limit,
206  Opt<T> &arg, Dir_out, CLASS) noexcept
207  {
208  return Native::to_svr(msg, offset, limit, arg.value(), Dir_out(), CLASS());
209  }
210 
211  using Svr_noops< Opt<T> >::from_svr;
212  static int from_svr(char *msg, unsigned offset, unsigned limit, long ret,
213  svr_type &arg, Dir_out, CLASS) noexcept
214  {
215  if (arg.is_valid())
216  return Native::from_svr(msg, offset, limit, ret, arg.value(),
217  Dir_out(), CLASS());
218  return offset;
219  }
220 };
221 
222 template<typename T> struct Elem< Opt<T> > : Elem<T>
223 {
224  enum { Is_optional = true };
225  typedef Opt<T> arg_type;
226 };
227 
228 template<typename T> struct Elem< Opt<T const *> > : Elem<T const *>
229 {
230  enum { Is_optional = true };
231  typedef Opt<T const *> arg_type;
232 };
233 
234 template<typename T>
235 struct Is_valid_rpc_type< Opt<T const &> > : L4::Types::False {};
236 
237 template<typename T, typename CLASS>
238 struct Clnt_val_ops<Opt<T>, Dir_in, CLASS> : Clnt_noops< Opt<T> >
239 {
240  typedef Opt<T> arg_type;
241  typedef Detail::_Clnt_val_ops<typename Elem<T>::arg_type, Dir_in, CLASS> Native;
242 
243  using Clnt_noops< Opt<T> >::to_msg;
244  static int to_msg(char *msg, unsigned offset, unsigned limit,
245  arg_type arg, Dir_in, CLASS) noexcept
246  {
247  if (arg.is_valid())
248  return Native::to_msg(msg, offset, limit,
249  Detail::_Plain<T>::deref(arg.value()),
250  Dir_in(), CLASS());
251  return offset;
252  }
253 };
254 
255 template<typename T> struct Class< Opt<T> > :
256  Class< typename Detail::_Plain<T>::type > {};
257 template<typename T> struct Direction< Opt<T> > : Direction<T> {};
258 }
259 
268 class L4_EXPORT Small_buf
269 {
270 public:
278  explicit Small_buf(L4::Cap<void> cap, unsigned long flags = 0) noexcept
279  : _data(cap.cap() | L4_RCV_ITEM_SINGLE_CAP | flags) {}
280 
285  explicit Small_buf(l4_cap_idx_t cap, unsigned long flags = 0) noexcept
286  : _data(cap | L4_RCV_ITEM_SINGLE_CAP | flags) {}
287 
288  l4_umword_t raw() const noexcept { return _data; }
289 private:
290  l4_umword_t _data;
291 };
292 
294 class Snd_item
295 {
296 public:
297  Snd_item(l4_umword_t base, l4_umword_t data) noexcept : _base(base), _data(data) {}
298 
299 protected:
300  l4_umword_t _base;
301  l4_umword_t _data;
302 };
303 
305 class Buf_item
306 {
307 public:
308  Buf_item(l4_umword_t base, l4_umword_t data) noexcept : _base(base), _data(data) {}
309 
310 protected:
311  l4_umword_t _base;
312  l4_umword_t _data;
313 };
314 
320 template< typename T >
321 class L4_EXPORT Gen_fpage : public T
322 {
323 public:
325  enum Type
326  {
327  Special = L4_FPAGE_SPECIAL << 4,
328  Memory = L4_FPAGE_MEMORY << 4,
329  Io = L4_FPAGE_IO << 4,
330  Obj = L4_FPAGE_OBJ << 4
331  };
332 
334  enum Map_type
335  {
336  Map = L4_MAP_ITEM_MAP,
337  Grant = L4_MAP_ITEM_GRANT,
338  };
339 
341  enum Cacheopt
342  {
343  None = 0,
344  Cached = L4_FPAGE_CACHEABLE << 4,
345  Buffered = L4_FPAGE_BUFFERABLE << 4,
346  Uncached = L4_FPAGE_UNCACHEABLE << 4
347  };
348 
349  enum Continue
350  {
351  Single = 0,
352  Last = 0,
353  More = L4_ITEM_CONT,
354  Compound = L4_ITEM_CONT,
355  };
356 
357 private:
358  Gen_fpage(l4_umword_t d, l4_umword_t fp) noexcept : T(d, fp) {}
359 
360  Gen_fpage(Type type, l4_addr_t base, int order,
361  unsigned char rights,
362  l4_addr_t snd_base,
363  Map_type map_type,
364  Cacheopt cache, Continue cont) noexcept
365  : T(L4_ITEM_MAP | (snd_base & (~0UL << 10)) | l4_umword_t(map_type) | l4_umword_t(cache)
366  | l4_umword_t(cont),
367  base | l4_umword_t(type) | rights | (l4_umword_t(order) << 6))
368  {}
369 
370 public:
371  Gen_fpage() noexcept : T(0, 0) {}
372  Gen_fpage(l4_fpage_t const &fp, l4_addr_t snd_base = 0,
373  Map_type map_type = Map,
374  Cacheopt cache = None, Continue cont = Last) noexcept
375  : T(L4_ITEM_MAP | (snd_base & (~0UL << 10)) | l4_umword_t(map_type) | l4_umword_t(cache)
376  | l4_umword_t(cont),
377  fp.raw)
378  {}
379 
380  Gen_fpage(L4::Cap<void> cap, unsigned rights, Map_type map_type = Map) noexcept
381  : T(L4_ITEM_MAP | l4_umword_t(map_type) | (rights & 0xf0),
382  cap.fpage(rights).raw)
383  {}
384 
385  static Gen_fpage<T> obj(l4_addr_t base, int order,
386  unsigned char rights,
387  l4_addr_t snd_base = 0,
388  Map_type map_type = Map,
389  Continue cont = Last) noexcept
390  {
391  return Gen_fpage<T>(Obj, base << 12, order, rights, snd_base, map_type, None, cont);
392  }
393 
394  static Gen_fpage<T> mem(l4_addr_t base, int order,
395  unsigned char rights,
396  l4_addr_t snd_base = 0,
397  Map_type map_type = Map,
398  Cacheopt cache = None, Continue cont = Last) noexcept
399  {
400  return Gen_fpage<T>(Memory, base, order, rights, snd_base,
401  map_type, cache, cont);
402  }
403 
404  static Gen_fpage<T> rmem(l4_addr_t base, int order, l4_addr_t snd_base,
405  unsigned char rights, unsigned cap_br) noexcept
406  {
407  return Gen_fpage<T>(
408  L4_ITEM_MAP | (snd_base & (~0UL << 10)) | l4_umword_t(Map)
409  | l4_umword_t(None) | l4_umword_t(Compound) | (cap_br << 8),
410 
411  base | l4_umword_t(Memory) | rights | (l4_umword_t(order) << 6));
412  }
413 
414  static Gen_fpage<T> io(l4_addr_t base, int order,
415  unsigned char rights,
416  l4_addr_t snd_base = 0,
417  Map_type map_type = Map,
418  Continue cont = Last) noexcept
419  {
420  return Gen_fpage<T>(Io, base << 12, order, rights, snd_base, map_type, None, cont);
421  }
422 
423  unsigned order() const noexcept { return (T::_data >> 6) & 0x3f; }
424  unsigned snd_order() const noexcept { return (T::_data >> 6) & 0x3f; }
425  unsigned rcv_order() const noexcept { return (T::_base >> 6) & 0x3f; }
426  l4_addr_t base() const noexcept { return T::_data & (~0UL << 12); }
427  l4_addr_t snd_base() const noexcept { return T::_base & (~0UL << 10); }
428  void snd_base(l4_addr_t b) noexcept { T::_base = (T::_base & ~(~0UL << 10)) | (b & (~0UL << 10)); }
429 
431  bool is_valid() const noexcept { return T::_base & L4_ITEM_MAP; }
438  bool cap_received() const noexcept { return (T::_base & 0x3e) == 0x38; }
450  bool id_received() const noexcept { return (T::_base & 0x3e) == 0x3c; }
460  bool local_id_received() const noexcept { return (T::_base & 0x3e) == 0x3e; }
461 
468  bool is_compound() const noexcept { return T::_base & 1; }
470  l4_umword_t data() const noexcept { return T::_data; }
472  l4_umword_t base_x() const noexcept { return T::_base; }
473 };
474 
475 
480 
481 #ifdef L4_CXX_IPC_SUPPORT_STRINGS
482 template <typename T, typename B>
483 class Gen_string : public T
484 {
485 public:
486  Gen_string() noexcept : T(0, 0) {}
487  Gen_string(B buf, unsigned long size) noexcept
488  : T(size << 10, l4_umword_t(buf))
489  {}
490 
491  unsigned long len() const noexcept { return T::_base >> 10; }
492 };
493 
494 typedef Gen_string<Snd_item, void const *> Snd_string;
495 typedef Gen_string<Buf_item, void *> Rcv_string;
496 #endif
497 
498 
499 namespace Msg {
500 
501 // Snd_fpage are out items
502 template<> struct Class<L4::Ipc::Snd_fpage> : Cls_item {};
503 
504 // Rcv_fpage are buffer items
505 template<> struct Class<L4::Ipc::Rcv_fpage> : Cls_buffer {};
506 
507 // Remove receive buffers from server-side arguments
508 template<> struct Elem<L4::Ipc::Rcv_fpage>
509 {
510  typedef L4::Ipc::Rcv_fpage arg_type;
511  typedef void svr_type;
512  typedef void svr_arg_type;
513  enum { Is_optional = false };
514 };
515 
516 // Rcv_fpage are buffer items
517 template<> struct Class<L4::Ipc::Small_buf> : Cls_buffer {};
518 
519 // Remove receive buffers from server-side arguments
520 template<> struct Elem<L4::Ipc::Small_buf>
521 {
522  typedef L4::Ipc::Small_buf arg_type;
523  typedef void svr_type;
524  typedef void svr_arg_type;
525  enum { Is_optional = false };
526 };
527 } // namespace Msg
528 
529 // L4::Cap<> handling
530 
541 template<typename T> class Cap
542 {
543  template<typename O> friend class Cap;
544  l4_umword_t _cap_n_rights;
545 
546 public:
547  enum
548  {
554  Rights_mask = 0xff,
555 
560  Cap_mask = L4_CAP_MASK
561  };
562 
564  template<typename O>
565  Cap(Cap<O> const &o) noexcept : _cap_n_rights(o._cap_n_rights)
566  { T *x = (O*)1; (void)x; }
567 
569  Cap(L4::Cap<T> cap) noexcept
570  : _cap_n_rights((cap.cap() & Cap_mask) | (cap ? L4_CAP_FPAGE_R : 0))
571  {}
572 
574  template<typename O>
575  Cap(L4::Cap<O> cap) noexcept
576  : _cap_n_rights((cap.cap() & Cap_mask) | (cap ? L4_CAP_FPAGE_R : 0))
577  { T *x = (O*)1; (void)x; }
578 
580  Cap() noexcept : _cap_n_rights(L4_INVALID_CAP) {}
581 
589  Cap(L4::Cap<T> cap, unsigned char rights) noexcept
590  : _cap_n_rights((cap.cap() & Cap_mask) | (rights & Rights_mask)) {}
591 
597  static Cap from_ci(l4_cap_idx_t c) noexcept
598  { return Cap(L4::Cap<T>(c & Cap_mask), c & Rights_mask); }
599 
601  L4::Cap<T> cap() const noexcept
602  { return L4::Cap<T>(_cap_n_rights & Cap_mask); }
603 
605  unsigned rights() const noexcept
606  { return _cap_n_rights & Rights_mask; }
607 
609  L4::Ipc::Snd_fpage fpage() const noexcept
610  { return L4::Ipc::Snd_fpage(cap(), rights()); }
611 
613  bool is_valid() const noexcept
614  { return !(_cap_n_rights & L4_INVALID_CAP_BIT); }
615 };
616 
623 template<typename T>
624 Cap<T> make_cap(L4::Cap<T> cap, unsigned rights) noexcept
625 { return Cap<T>(cap, rights); }
626 
633 template<typename T>
635 { return Cap<T>(cap, L4_CAP_FPAGE_RW); }
636 
643 template<typename T>
645 { return Cap<T>(cap, L4_CAP_FPAGE_RWS); }
646 
661 template<typename T>
664 
665 // caps are special the have an invalid representation
666 template<typename T> struct L4_EXPORT Opt< Cap<T> >
667 {
668  Cap<T> _value;
669  Opt() noexcept {}
670  Opt(Cap<T> value) noexcept : _value(value) {}
671  Opt(L4::Cap<T> value) noexcept : _value(value) {}
672  Opt &operator = (Cap<T> value) noexcept
673  { this->_value = value; }
674  Opt &operator = (L4::Cap<T> value) noexcept
675  { this->_value = value; }
676 
677  Cap<T> value() const noexcept { return this->_value; }
678  bool is_valid() const noexcept { return this->_value.is_valid(); }
679 };
680 
681 
682 namespace Msg {
683 // prohibit L4::Cap as argument
684 template<typename A>
685 struct Is_valid_rpc_type< L4::Cap<A> > : L4::Types::False {};
686 
687 template<typename A> struct Class< Cap<A> > : Cls_item {};
688 template<typename A> struct Elem< Cap<A> >
689 {
690  enum { Is_optional = false };
691  typedef Cap<A> arg_type;
692  typedef L4::Ipc::Snd_fpage svr_type;
693  typedef L4::Ipc::Snd_fpage svr_arg_type;
694 };
695 
696 
697 template<typename A, typename CLASS>
698 struct Svr_val_ops<Cap<A>, Dir_in, CLASS> :
699  Svr_val_ops<L4::Ipc::Snd_fpage, Dir_in, CLASS>
700 {};
701 
702 template<typename A, typename CLASS>
703 struct Clnt_val_ops<Cap<A>, Dir_in, CLASS> :
704  Clnt_noops< Cap<A> >
705 {
706  using Clnt_noops< Cap<A> >::to_msg;
707 
708  static int to_msg(char *msg, unsigned offset, unsigned limit,
709  Cap<A> arg, Dir_in, Cls_item) noexcept
710  {
711  // passing an invalid cap as mandatory argument is an error
712  // XXX: This checks for a client calling error, we could
713  // also just ignore this for performance reasons and
714  // let the client fail badly (Alex: I'd prefer this)
715  if (L4_UNLIKELY(!arg.is_valid()))
716  return -L4_EMSGMISSARG;
717 
718  return msg_add(msg, offset, limit, arg.fpage());
719  }
720 };
721 
722 template<typename A>
723 struct Elem<Out<L4::Cap<A> > >
724 {
725  enum { Is_optional = false };
726  typedef L4::Cap<A> arg_type;
727  typedef Ipc::Cap<A> svr_type;
728  typedef svr_type &svr_arg_type;
729 };
730 
731 template<typename A> struct Direction< Out< L4::Cap<A> > > : Dir_out {};
732 template<typename A> struct Class< Out< L4::Cap<A> > > : Cls_item {};
733 
734 template<typename A>
735 struct Clnt_val_ops< L4::Cap<A>, Dir_out, Cls_item > :
736  Clnt_noops< L4::Cap<A> >
737 {
738  using Clnt_noops< L4::Cap<A> >::to_msg;
739  static int to_msg(char *msg, unsigned offset, unsigned limit,
740  L4::Cap<A> arg, Dir_in, Cls_buffer) noexcept
741  {
742  if (L4_UNLIKELY(!arg.is_valid()))
743  return -L4_EMSGMISSARG; // no buffer inserted
744  return msg_add(msg, offset, limit, Small_buf(arg));
745  }
746 };
747 
748 template<typename A>
749 struct Svr_val_ops< L4::Ipc::Cap<A>, Dir_out, Cls_item > :
750  Svr_noops<Cap<A> &>
751 {
752  using Svr_noops<Cap<A> &>::from_svr;
753  static int from_svr(char *msg, unsigned offset, unsigned limit, long,
754  Cap<A> arg, Dir_out, Cls_item) noexcept
755  {
756  if (L4_UNLIKELY(!arg.is_valid()))
757  // do not map anything
758  return msg_add(msg, offset, limit, L4::Ipc::Snd_fpage(arg.cap(), 0));
759 
760  return msg_add(msg, offset, limit, arg.fpage());
761  }
762 };
763 
764 // prohibit a UTCB pointer as normal RPC argument
765 template<> struct Is_valid_rpc_type<l4_utcb_t *> : L4::Types::False {};
766 
767 } // namespace Msg
768 } // namespace Ipc
769 } // namespace L4
770 
Identify a message item as map item.
Definition: consts.h:189
Capability type for RPC interfaces (see L4::Cap<T>).
Definition: ipc_types:541
Cap< T > make_cap(L4::Cap< T > cap, unsigned rights) noexcept
Make an L4::Ipc::Cap<T> for the given capability and rights.
Definition: ipc_types:624
Cap(L4::Cap< T > cap, unsigned char rights) noexcept
Make a Cap from L4::Cap<T> with the given rights.
Definition: ipc_types:589
bool _valid
True if the optional argument is present, false else.
Definition: ipc_types:150
Opt() noexcept
Make an absent optional argument.
Definition: ipc_types:153
Read and interface specific &#39;W&#39; right for capability flex-pages.
Definition: __l4_fpage.h:178
bool id_received() const noexcept
Check if a label was received instead of a mapping.
Definition: ipc_types:450
Invalid capability selector.
Definition: consts.h:141
L4::Ipc::Snd_fpage fpage() const noexcept
Return the send flexpage for this Cap (see l4_fpage_t)
Definition: ipc_types:609
Small_buf(l4_cap_idx_t cap, unsigned long flags=0) noexcept
Create a receive item from a C cap.
Definition: ipc_types:285
unsigned rights() const noexcept
Return the rights bits stored in this IPC cap.
Definition: ipc_types:605
Pass the argument as plain data value.
Definition: ipc_types:127
L4 low-level kernel interface.
A receive item for receiving a single capability.
Definition: ipc_types:268
unsigned long l4_cap_idx_t
L4 Capability selector Type.
Definition: types.h:342
RPC wrapper for a send item.
Definition: ipc_types:294
Cacheability option to enable caches for the mapping.
Definition: __l4_fpage.h:270
Mark an argument as a output value in an RPC signature.
Definition: ipc_types:42
Cacheopt
Caching options, see l4_fpage_cacheability_opt_t.
Definition: ipc_types:341
bool local_id_received() const noexcept
Check if a local capability id has been received.
Definition: ipc_types:460
RPC warpper for a receive item.
Definition: ipc_types:305
int Opcode
Data type for RPC opcodes.
Definition: __typeinfo.h:47
#define L4_UNLIKELY(x)
Expression is unlikely to execute.
Definition: compiler.h:238
bool is_valid() const noexcept
Return true if this Cap is valid.
Definition: ipc_types:613
Cap< T > make_cap_full(L4::Cap< T > cap) noexcept
Make an L4::IPC::Cap<T> for the given capability with full fpage and object-specific rights...
Definition: ipc_types:662
L4::Cap< T > cap() const noexcept
Return the L4::Cap<T> of this Cap.
Definition: ipc_types:601
unsigned long l4_umword_t
Unsigned machine word.
Definition: l4int.h:52
Map_type
Kind of mapping.
Definition: ipc_types:334
Mark an argument as in-out argument.
Definition: ipc_types:52
T value() const noexcept
Get the value.
Definition: ipc_types:174
Attribute for defining an optional RPC argument.
Definition: ipc_types:147
Cacheability option to disable caching for the mapping.
Definition: __l4_fpage.h:276
l4_umword_t raw
Raw value.
Definition: __l4_fpage.h:85
Mask to get only the relevant bits of an l4_cap_idx_t.
Definition: consts.h:139
l4_umword_t base_x() const noexcept
Return the raw base descriptor.
Definition: ipc_types:472
Cap(Cap< O > const &o) noexcept
Make copy with conversion.
Definition: ipc_types:565
Gen_fpage< Snd_item > Snd_fpage
Send flex-page.
Definition: ipc_types:477
Type
Type of mapping object, see L4_fpage_type.
Definition: ipc_types:325
static Cap from_ci(l4_cap_idx_t c) noexcept
Create an IPC capability from a C capability index plus rights.
Definition: ipc_types:597
All Object-type specific right bits.
Definition: __l4_fpage.h:250
Message has invalid capability.
Definition: err.h:68
bool is_valid() const noexcept
Check if the capability is valid.
Definition: ipc_types:431
Gen_fpage< Buf_item > Rcv_fpage
Rcv flex-page.
Definition: ipc_types:479
bool is_valid() const noexcept
Get true if present, false if not.
Definition: ipc_types:178
bool is_valid() const noexcept
Test whether the capability is a valid capability index (i.e., not L4_INVALID_CAP).
Definition: capability.h:60
T & value() noexcept
Get the value.
Definition: ipc_types:176
L4 flexpage type.
Definition: __l4_fpage.h:83
l4_fpage_t fpage(unsigned rights=L4_CAP_FPAGE_RWS) const noexcept
Return flex-page for the capability.
Definition: capability.h:72
Flag as grant instead of map operation.
Definition: consts.h:198
Denote that the following item shall be put into the same receive item as this one.
Definition: consts.h:195
Cap(L4::Cap< T > cap) noexcept
Make a Cap from L4::Cap<T>, with minimal rights.
Definition: ipc_types:569
Opt(T value) noexcept
Make a present optional argument with the given value.
Definition: ipc_types:156
T _value
The value.
Definition: ipc_types:149
Mark the receive buffer to be a small receive item that describes a buffer for a single capability...
Definition: consts.h:206
Read, interface specific &#39;W&#39;, and &#39;S&#39; rights for capability flex-pages.
Definition: __l4_fpage.h:192
C++ interface for capabilities.
Definition: capability.h:13
Cap(L4::Cap< O > cap) noexcept
Make IPC Cap from L4::Cap with conversion (and minimal rights).
Definition: ipc_types:575
bool cap_received() const noexcept
Check if the capability has been mapped.
Definition: ipc_types:438
l4_umword_t data() const noexcept
Return the raw flex page descriptor.
Definition: ipc_types:470
unsigned long l4_addr_t
Address type.
Definition: l4int.h:45
Cap< T > make_cap_rw(L4::Cap< T > cap) noexcept
Make an L4::Ipc::Cap<T> for the given capability with L4_CAP_FPAGE_RW rights.
Definition: ipc_types:634
Cap() noexcept
Make an invalid cap.
Definition: ipc_types:580
Full rights for capability flex-pages.
Definition: __l4_fpage.h:198
void set_valid(bool valid=true) noexcept
Set the argument to present or absent.
Definition: ipc_types:167
Read right for capability flex-pages.
Definition: __l4_fpage.h:161
Flag as usual map operation.
Definition: consts.h:199
Cap< T > make_cap_rws(L4::Cap< T > cap) noexcept
Make an L4::Ipc::Cap<T> for the given capability with L4_CAP_FPAGE_RWS rights.
Definition: ipc_types:644
Small_buf(L4::Cap< void > cap, unsigned long flags=0) noexcept
Create a receive item from a C++ cap.
Definition: ipc_types:278
Cacheability option to enable buffered writes for the mapping.
Definition: __l4_fpage.h:273
False meta value.
Definition: types:308
Generic RPC wrapper for L4 flex-pages.
Definition: ipc_types:321
bool is_compound() const noexcept
Check if the received item has the compound bit set.
Definition: ipc_types:468