L4Re - L4 Runtime Environment
L4::Task Class Reference

C++ interface of the Task kernel object. More...

+ Inheritance diagram for L4::Task:
+ Collaboration diagram for L4::Task:

Public Member Functions

l4_msgtag_t map (Cap< Task > const &src_task, l4_fpage_t const &snd_fpage, l4_addr_t snd_base, l4_utcb_t *utcb=l4_utcb()) throw ()
 Map resources available in the source task to a destination task. More...
 
l4_msgtag_t unmap (l4_fpage_t const &fpage, l4_umword_t map_mask, l4_utcb_t *utcb=l4_utcb()) throw ()
 Revoke rights from the task. More...
 
l4_msgtag_t unmap_batch (l4_fpage_t const *fpages, unsigned num_fpages, l4_umword_t map_mask, l4_utcb_t *utcb=l4_utcb()) throw ()
 Revoke rights from a task. More...
 
l4_msgtag_t delete_obj (L4::Cap< void > obj, l4_utcb_t *utcb=l4_utcb()) throw ()
 Release capability and delete object. More...
 
l4_msgtag_t release_cap (L4::Cap< void > cap, l4_utcb_t *utcb=l4_utcb()) throw ()
 Release capability. More...
 
l4_msgtag_t cap_valid (Cap< void > const &cap, l4_utcb_t *utcb=l4_utcb()) throw ()
 Check whether a capability is present (refers to an object). More...
 
l4_msgtag_t cap_has_child (Cap< void > const &cap, l4_utcb_t *utcb=l4_utcb()) throw ()
 Test whether a capability has child mappings (in another task). More...
 
l4_msgtag_t cap_equal (Cap< void > const &cap_a, Cap< void > const &cap_b, l4_utcb_t *utcb=l4_utcb()) throw ()
 Test whether two capabilities point to the same object with the same rights. More...
 
l4_msgtag_t add_ku_mem (l4_fpage_t const &fpage, l4_utcb_t *utcb=l4_utcb()) throw ()
 Add kernel-user memory. More...
 
- Public Member Functions inherited from L4::Kobject
l4_msgtag_t dec_refcnt (l4_mword_t diff, l4_utcb_t *utcb=l4_utcb())
 Decrement the in kernel reference counter for the object. More...
 

Additional Inherited Members

- Protected Types inherited from L4::Kobject_t< Task, Kobject, L4_PROTO_TASK, Type_info::Demand_t< 2 > >
typedef Task Class
 The target interface type (inheriting from Kobject_t)
 
typedef Typeid::Iface< PROTO, Task__Iface
 The interface description for the derived class.
 
typedef Typeid::Merge_list< Typeid::Iface_list< __Iface >, typename Kobject ::__Iface_list > __Iface_list
 The list of all RPC interfaces provided directly or through inheritance.
 
- Protected Member Functions inherited from L4::Kobject_t< Task, Kobject, L4_PROTO_TASK, Type_info::Demand_t< 2 > >
L4::Cap< Classc () const
 Get the capability to ourselves.
 
- Protected Member Functions inherited from L4::Kobject
l4_cap_idx_t cap () const throw ()
 Return capability selector. More...
 
- Static Protected Member Functions inherited from L4::Kobject_t< Task, Kobject, L4_PROTO_TASK, Type_info::Demand_t< 2 > >
static void __check_protocols__ ()
 Helper to check for protocol conflicts.
 

Detailed Description

C++ interface of the Task kernel object.

The L4::Task class represents a combination of the address spaces provided by the L4Re micro kernel. A task consists of at least a memory address space and an object address space. On IA32 there is also an IO-port address space associated with an L4::Task.

L4::Task objects are created using the L4::Factory interface.

Include File
#include <l4/sys/task>

Definition at line 43 of file task.

Member Function Documentation

◆ add_ku_mem()

l4_msgtag_t L4::Task::add_ku_mem ( l4_fpage_t const &  fpage,
l4_utcb_t utcb = l4_utcb() 
)
throw (
)
inline

Add kernel-user memory.

Parameters
fpageFlexpage describing the virtual area the memory goes to.
utcbUTCP pointer of the calling thread.
Note
The amount of kernel-user memory that can be allocated at once is limited by the used kernel implementation. The minimum allocatable amount is one page (L4_PAGESIZE). A portable implementation should not depend on allocations greater than 16KiB to succeed.
Returns
Syscall return tag

Definition at line 215 of file task.

◆ cap_equal()

l4_msgtag_t L4::Task::cap_equal ( Cap< void > const &  cap_a,
Cap< void > const &  cap_b,
l4_utcb_t utcb = l4_utcb() 
)
throw (
)
inline

Test whether two capabilities point to the same object with the same rights.

Parameters
cap_aFirst capability selector to compare.
cap_bSecond capability selector to compare.
utcbOptional: UTCB pointer of the calling thread.
Return values
tag.label()= 1: cap_a and cap_b point to the same object.
tag.label()= 0: The two caps do not point to the same object.

Definition at line 196 of file task.

◆ cap_has_child()

l4_msgtag_t L4::Task::cap_has_child ( Cap< void > const &  cap,
l4_utcb_t utcb = l4_utcb() 
)
throw (
)
inline

Test whether a capability has child mappings (in another task).

Parameters
capCapability selector to look up in the destination task.
utcbUTCB pointer of the calling thread.
Return values
tag.label()= 1: The capability has at least on child mapping in another task.
tag.label()= 0: No child mappings.
Deprecated:
Do not use. Undetermined future, might be removed.

Definition at line 179 of file task.

◆ cap_valid()

l4_msgtag_t L4::Task::cap_valid ( Cap< void > const &  cap,
l4_utcb_t utcb = l4_utcb() 
)
throw (
)
inline

Check whether a capability is present (refers to an object).

Parameters
capCapability to check for presence.
utcbUTCB to be used for this operation, usually the UTCB of the calling thread.
Return values
tag.label()> 0 Capability is present (refers to an object).
tag.label()== 0 No capability present (void object).

A capability is considered present when it refers to an existing kernel object.

Definition at line 163 of file task.

◆ delete_obj()

l4_msgtag_t L4::Task::delete_obj ( L4::Cap< void >  obj,
l4_utcb_t utcb = l4_utcb() 
)
throw (
)
inline

Release capability and delete object.

Parameters
objCapability selector of the object to delete.
utcbUTCB pointer of the calling thread.
Returns
Syscall return tag

The object will be deleted if the obj has sufficient rights. No error will be reported if the rights are insufficient, however, the capability is removed in all cases.

Definition at line 133 of file task.

◆ map()

l4_msgtag_t L4::Task::map ( Cap< Task > const &  src_task,
l4_fpage_t const &  snd_fpage,
l4_addr_t  snd_base,
l4_utcb_t utcb = l4_utcb() 
)
throw (
)
inline

Map resources available in the source task to a destination task.

Parameters
src_taskCapability selector of the source task.
snd_fpageSend flexpage that describes an area in the address space or object space of the source task.
snd_baseSend base that describes an offset in the receive window of the destination task. The lower bits contain additional map control flags.
utcbUTCB pointer of the calling thread.
Returns
Syscall return tag.

This method allows for asynchronous rights delegation from one task to another. It can be used to share memory as well as to delegate access to objects. The destination task is the task referenced by the capability invoking map and the receive window is the whole address space of said task.

Definition at line 67 of file task.

◆ release_cap()

l4_msgtag_t L4::Task::release_cap ( L4::Cap< void >  cap,
l4_utcb_t utcb = l4_utcb() 
)
throw (
)
inline

Release capability.

Parameters
capCapability selector to release.
utcbUTCB pointer of the calling thread.
Returns
Syscall return tag.

This operation unmaps the capability from this task.

Definition at line 147 of file task.

◆ unmap()

l4_msgtag_t L4::Task::unmap ( l4_fpage_t const &  fpage,
l4_umword_t  map_mask,
l4_utcb_t utcb = l4_utcb() 
)
throw (
)
inline

Revoke rights from the task.

Parameters
fpageFlexpage that describes an area in the address space or object space of this task
map_maskUnmap mask, see l4_unmap_flags_t
utcbUTCB pointer of the calling thread.
Returns
Syscall return tag

This method allows to revoke rights from the destination task and from all the tasks that got the rights delegated from that task (i.e., this operation does a recursive rights revocation).

Note
If the capability possesses delete rights or if it is the last capability pointing to the object, calling this function might destroy the object itself.

Definition at line 90 of file task.

Referenced by L4Re::Rm::attach().

+ Here is the caller graph for this function:

◆ unmap_batch()

l4_msgtag_t L4::Task::unmap_batch ( l4_fpage_t const *  fpages,
unsigned  num_fpages,
l4_umword_t  map_mask,
l4_utcb_t utcb = l4_utcb() 
)
throw (
)
inline

Revoke rights from a task.

Parameters
fpagesAn array of flexpages. Each item describes an area in the address or object space of this task.
num_fpagesNumber of fpages in the fpages array.
map_maskUnmap mask, see l4_unmap_flags_t.
utcbUTCB pointer of the calling thread.

This method allows to revoke rights from the destination task and from all the tasks that got the rights delegated from that task (i.e., this operation does a recursive rights revocation).

Precondition
The caller needs to take care that num_fpages is not bigger than L4_UTCB_GENERIC_DATA_SIZE - 2.
Note
If the capability possesses delete rights or if it is the last capability pointing to the object, calling this function might destroy the object itself.

Definition at line 115 of file task.


The documentation for this class was generated from the following file: