examples/libs/l4re/c++/shared_ds/ds_clnt.cc

Björn Döbel doebel at os.inf.tu-dresden.de
Fri Oct 10 18:10:26 CEST 2014



Am 10.10.2014 um 16:45 schrieb teclis High Elf:
>  From examples/libs/l4re/c++/shared_ds/ds_clnt.cc
>
> line 49 : L4::Cap<L4::Irq> irq = L4Re::Util::cap_alloc.alloc<L4::Irq>();
>
> It seems this template name L4::Cap and the function name
> L4Re::Util::cap_alloc are a bit misleading or only designate a sub-set
> of the objects functionality. In this line you are not just requesting
> permissions but getting a Unix style file handle that you then use to
> issue commands to the server on line 92:
>
> irq->trigger();
>
> Is my understanding correct?

No. Unfortunately not.

 > At line 49 you are opening L4 equivalent of
> a Unix style file handle for sending commands to a server and not
> requesting permissions or am I over simplifying.

There are two steps to accessing a kernel object (such as a software 
IRQ) in Fiasco. First you need to find a suitable spot in the 
process-local capability table to map the object to. Then, in a second 
step, you actually allocate the respective kernel object into this slot.

The line you are referring to only performs the first step (hence this 
is called cap_alloc.alloc()). The mapping from a real IRQ object to this 
capability is hidden in the svr->get_shared_buffer() call further down 
the line.

Bjoern




More information about the l4-hackers mailing list