L4Re Operating System Framework – Interface and Usage Documentation
Loading...
Searching...
No Matches
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"
27namespace L4 {
28
30typedef int Opcode;
31
32namespace Ipc {
33
42template<typename T> struct L4_EXPORT Out;
43
44
52template<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
61namespace Msg {
62template<typename A> struct Elem< In_out<A *> > : Elem<A *> {};
63
64template<typename A>
65struct 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
71template<typename A>
72struct 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
78template<typename A>
79struct Is_valid_rpc_type< In_out<A *> > : Is_valid_rpc_type<A *> {};
80template<typename A>
81struct Is_valid_rpc_type< In_out<A const *> > : L4::Types::False {};
82
83#ifdef CONFIG_ALLOW_REFS
84template<typename A> struct Elem< In_out<A &> > : Elem<A &> {};
85
86template<typename A>
87struct 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
93template<typename A>
94struct 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
100template<typename A>
101struct Is_valid_rpc_type< In_out<A &> > : Is_valid_rpc_type<A &> {};
102template<typename A>
103struct Is_valid_rpc_type< In_out<A const &> > : L4::Types::False {};
104
105#else
106
107template<typename A>
108struct Is_valid_rpc_type< In_out<A &> > : L4::Types::False {};
109
110#endif
111
112// Value types don't make sense for output.
113template<typename A>
114struct Is_valid_rpc_type< In_out<A> > : L4::Types::False {};
115
116}
117
118
127template<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
137namespace Msg {
138template<typename T> struct Class< As_value<T> > : Cls_data {};
139template<typename T> struct Elem< As_value<T> > : Elem<T> {};
140template<typename T> struct Elem< As_value<T> *> : Elem<T *> {};
141}
142
143
147template<typename T> struct L4_EXPORT Opt
148{
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
181namespace Msg {
182template<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
189template<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
198template<typename T, typename CLASS>
199struct 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
222template<typename T> struct Elem< Opt<T> > : Elem<T>
223{
224 enum { Is_optional = true };
225 typedef Opt<T> arg_type;
226};
227
228template<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
234template<typename T>
235struct Is_valid_rpc_type< Opt<T const &> > : L4::Types::False {};
236
237template<typename T, typename CLASS>
238struct 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
255template<typename T> struct Class< Opt<T> > :
256 Class< typename Detail::_Plain<T>::type > {};
257template<typename T> struct Direction< Opt<T> > : Direction<T> {};
258}
259
269{
270public:
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; }
289private:
290 l4_umword_t _data;
291};
292
295{
296public:
297 Snd_item(l4_umword_t base, l4_umword_t data) noexcept : _base(base), _data(data) {}
298
299protected:
300 l4_umword_t _base;
301 l4_umword_t _data;
302};
303
306{
307public:
308 Buf_item(l4_umword_t base, l4_umword_t data) noexcept : _base(base), _data(data) {}
309
310protected:
311 l4_umword_t _base;
312 l4_umword_t _data;
313};
314
320template< typename T >
321class L4_EXPORT Gen_fpage : public T
322{
323public:
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
335 {
336 Map = L4_MAP_ITEM_MAP,
337 Grant = L4_MAP_ITEM_GRANT,
338 };
339
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
357private:
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
370public:
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; }
442 bool cap_received() const noexcept { return (T::_base & 0x3e) == 0x38; }
454 bool id_received() const noexcept { return (T::_base & 0x3e) == 0x3c; }
464 bool local_id_received() const noexcept { return (T::_base & 0x3e) == 0x3e; }
465
472 bool is_compound() const noexcept { return T::_base & 1; }
474 l4_umword_t data() const noexcept { return T::_data; }
476 l4_umword_t base_x() const noexcept { return T::_base; }
477};
478
479
484
485#ifdef L4_CXX_IPC_SUPPORT_STRINGS
486template <typename T, typename B>
487class Gen_string : public T
488{
489public:
490 Gen_string() noexcept : T(0, 0) {}
491 Gen_string(B buf, unsigned long size) noexcept
492 : T(size << 10, l4_umword_t(buf))
493 {}
494
495 unsigned long len() const noexcept { return T::_base >> 10; }
496};
497
498typedef Gen_string<Snd_item, void const *> Snd_string;
499typedef Gen_string<Buf_item, void *> Rcv_string;
500#endif
501
502
503namespace Msg {
504
505// Snd_fpage are out items
506template<> struct Class<L4::Ipc::Snd_fpage> : Cls_item {};
507
508// Rcv_fpage are buffer items
509template<> struct Class<L4::Ipc::Rcv_fpage> : Cls_buffer {};
510
511// Remove receive buffers from server-side arguments
512template<> struct Elem<L4::Ipc::Rcv_fpage>
513{
514 typedef L4::Ipc::Rcv_fpage arg_type;
515 typedef void svr_type;
516 typedef void svr_arg_type;
517 enum { Is_optional = false };
518};
519
520// Rcv_fpage are buffer items
521template<> struct Class<L4::Ipc::Small_buf> : Cls_buffer {};
522
523// Remove receive buffers from server-side arguments
524template<> struct Elem<L4::Ipc::Small_buf>
525{
526 typedef L4::Ipc::Small_buf arg_type;
527 typedef void svr_type;
528 typedef void svr_arg_type;
529 enum { Is_optional = false };
530};
531} // namespace Msg
532
533// L4::Cap<> handling
534
545template<typename T> class Cap
546{
547 template<typename O> friend class Cap;
548 l4_umword_t _cap_n_rights;
549
550public:
551 enum
552 {
559
565 };
566
568 template<typename O>
569 Cap(Cap<O> const &o) noexcept : _cap_n_rights(o._cap_n_rights)
570 { T *x = (O*)1; (void)x; }
571
574 : _cap_n_rights((cap.cap() & Cap_mask) | (cap ? L4_CAP_FPAGE_R : 0))
575 {}
576
578 template<typename O>
580 : _cap_n_rights((cap.cap() & Cap_mask) | (cap ? L4_CAP_FPAGE_R : 0))
581 { T *x = (O*)1; (void)x; }
582
584 Cap() noexcept : _cap_n_rights(L4_INVALID_CAP) {}
585
593 Cap(L4::Cap<T> cap, unsigned char rights) noexcept
594 : _cap_n_rights((cap.cap() & Cap_mask) | (rights & Rights_mask)) {}
595
601 static Cap from_ci(l4_cap_idx_t c) noexcept
602 { return Cap(L4::Cap<T>(c & Cap_mask), c & Rights_mask); }
603
605 L4::Cap<T> cap() const noexcept
606 { return L4::Cap<T>(_cap_n_rights & Cap_mask); }
607
609 unsigned rights() const noexcept
610 { return _cap_n_rights & Rights_mask; }
611
613 L4::Ipc::Snd_fpage fpage() const noexcept
614 { return L4::Ipc::Snd_fpage(cap(), rights()); }
615
617 bool is_valid() const noexcept
618 { return !(_cap_n_rights & L4_INVALID_CAP_BIT); }
619};
620
627template<typename T>
628Cap<T> make_cap(L4::Cap<T> cap, unsigned rights) noexcept
629{ return Cap<T>(cap, rights); }
630
637template<typename T>
639{ return Cap<T>(cap, L4_CAP_FPAGE_RW); }
640
647template<typename T>
649{ return Cap<T>(cap, L4_CAP_FPAGE_RWS); }
650
665template<typename T>
668
669// caps are special the have an invalid representation
670template<typename T> struct L4_EXPORT Opt< Cap<T> >
671{
672 Cap<T> _value;
673 Opt() noexcept {}
674 Opt(Cap<T> value) noexcept : _value(value) {}
675 Opt(L4::Cap<T> value) noexcept : _value(value) {}
676 Opt &operator = (Cap<T> value) noexcept
677 { this->_value = value; }
678 Opt &operator = (L4::Cap<T> value) noexcept
679 { this->_value = value; }
680
681 Cap<T> value() const noexcept { return this->_value; }
682 bool is_valid() const noexcept { return this->_value.is_valid(); }
683};
684
685
686namespace Msg {
687// prohibit L4::Cap as argument
688template<typename A>
689struct Is_valid_rpc_type< L4::Cap<A> > : L4::Types::False {};
690
691template<typename A> struct Class< Cap<A> > : Cls_item {};
692template<typename A> struct Elem< Cap<A> >
693{
694 enum { Is_optional = false };
695 typedef Cap<A> arg_type;
696 typedef L4::Ipc::Snd_fpage svr_type;
697 typedef L4::Ipc::Snd_fpage svr_arg_type;
698};
699
700
701template<typename A, typename CLASS>
702struct Svr_val_ops<Cap<A>, Dir_in, CLASS> :
703 Svr_val_ops<L4::Ipc::Snd_fpage, Dir_in, CLASS>
704{};
705
706template<typename A, typename CLASS>
707struct Clnt_val_ops<Cap<A>, Dir_in, CLASS> :
708 Clnt_noops< Cap<A> >
709{
710 using Clnt_noops< Cap<A> >::to_msg;
711
712 static int to_msg(char *msg, unsigned offset, unsigned limit,
713 Cap<A> arg, Dir_in, Cls_item) noexcept
714 {
715 // passing an invalid cap as mandatory argument is an error
716 // XXX: This checks for a client calling error, we could
717 // also just ignore this for performance reasons and
718 // let the client fail badly (Alex: I'd prefer this)
719 if (L4_UNLIKELY(!arg.is_valid()))
720 return -L4_EMSGMISSARG;
721
722 return msg_add(msg, offset, limit, arg.fpage());
723 }
724};
725
726template<typename A>
727struct Elem<Out<L4::Cap<A> > >
728{
729 enum { Is_optional = false };
730 typedef L4::Cap<A> arg_type;
731 typedef Ipc::Cap<A> svr_type;
732 typedef svr_type &svr_arg_type;
733};
734
735template<typename A> struct Direction< Out< L4::Cap<A> > > : Dir_out {};
736template<typename A> struct Class< Out< L4::Cap<A> > > : Cls_item {};
737
738template<typename A>
739struct Clnt_val_ops< L4::Cap<A>, Dir_out, Cls_item > :
740 Clnt_noops< L4::Cap<A> >
741{
742 using Clnt_noops< L4::Cap<A> >::to_msg;
743 static int to_msg(char *msg, unsigned offset, unsigned limit,
744 L4::Cap<A> arg, Dir_in, Cls_buffer) noexcept
745 {
746 if (L4_UNLIKELY(!arg.is_valid()))
747 return -L4_EMSGMISSARG; // no buffer inserted
748 return msg_add(msg, offset, limit, Small_buf(arg));
749 }
750};
751
752template<typename A>
753struct Svr_val_ops< L4::Ipc::Cap<A>, Dir_out, Cls_item > :
754 Svr_noops<Cap<A> &>
755{
756 using Svr_noops<Cap<A> &>::from_svr;
757 static int from_svr(char *msg, unsigned offset, unsigned limit, long,
758 Cap<A> arg, Dir_out, Cls_item) noexcept
759 {
760 if (L4_UNLIKELY(!arg.is_valid()))
761 // do not map anything
762 return msg_add(msg, offset, limit, L4::Ipc::Snd_fpage(arg.cap(), 0));
763
764 return msg_add(msg, offset, limit, arg.fpage());
765 }
766};
767
768// prohibit a UTCB pointer as normal RPC argument
769template<> struct Is_valid_rpc_type<l4_utcb_t *> : L4::Types::False {};
770
771} // namespace Msg
772} // namespace Ipc
773} // namespace L4
774
bool is_valid() const noexcept
Test whether the capability is a valid capability index (i.e., not L4_INVALID_CAP).
Definition capability.h:60
C++ interface for capabilities.
Definition capability.h:222
RPC warpper for a receive item.
Definition ipc_types:306
Capability type for RPC interfaces (see L4::Cap<T>).
Definition ipc_types:546
Cap(L4::Cap< T > cap) noexcept
Make a Cap from L4::Cap<T>, with minimal rights.
Definition ipc_types:573
Cap(L4::Cap< T > cap, unsigned char rights) noexcept
Make a Cap from L4::Cap<T> with the given rights.
Definition ipc_types:593
static Cap from_ci(l4_cap_idx_t c) noexcept
Create an IPC capability from a C capability index plus rights.
Definition ipc_types:601
L4::Ipc::Snd_fpage fpage() const noexcept
Return the send flexpage for this Cap (see l4_fpage_t)
Definition ipc_types:613
Cap(L4::Cap< O > cap) noexcept
Make IPC Cap from L4::Cap with conversion (and minimal rights).
Definition ipc_types:579
Cap() noexcept
Make an invalid cap.
Definition ipc_types:584
L4::Cap< T > cap() const noexcept
Return the L4::Cap<T> of this Cap.
Definition ipc_types:605
unsigned rights() const noexcept
Return the rights bits stored in this IPC cap.
Definition ipc_types:609
bool is_valid() const noexcept
Return true if this Cap is valid.
Definition ipc_types:617
Cap(Cap< O > const &o) noexcept
Make copy with conversion.
Definition ipc_types:569
@ Rights_mask
Mask for rights bits stored internally.
Definition ipc_types:558
@ Cap_mask
Mask for significant capability bits.
Definition ipc_types:564
Generic RPC wrapper for L4 flex-pages.
Definition ipc_types:322
bool is_valid() const noexcept
Check if the capability is valid.
Definition ipc_types:431
l4_umword_t base_x() const noexcept
Return the raw base descriptor.
Definition ipc_types:476
Cacheopt
Caching options, see l4_fpage_cacheability_opt_t.
Definition ipc_types:342
bool id_received() const noexcept
Check if a label was received instead of a mapping.
Definition ipc_types:454
Type
Type of mapping object, see L4_fpage_type.
Definition ipc_types:326
bool cap_received() const noexcept
Check if at least one capability has been mapped.
Definition ipc_types:442
bool is_compound() const noexcept
Check if the received item has the compound bit set.
Definition ipc_types:472
Map_type
Kind of mapping.
Definition ipc_types:335
l4_umword_t data() const noexcept
Return the raw flex page descriptor.
Definition ipc_types:474
bool local_id_received() const noexcept
Check if a local capability id has been received.
Definition ipc_types:464
A receive item for receiving a single object capability.
Definition ipc_types:269
Small_buf(l4_cap_idx_t cap, unsigned long flags=0) noexcept
Create a receive item from a C cap.
Definition ipc_types:285
Small_buf(L4::Cap< void > cap, unsigned long flags=0) noexcept
Create a receive item from a C++ cap.
Definition ipc_types:278
RPC wrapper for a send item.
Definition ipc_types:295
unsigned long l4_umword_t
Unsigned machine word.
Definition l4int.h:51
unsigned long l4_addr_t
Address type.
Definition l4int.h:45
unsigned long l4_cap_idx_t
Capability selector type.
Definition types.h:358
@ L4_CAP_MASK
Mask to get only the relevant bits of an l4_cap_idx_t.
Definition consts.h:166
@ L4_INVALID_CAP
Invalid capability selector.
Definition consts.h:168
@ L4_EMSGMISSARG
Message has invalid capability.
Definition err.h:68
@ L4_FPAGE_CACHEABLE
Cacheability option to enable caches for the mapping.
Definition __l4_fpage.h:291
@ L4_FPAGE_UNCACHEABLE
Cacheability option to disable caching for the mapping.
Definition __l4_fpage.h:297
@ L4_FPAGE_BUFFERABLE
Cacheability option to enable buffered writes for the mapping.
Definition __l4_fpage.h:294
@ L4_FPAGE_MEMORY
Memory flex page.
Definition __l4_fpage.h:236
@ L4_FPAGE_IO
IO-port flex page.
Definition __l4_fpage.h:237
@ L4_FPAGE_OBJ
Object flex page (capabilities).
Definition __l4_fpage.h:238
@ L4_FPAGE_SPECIAL
Special flex page, either invalid or all spaces.
Definition __l4_fpage.h:235
@ L4_FPAGE_C_OBJ_RIGHTS
All Object-type specific right bits.
Definition __l4_fpage.h:271
@ L4_CAP_FPAGE_R
Read right for capability flex-pages.
Definition __l4_fpage.h:178
@ L4_CAP_FPAGE_RW
Read and interface specific 'W' right for capability flex-pages.
Definition __l4_fpage.h:195
@ L4_CAP_FPAGE_RWSD
Full rights for capability flex-pages.
Definition __l4_fpage.h:215
@ L4_CAP_FPAGE_RWS
Read, interface specific 'W', and 'S' rights for capability flex-pages.
Definition __l4_fpage.h:209
@ L4_MAP_ITEM_GRANT
Flag as grant instead of map operation.
Definition consts.h:257
@ L4_ITEM_MAP
Identify a message item as map item.
Definition consts.h:226
@ L4_ITEM_CONT
Denote that the following item shall be put into the same receive item as this one.
Definition consts.h:232
@ L4_MAP_ITEM_MAP
Flag as usual map operation.
Definition consts.h:259
@ L4_RCV_ITEM_SINGLE_CAP
Mark the receive buffer to be a small receive item that describes a buffer for a single object capabi...
Definition consts.h:266
struct l4_utcb_t l4_utcb_t
Opaque type for the UTCB.
Definition utcb.h:67
#define L4_UNLIKELY(x)
Expression is unlikely to execute.
Definition compiler.h:285
#define L4_EXPORT
Attribute to mark functions, variables, and data types as being exported from a library.
Definition compiler.h:221
int msg_add(char *msg, unsigned offs, unsigned limit, T v) noexcept
Add some data to a message at offs.
Definition ipc_basics:125
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:628
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:666
Gen_fpage< Snd_item > Snd_fpage
Send flex-page.
Definition ipc_types:481
Gen_fpage< Buf_item > Rcv_fpage
Rcv flex-page.
Definition ipc_types:483
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:638
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:648
L4 low-level kernel interface.
int Opcode
Data type for RPC opcodes.
Definition __typeinfo.h:47
Pass the argument as plain data value.
Definition ipc_types:128
Mark an argument as in-out argument.
Definition ipc_types:53
Attribute for defining an optional RPC argument.
Definition ipc_types:148
void set_valid(bool valid=true) noexcept
Set the argument to present or absent.
Definition ipc_types:167
Opt(T value) noexcept
Make a present optional argument with the given value.
Definition ipc_types:156
bool is_valid() const noexcept
Get true if present, false if not.
Definition ipc_types:178
T value() const noexcept
Get the value.
Definition ipc_types:174
T _value
The value.
Definition ipc_types:149
Opt() noexcept
Make an absent optional argument.
Definition ipc_types:153
T & value() noexcept
Get the value.
Definition ipc_types:176
bool _valid
True if the optional argument is present, false else.
Definition ipc_types:150
Mark an argument as a output value in an RPC signature.
Definition ipc_types:42
False meta value.
Definition types:308
L4 flexpage type.
Definition __l4_fpage.h:85