Files
moslab-code/doc/source/html/ipc__gate_8h.html
2025-09-12 15:55:45 +02:00

167 lines
16 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!-- HTML header for doxygen 1.9.1-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.15.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>L4Re Operating System Framework: l4/sys/ipc_gate.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="doxygen-awesome.css" rel="stylesheet" type="text/css"/>
<link href="l4re-awesome.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectlogo"><img alt="Logo" src="L4Re_rgb_logo_quer_hg_h55.png"/></td>
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">L4Re Operating System Framework
</div>
<div id="projectbrief">Interface and Usage Documentation</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.15.0 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search/",'.html');
</script>
<script type="text/javascript">
$(function() { codefold.init(); });
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
initMenu('',true,false,'search.php','Search',true);
$(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
$(function(){initNavTree('ipc__gate_8h.html','',''); });
</script>
<div id="container">
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div class="header">
<div class="headertitle"><div class="title">ipc_gate.h File Reference</div></div>
</div><!--header-->
<div class="contents">
<p>The C IPC gate interface, see <a class="el" href="classL4_1_1Ipc__gate.html" title="The C++ IPC gate interface, see IPC-Gate API for the C interface.">L4::Ipc_gate</a> for the C++ interface.
<a href="#details">More...</a></p>
<div class="textblock"><code>#include &lt;<a class="el" href="l4_2sys_2utcb_8h_source.html">l4/sys/utcb.h</a>&gt;</code><br />
<code>#include &lt;<a class="el" href="l4_2sys_2types_8h_source.html">l4/sys/types.h</a>&gt;</code><br />
<code>#include &lt;<a class="el" href="rcv__endpoint_8h_source.html">l4/sys/rcv_endpoint.h</a>&gt;</code><br />
<code>#include &lt;<a class="el" href="l4_2sys_2ipc_8h_source.html">l4/sys/ipc.h</a>&gt;</code><br />
</div><div class="textblock"><div id="dynsection-0" onclick="return dynsection.toggleVisibility(this)" class="dynheader closed" style="cursor:pointer;"><span class="dynarrow"><span class="arrowhead closed"></span></span>Include dependency graph for ipc_gate.h:</div>
<div id="dynsection-0-summary" class="dynsummary" style="display:block;">
</div>
<div id="dynsection-0-content" class="dyncontent" style="display:none;">
<div class="center"><iframe scrolling="no" loading="lazy" frameborder="0" src="ipc__gate_8h__incl.svg" width="599" height="550"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
</div>
</div><div class="textblock"><div id="dynsection-1" onclick="return dynsection.toggleVisibility(this)" class="dynheader closed" style="cursor:pointer;"><span class="dynarrow"><span class="arrowhead closed"></span></span>This graph shows which files directly or indirectly include this file:</div>
<div id="dynsection-1-summary" class="dynsummary" style="display:block;">
</div>
<div id="dynsection-1-content" class="dyncontent" style="display:none;">
<div class="center"><iframe scrolling="no" loading="lazy" frameborder="0" src="ipc__gate_8h__dep__incl.svg" width="919" height="359"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
</div>
</div>
<p><a href="ipc__gate_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 id="header-enum-members" class="groupheader"><a id="enum-members" name="enum-members"></a>
Enumerations</h2></td></tr>
<tr class="memitem:ga060a882608f5d7cdfe85dce569e52e35" id="r_ga060a882608f5d7cdfe85dce569e52e35"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__l4__protocol__ops.html#ga060a882608f5d7cdfe85dce569e52e35">L4_ipc_gate_ops</a> { <a class="el" href="group__l4__protocol__ops.html#gga060a882608f5d7cdfe85dce569e52e35a32c11f6822f4d4d8a61cabb6cf56472d">L4_IPC_GATE_BIND_OP</a> = 0x10
, <a class="el" href="group__l4__protocol__ops.html#gga060a882608f5d7cdfe85dce569e52e35a3c4b18dba2206d5eeddc002bd0da8063">L4_IPC_GATE_GET_INFO_OP</a> = 0x11
}</td></tr>
<tr class="memdesc:ga060a882608f5d7cdfe85dce569e52e35"><td class="mdescLeft">&#160;</td><td class="mdescRight">Operations on the IPC-gate. <a href="group__l4__protocol__ops.html#ga060a882608f5d7cdfe85dce569e52e35">More...</a><br /></td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 id="header-func-members" class="groupheader"><a id="func-members" name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga129986b9fdb9821c9458e99703f722a2" id="r_ga129986b9fdb9821c9458e99703f722a2"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structl4__msgtag__t.html">l4_msgtag_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__l4__kernel__object__gate__api.html#ga129986b9fdb9821c9458e99703f722a2">l4_ipc_gate_get_infos</a> (<a class="el" href="group__l4__cap__api.html#ga1445e923ce73029130d569d6e69a4dd8">l4_cap_idx_t</a> gate, <a class="el" href="group__l4__basic__types.html#ga1c2c4b333f75b1d05b59855910f2b9cb">l4_umword_t</a> *label)</td></tr>
<tr class="memdesc:ga129986b9fdb9821c9458e99703f722a2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get information about the IPC-gate. <br /></td></tr>
</table>
<a name="details" id="details"></a><h2 id="header-details" class="groupheader">Detailed Description</h2>
<div class="textblock"><p>The C IPC gate interface, see <a class="el" href="classL4_1_1Ipc__gate.html" title="The C++ IPC gate interface, see IPC-Gate API for the C interface.">L4::Ipc_gate</a> for the C++ interface. </p>
<p>IPC gates are used to create secure communication channels between protection domains. An IPC gate can be created using the <a class="el" href="group__l4__factory__api.html">Factory</a> interface.</p>
<p>Depending on the permissions of the capability used, an IPC gate forwards IPC to the <a class="el" href="group__l4__thread__api.html">Thread</a> the IPC gate is <em>bound</em> to (cf. <a class="el" href="group__l4__kernel__object__gate__api.html#gad3ab8fc6f519189a50d8b25b0c9ea3e6" title="Bind the IPC receive endpoint to a thread.">l4_rcv_ep_bind_thread()</a> and <a class="el" href="group__l4__kernel__object__gate__api.html#gadb03d49fcf42b9fc167338fa1cd72fb4" title="Bind the IPC receive endpoint to a send destination (a thread).">l4_rcv_ep_bind_snd_destination()</a>). If the capability has the <a class="el" href="group__l4__msgitem__api.html#ggad142e99a533af52d358f9940fa00966aa8436980325edd409d8aa71e1ef567bc4" title="The receiver may invoke IPC-gate-specific functions on the capability, e.g.">L4_FPAGE_C_IPCGATE_SVR</a> permission, only IPC using a protocol different from the <a class="el" href="group__l4__msgtag__api.html#gga9ac8443c5696208bb0539dd659ea1c92a4d73bcf33c37734b33c47ef4b11ec5fa" title="Protocol for messages to a generic kobject.">L4_PROTO_KOBJECT</a> protocol is forwarded. Without the <a class="el" href="group__l4__msgitem__api.html#ggad142e99a533af52d358f9940fa00966aa8436980325edd409d8aa71e1ef567bc4" title="The receiver may invoke IPC-gate-specific functions on the capability, e.g.">L4_FPAGE_C_IPCGATE_SVR</a> permission, all IPC is forwarded. The latter is the usual case for a client in a client/server scenario. When not bound to a thread or thread group yet, the forwarded IPC blocks until the IPC gate is bound to a thread or thread group, or the IPC times out.</p>
<p>Forwarded IPC is always forwarded to the userland of the thread the IPC gate is bound to, either directly or indirectly using a thread group. That means, the <a class="el" href="group__l4__thread__api.html">Thread</a> interface of that thread is not accessible via an IPC gate. The <a class="el" href="group__l4__kernel__object__gate__api.html">IPC-Gate API</a> of an IPC gate is only accessible if the capability used has the <a class="el" href="group__l4__msgitem__api.html#ggad142e99a533af52d358f9940fa00966aa8436980325edd409d8aa71e1ef567bc4" title="The receiver may invoke IPC-gate-specific functions on the capability, e.g.">L4_FPAGE_C_IPCGATE_SVR</a> permission (cf. previous paragraph). Conversely that means, if the capability used lacks the <a class="el" href="group__l4__msgitem__api.html#ggad142e99a533af52d358f9940fa00966aa8436980325edd409d8aa71e1ef567bc4" title="The receiver may invoke IPC-gate-specific functions on the capability, e.g.">L4_FPAGE_C_IPCGATE_SVR</a> permission, <a class="el" href="group__l4__kernel__object__gate__api.html">IPC-Gate API</a> calls are forwarded to the thread or thread group the IPC gate is bound to instead of being processed by the IPC gate itself. In a client/server scenario, a client should only get IPC gate capabilities without <a class="el" href="group__l4__msgitem__api.html#ggad142e99a533af52d358f9940fa00966aa8436980325edd409d8aa71e1ef567bc4" title="The receiver may invoke IPC-gate-specific functions on the capability, e.g.">L4_FPAGE_C_IPCGATE_SVR</a> permission so the client cannot tamper with the IPC gate.</p>
<p>When binding an IPC gate to a thread or thread group, a user-defined, kernel protected, machine-word sized payload called the IPC gates <em>label</em> is assigned to the IPC gate (note that the two least significant bits of the label must be zero; cf. <a class="el" href="group__l4__kernel__object__gate__api.html#gad3ab8fc6f519189a50d8b25b0c9ea3e6" title="Bind the IPC receive endpoint to a thread.">l4_rcv_ep_bind_thread()</a> and <a class="el" href="group__l4__kernel__object__gate__api.html#gadb03d49fcf42b9fc167338fa1cd72fb4" title="Bind the IPC receive endpoint to a send destination (a thread).">l4_rcv_ep_bind_snd_destination()</a>). When a send-only IPC or call IPC is forwarded via an IPC gate, the label provided by the sender is ignored and replaced by the IPC gates label where the two least significant bits are set to the <a class="el" href="group__l4__fpage__api.html#ggaee60789a48cab2782f5a368237591b39acb2b2e95f6be245f64937ac48a068066" title="Interface specific &#39;S&#39; right for capability flexpages.">L4_CAP_FPAGE_S</a> and <a class="el" href="group__l4__fpage__api.html#ggaee60789a48cab2782f5a368237591b39a561054fb4021ff4a22ab1881c7a7de5a" title="Interface specific &#39;W&#39; right for capability flexpages.">L4_CAP_FPAGE_W</a> permissions of the capability used. The replaced label is only visible to the thread the IPC gate is bound to upon receive (or to the selected thread from the thread group the IPC gate is bound to). However, the configured label of an IPC gate can also be queried via <a class="el" href="group__l4__kernel__object__gate__api.html#ga129986b9fdb9821c9458e99703f722a2" title="Get information about the IPC-gate.">l4_ipc_gate_get_infos()</a> if the capability used has the <a class="el" href="group__l4__msgitem__api.html#ggad142e99a533af52d358f9940fa00966aa8436980325edd409d8aa71e1ef567bc4" title="The receiver may invoke IPC-gate-specific functions on the capability, e.g.">L4_FPAGE_C_IPCGATE_SVR</a> permission.</p>
<p>When deleting an IPC gate or when unbinding it from a thread or thread group, the label of IPC already in flight won't be changed. To ensure that no IPC from this IPC gate is received by a thread with an unexpected label, <a class="el" href="group__l4__thread__api.html#ga06ff88cfe27ad4f6c67fa0dc36e6c261" title="Start a thread sender modification sequence.">l4_thread_modify_sender_start()</a> shall be used to change the labels of every pending IPC to that gate. This is also required if the label of an already bound IPC gate is changed. It is not necessary after binding the IPC gate to a thread or thread group for the first time.</p>
<p>When binding a currently bound IPC gate to a new thread or thread group, the same label should be used that was used with the old thread. Otherwise the old and the new thread need to synchronize to avoid IPC messages with unexpected labels.</p>
<dl class="section user"><dt>Include File</dt><dd><div class="fragment"><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="ipc__gate_8h.html">l4/sys/ipc_gate.h</a>&gt;</span> </div>
<div class="ttc" id="aipc__gate_8h_html"><div class="ttname"><a href="ipc__gate_8h.html">ipc_gate.h</a></div><div class="ttdoc">The C IPC gate interface, see L4::Ipc_gate for the C++ interface.</div></div>
</div><!-- fragment --></dd></dl>
<p>For the C++ interface refer to the <a class="el" href="classL4_1_1Ipc__gate.html" title="The C++ IPC gate interface, see IPC-Gate API for the C interface.">L4::Ipc_gate</a> documentation.</p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group__l4__ipc__api.html">Object Invocation</a> </dd></dl>
<p class="definition">Definition in file <a class="el" href="ipc__gate_8h_source.html">ipc_gate.h</a>.</p>
</div></div><!-- contents -->
</div><!-- doc-content -->
<div id="page-nav" class="page-nav-panel">
<div id="page-nav-resize-handle"></div>
<div id="page-nav-tree">
<div id="page-nav-contents">
</div><!-- page-nav-contents -->
</div><!-- page-nav-tree -->
</div><!-- page-nav -->
</div><!-- container -->
<!-- HTML footer for doxygen 1.9.1-->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><b>l4</b></li><li class="navelem"><b>sys</b></li><li class="navelem"><a href="ipc__gate_8h.html">ipc_gate.h</a></li>
<li class="footer">Generated on <span class="timestamp"></span> for L4Re Operating System Framework by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.15.0 </li>
</ul>
</div>
</body>
</html>