L4Re Operating System Framework
Interface and Usage Documentation
|
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 noexcept |
Return capability selector. | |
bool | is_valid () const noexcept |
Test whether the capability is a valid capability index (i.e., not L4_INVALID_CAP). | |
l4_fpage_t | fpage (unsigned rights=L4_CAP_FPAGE_RWS) const noexcept |
Return flex-page for the capability. | |
l4_umword_t | snd_base (unsigned grant=L4_MAP_ITEM_MAP, l4_cap_idx_t base=L4_INVALID_CAP) const noexcept |
Return send base. | |
bool | operator== (Cap_base const &o) const noexcept |
Test if two capabilities are equal. | |
bool | operator!= (Cap_base const &o) const noexcept |
Test if two capabilities are not equal. | |
l4_msgtag_t | validate (l4_utcb_t *u=l4_utcb()) const noexcept |
Check whether a capability is present (refers to an object). | |
l4_msgtag_t | validate (Cap< Task > task, l4_utcb_t *u=l4_utcb()) const noexcept |
Check whether a capability is present (refers to an object). | |
void | invalidate () noexcept |
Set this capability to invalid (L4_INVALID_CAP). | |
Protected Member Functions | |
Cap_base (l4_cap_idx_t c) noexcept | |
Generate a capability from its C representation. | |
Cap_base (Cap_type cap) noexcept | |
Constructor to create an invalid capability. | |
Cap_base (l4_default_caps_t cap) noexcept | |
Initialize capability with one of the default capabilities. | |
Cap_base () noexcept | |
Create an uninitialized instance. | |
void | move (Cap_base const &src) const |
Replace this capability with the contents of src . | |
void | copy (Cap_base const &src) const |
Copy a capability. | |
Protected Attributes | |
l4_cap_idx_t | _c |
The C representation of a capability selector. | |
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 40 of file capability.h.
Special value for uninitialized capability objects.
Enumerator | |
---|---|
No_init | Special value for constructing uninitialized Cap objects. |
Definition at line 29 of file capability.h.
|
inlineexplicitprotectednoexcept |
Generate a capability from its C representation.
c | The C capability |
Definition at line 144 of file capability.h.
|
inlineexplicitprotectednoexcept |
Initialize capability with one of the default capabilities.
cap | Capability. |
Definition at line 155 of file capability.h.
|
inlinenoexcept |
Return capability selector.
Definition at line 49 of file capability.h.
Referenced by L4Re::Util::Br_manager::alloc_buffer_demand(), L4vbus::Vbus::assign_dma_domain(), L4vbus::Vbus::assign_dma_domain(), L4::Icu::bind(), L4::Task::cap_equal(), L4::Task::cap_valid(), L4::Irq_mux::chain(), L4Re::Smart_count_cap< Unmap_flags >::copy(), L4Re::Util::Smart_count_cap< Unmap_flags >::copy(), L4::Factory::create_factory(), L4::Factory::create_gate(), L4::Factory::create_task(), L4::Task::delete_obj(), L4Re::Util::Smart_cap_auto< Unmap_flags >::free(), L4::Task::map(), L4Re::Util::Event_buffer_consumer_t< PAYLOAD >::process(), L4Re::Util::Br_manager::realloc_rcv_cap(), L4::Thread::register_del_irq(), L4::Task::release_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, L4_FPAGE_C_OBJ_RIGHTS, and l4_task_map().
|
inlinenoexcept |
Return flex-page for the capability.
rights | Rights, defaults to 'rws' |
Definition at line 69 of file capability.h.
References l4_obj_fpage().
Referenced by copy(), and move().
|
inlinenoexcept |
Test whether the capability is a valid capability index (i.e., not L4_INVALID_CAP).
Definition at line 57 of file capability.h.
Referenced by copy(), L4Re::Smart_count_cap< Unmap_flags >::copy(), L4Re::Util::Smart_cap_auto< Unmap_flags >::free(), L4Re::Util::Smart_cap_auto< Unmap_flags >::invalidate(), L4Re::Rm::Unique_region< T >::is_valid(), move(), L4Re::Rm::Unique_region< T >::operator=(), L4Re::Rm::Unique_region< T >::reset(), L4Re::Video::View::valid(), and L4Re::Rm::Unique_region< T >::~Unique_region().
|
inlineprotected |
Replace this capability with the contents of src
.
src | the source capability. |
After the operation this capability refers to the object formerly referred 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_FPAGE_C_OBJ_RIGHTS, L4_MAP_ITEM_GRANT, and l4_task_map().
|
inlinenoexcept |
Return send base.
grant | Indicates if object shall be granted. Allowed values: L4_MAP_ITEM_MAP, L4_MAP_ITEM_GRANT. |
base | Base capability (first in a bundle of aligned capabilities) |
Definition at line 81 of file capability.h.
References L4_INVALID_CAP, and l4_map_obj_control().
|
inlinenoexcept |
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, shall be the UTCB of the calling thread. See l4_utcb. |
l4_msgtag_t::label() > 0 | Capability is present (refers to an object). |
l4_msgtag_t::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 84 of file capability.
References l4_msgtag().
|
inlinenoexcept |
Check whether a capability is present (refers to an object).
u | UTCB to be used for this operation, shall be the UTCB of the calling thread. See l4_utcb. |
l4_msgtag_t::label() > 0 | Capability is present (refers to an object). |
l4_msgtag_t::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 91 of file capability.
References L4_BASE_TASK_CAP, and l4_msgtag().