4 #include <l4/sys/consts.h> 13 template<
typename T >
class L4_EXPORT
Cap;
28 struct Invalid_conversion;
60 bool is_valid()
const throw() {
return !(_c & L4_INVALID_CAP_BIT); }
62 operator Invalid_conversion * ()
const throw()
63 {
return (Invalid_conversion*)(!(_c & L4_INVALID_CAP_BIT)); }
95 bool operator == (
Cap_base const &o)
const throw()
96 {
return _c == o._c; }
102 {
return _c != o._c; }
217 template<
typename T >
234 explicit Cap(T
const *p)
throw()
235 :
Cap_base(reinterpret_cast<l4_cap_idx_t>(p)) {}
243 template<
typename O >
245 { T* __t = ((O*)100); (void)__t; }
295 T *operator -> ()
const throw() {
return reinterpret_cast<T*
>(_c); }
310 class L4_EXPORT Cap<void> :
public Cap_base 314 explicit Cap(
void const *p)
throw()
315 :
Cap_base(reinterpret_cast<l4_cap_idx_t>(p)) {}
341 Cap move(Cap
const &src)
const 351 Cap copy(Cap
const &src)
const 357 template<
typename T >
377 template<
typename T,
typename F >
381 (void)static_cast<T const *>(reinterpret_cast<F const *>(100));
386 template<
typename T >
408 template<
typename T,
typename F >
Cap(No_init_type)
Create an uninitialized cap selector.
Cap move(Cap const &src) const
Move a capability to this cap slot.
No_init_type
Special value for uninitialized capability objects.
Invalid capability selector.
Cap(l4_default_caps_t cap)
Initialize capability with one of the default capability selectors.
Cap(Cap_type cap)
Constructor to create an invalid capability selector.
l4_cap_idx_t _c
The C representation of a capability selector.
Common L4 ABI Data Types.
Read-write-execute flex page.
L4 low-level kernel interface.
Capability selector for the current task.
l4_umword_t snd_base(unsigned grant=0, l4_cap_idx_t base=L4_INVALID_CAP) const
Return send base.
unsigned long l4_cap_idx_t
L4 Capability selector Type.
struct l4_utcb_t l4_utcb_t
Opaque type for the UTCB.
void move(Cap_base const &src) const
Replace this capability with the contents of src.
l4_default_caps_t
Default capabilities setup for the initial tasks.
Cap< T > cap_reinterpret_cast(Cap< F > const &c)
reinterpret_cast for capabilities.
void invalidate()
Set this capability to invalid (L4_INVALID_CAP).
Base class for all kinds of kernel objects and remote objects, referenced by capabilities.
l4_cap_idx_t cap() const
Return capability selector.
Cap copy(Cap const &src) const
Copy a capability to this cap slot.
unsigned long l4_umword_t
Unsigned machine word.
Cap_type
Invalid capability type.
Cap(l4_cap_idx_t idx=L4_INVALID_CAP)
Initialize capability, defaults to the invalid capability selector.
Cap_base(l4_default_caps_t cap)
Initialize capability with one of the default capabilities.
l4_umword_t l4_map_obj_control(l4_umword_t spot, unsigned grant) L4_NOTHROW
Create the first word for a map item for the object space.
l4_utcb_t * l4_utcb(void) L4_NOTHROW L4_PURE
Get the UTCB address.
Common task related definitions.
Cap_base(l4_cap_idx_t c)
Generate a capability from its C representation.
l4_fpage_t fpage(unsigned rights=L4_FPAGE_RWX) const
Return flex-page for the capability.
Cap_base()
Create an uninitialized instance.
l4_cap_idx_t cap() const
Return capability selector.
l4_msgtag_t l4_task_map(l4_cap_idx_t dst_task, l4_cap_idx_t src_task, l4_fpage_t snd_fpage, l4_addr_t snd_base) L4_NOTHROW
Map resources available in the source task to a destination task.
Base class for all kinds of capabilities.
bool is_valid() const
Test whether the capability is a valid capability index (i.e., not L4_INVALID_CAP).
void copy(Cap_base const &src) const
Copy a capability.
Flag as grant instead of map operation.
Cap< T > cap_cast(Cap< F > const &c)
static_cast for capabilities.
C++ interface for capabilities.
Message tag data structure.
Cap(Cap< O > const &o)
Create a copy from o, supporting implicit type casting.
Cap_base(Cap_type cap)
Constructor to create an invalid capability.
Full rights for capability flex-pages.
l4_fpage_t l4_obj_fpage(l4_cap_idx_t obj, unsigned int order, unsigned char rights) L4_NOTHROW
Create a kernel-object flex page.