L4Re - L4 Runtime Environment
|
Base class for all kinds of capabilities. More...
#include <l4/sys/capability>
Public Types | |
enum | No_init_type { No_init } |
Special value for uninitialized capability objects. More... | |
enum | Cap_type { Invalid = L4_INVALID_CAP } |
Invalid capability type. More... | |
Public Member Functions | |
l4_cap_idx_t | cap () const throw () |
Return capability selector. More... | |
bool | is_valid () const throw () |
Test whether the capability is a valid capability index (i.e., not L4_INVALID_CAP). More... | |
l4_fpage_t | fpage (unsigned rights=L4_FPAGE_RWX) const throw () |
Return flex-page for the capability. More... | |
l4_umword_t | snd_base (unsigned grant=0, l4_cap_idx_t base=L4_INVALID_CAP) const throw () |
Return send base. More... | |
bool | operator== (Cap_base const &o) const throw () |
Test if two capabilities are equal. | |
bool | operator!= (Cap_base const &o) const throw () |
Test if two capabilities are not equal. | |
l4_msgtag_t | validate (l4_utcb_t *u=l4_utcb()) const throw () |
Check whether a capability is present (refers to an object). More... | |
l4_msgtag_t | validate (Cap< Task > task, l4_utcb_t *u=l4_utcb()) const throw () |
Check whether a capability is present (refers to an object). More... | |
void | invalidate () throw () |
Set this capability to invalid (L4_INVALID_CAP). | |
Protected Member Functions | |
Cap_base (l4_cap_idx_t c) throw () | |
Generate a capability from its C representation. More... | |
Cap_base (Cap_type cap) throw () | |
Constructor to create an invalid capability. | |
Cap_base (l4_default_caps_t cap) throw () | |
Initialize capability with one of the default capabilities. More... | |
Cap_base () throw () | |
Create an uninitialized instance. | |
void | move (Cap_base const &src) const |
Replace this capability with the contents of src . More... | |
void | copy (Cap_base const &src) const |
Copy a capability. More... | |
Protected Attributes | |
l4_cap_idx_t | _c |
The C representation of a capability selector. More... | |
Base class for all kinds of capabilities.
This class contains all the things that are independent of the type of the object referred by the capability.
Definition at line 25 of file capability.h.
Invalid capability type.
Enumerator | |
---|---|
Invalid | Invalid capability selector. |
Definition at line 43 of file capability.h.
Special value for uninitialized capability objects.
Enumerator | |
---|---|
No_init | Special value for constructing uninitialized Cap objects. |
Definition at line 32 of file capability.h.
|
inlineexplicitprotected |
Generate a capability from its C representation.
c | The C capability |
Definition at line 144 of file capability.h.
|
inlineexplicitprotected |
Initialize capability with one of the default capabilities.
cap | Capability. |
Definition at line 155 of file capability.h.
|
inline |
Return capability selector.
Definition at line 52 of file capability.h.
Referenced by L4Re::Util::Cap_alloc_base::alloc(), L4vbus::Vbus::assign_dma_domain(), L4::Icu::bind(), L4::cap_cast(), L4::cap_reinterpret_cast(), L4::Irq_mux::chain(), L4Re::Util::Smart_count_cap< Unmap_flags >::copy(), L4Re::Smart_count_cap< Unmap_flags >::copy(), L4::Factory::create_factory(), L4::Factory::create_gate(), L4::Factory::create_irq(), L4::Factory::create_task(), L4::Factory::create_thread(), L4::Factory::create_vm(), L4Re::Util::Smart_cap_auto< Unmap_flags >::free(), L4::Invalid_capability::Invalid_capability(), L4virtio::Svr::Device_t< Ds_data >::mem_info(), L4::Smart_cap< T, SMART >::operator->(), L4::Cap< L4Re::Video::Goos >::operator->(), L4Re::Util::Event_buffer_consumer_t< PAYLOAD >::process(), L4::Ipc_svr::Server_iface::rcv_cap(), L4::Smart_cap< T, SMART >::Smart_cap(), L4::Icu::unbind(), and L4vbus::Icu::vicu().
|
inlineprotected |
Copy a capability.
src | the source capability. |
After this operation this capability refers to the same object as src
.
Definition at line 187 of file capability.h.
References fpage(), is_valid(), L4_BASE_TASK_CAP, L4_CAP_FPAGE_RWSD, and l4_task_map().
Referenced by L4::Cap< L4Re::Video::Goos >::copy(), and L4::Cap< L4Re::Video::Goos >::operator->().
|
inline |
Return flex-page for the capability.
rights | Rights, defaults to 'rwx' |
Definition at line 72 of file capability.h.
References l4_obj_fpage().
Referenced by copy(), and move().
|
inline |
Test whether the capability is a valid capability index (i.e., not L4_INVALID_CAP).
Definition at line 60 of file capability.h.
Referenced by L4Re::Rm::attach(), copy(), L4Re::Smart_count_cap< Unmap_flags >::copy(), L4Re::Util::Smart_cap_auto< Unmap_flags >::free(), L4Re::Util::Smart_cap_auto< Unmap_flags >::invalidate(), L4::Ipc::make_cap_full(), move(), and L4Re::Video::View::valid().
|
inlineprotected |
Replace this capability with the contents of src
.
src | the source capability. |
After the operation this capability refers to the object formerly referd to by the source capability src
, and the source capability no longer refers to an object.
Definition at line 171 of file capability.h.
References fpage(), is_valid(), L4_BASE_TASK_CAP, L4_CAP_FPAGE_RWSD, L4_MAP_ITEM_GRANT, and l4_task_map().
Referenced by L4::Cap< L4Re::Video::Goos >::move(), and L4::Cap< L4Re::Video::Goos >::operator->().
|
inline |
Return send base.
grant | True object should be granted. |
base | Base capability (first in a bundle of aligned capabilities) |
Definition at line 83 of file capability.h.
References L4_INVALID_CAP, and l4_map_obj_control().
|
inline |
Check whether a capability is present (refers to an object).
u | UTCB to be used for this operation, usually the UTCB of the calling thread. |
tag.label() | > 0 Capability is present (refers to an object). |
tag.label() | == 0 No capability present (void object or invalid capability slot). |
A capability is considered present when it refers to an existing kernel object.
Definition at line 90 of file capability.
|
inline |
Check whether a capability is present (refers to an object).
task | Task to check the capability in. |
u | UTCB to be used for this operation, usually the UTCB of the calling thread. |
tag.label() | > 0 Capability is present (refers to an object). |
tag.label() | == 0 No capability present (void object or invalid capability slot). |
A capability is considered present when it refers to an existing kernel object.
Definition at line 83 of file capability.
|
protected |
The C representation of a capability selector.
Definition at line 198 of file capability.h.
Referenced by L4::Smart_cap< T, SMART >::operator->(), and L4::Smart_cap< T, SMART >::Smart_cap().