> When waiting for IPC you can specify capability indices, which will<br>
> contain capabilities passed by the sender. If the capability indices you<br>
> specified contain still valid capabilities, they will nevertheless get<br>
> overwritten. In Genode, the message buffer object "Msg_buf" has some<br>
> capability indices used to hold received capabilities. Before receiving<br>
> new ones, already received capabilities are duplicated via "l4_task_map".<br><br>Thanks for the answer.<br>I would like to check that I understand correctly with the following example.<br>Please stop me if I am going somewhere wrong.<br>
<br>We can consider a thread waiting for an IPC with the following rcv_buf:<br><br>    rcv_buf {<br>        [cap: 0x13000(dst), 0x002f(local_name)]<br>        some buf;<br>    }<br><br>The thread receives an IPC call and the rcv_buf becomes the following:<br>
<br>    rcv_buf {<br>        [cap: 0x14000, 0x002f] // <--- overwritten to 0x14000.<br>        some buf;<br>    }<br>And, 0x14000 and 0x13000 is mapped by l4_task_map.<br>And, the thread who waits for the IPC call (who originally created 0x13000) uses<br>
the capability index 0x13000 as usual.<br><br><br>Regards,<br>Jaeyong<br><br><div class="gmail_quote">On Wed, Jan 30, 2013 at 7:34 PM, Stefan Kalkowski <span dir="ltr"><<a href="mailto:stefan.kalkowski@...1..." target="_blank">stefan.kalkowski@...1...</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Jaeyong,<br>
<div class="im"><br>
On 01/30/2013 02:20 AM, jaeyong yoo wrote:<br>
> Hello! Genode,<br>
><br>
> From time to time, I saw something like this:<br>
><br>
>     l4_task_map(L4_BASE_TASK_CAP, L4_BASE_TASK_CAP,<br>
>                         l4_obj_fpage(A.dst(), 0, L4_FPAGE_RWX),<br>
>                         B.dst() | L4_ITEM_MAP);<br>
><br>
> I think it looks like a unnecessary mapping, because rather than<br>
> mapping, we can just copy the capability like this,<br>
>     A = B.<br>
<br>
</div>No, that's not the same. Moreover, it has to be "B = A" in your example.<br>
<br>
The "l4_task_map" call above, creates a duplicate of the capability<br>
referenced by "A.dst()" to "B.dst()". The value given by "dst()" is an<br>
index into the capability name space of the task - in the following<br>
shortly titled as capability index. You cannot modify the capability<br>
name space in user mode. All changes to that space are done explicitly<br>
via the "l4_task_map" syscall, or implicitly by sending a capability<br>
mapping via IPC.<br>
<br>
The second example is simply an assignment, where A and B will reference<br>
the same capability index in the end. Moreover, the reference counter in<br>
Genode's capability will be increased. Look at<br>
"base-foc/include/base/native_types.h" for the definition of the<br>
capability class for Fiasco.OC.<br>
<br>
Normally, we simply use the simple assignments when passing around<br>
capabilities by value. But in some rare situations it is necessary to<br>
really duplicate a capability index.<br>
When waiting for IPC you can specify capability indices, which will<br>
contain capabilities passed by the sender. If the capability indices you<br>
specified contain still valid capabilities, they will nevertheless get<br>
overwritten. In Genode, the message buffer object "Msg_buf" has some<br>
capability indices used to hold received capabilities. Before receiving<br>
new ones, already received capabilities are duplicated via "l4_task_map".<br>
<br>
Regards<br>
Stefan<br>
<div class="im"><br>
><br>
> Since I'm feeling like I miss something here, could you tell me the<br>
> difference between two of them?<br>
><br>
> Best regards,<br>
> Jaeyong<br>
><br>
><br>
</div>> ------------------------------------------------------------------------------<br>
> Everyone hates slow websites. So do we.<br>
> Make your web apps faster with AppDynamics<br>
> Download AppDynamics Lite for free today:<br>
> <a href="http://p.sf.net/sfu/appdyn_d2d_jan" target="_blank">http://p.sf.net/sfu/appdyn_d2d_jan</a><br>
><br>
><br>
><br>
> _______________________________________________<br>
> Genode-main mailing list<br>
> <a href="mailto:Genode-main@lists.sourceforge.net">Genode-main@...49....sourceforge.net</a><br>
> <a href="https://lists.sourceforge.net/lists/listinfo/genode-main" target="_blank">https://lists.sourceforge.net/lists/listinfo/genode-main</a><br>
><br>
<br>
--<br>
Stefan Kalkowski<br>
Genode Labs<br>
<br>
<a href="http://www.genode-labs.com/" target="_blank">http://www.genode-labs.com/</a> · <a href="http://genode.org/" target="_blank">http://genode.org/</a><br>
<br>
------------------------------------------------------------------------------<br>
Everyone hates slow websites. So do we.<br>
Make your web apps faster with AppDynamics<br>
Download AppDynamics Lite for free today:<br>
<a href="http://p.sf.net/sfu/appdyn_d2d_jan" target="_blank">http://p.sf.net/sfu/appdyn_d2d_jan</a><br>
_______________________________________________<br>
Genode-main mailing list<br>
<a href="mailto:Genode-main@lists.sourceforge.net">Genode-main@...12...ceforge.net</a><br>
<a href="https://lists.sourceforge.net/lists/listinfo/genode-main" target="_blank">https://lists.sourceforge.net/lists/listinfo/genode-main</a><br>
</blockquote></div><br>