Commit f68a0208 authored by Philippe Gerum's avatar Philippe Gerum

doc: build

parent d99e3f21
......@@ -3474,7 +3474,7 @@ CC = $(shell $(CONFIG_CMD) --cc)</code></pre>
<div id="footnotes"><hr /></div>
<div id="footer">
<div id="footer-text">
Last updated 2017-02-15 15:31:41 CET
Last updated 2017-04-02 16:42:05 CEST
</div>
</div>
</body>
......
......@@ -850,7 +850,7 @@ package is called <em>valgrind-devel</em> on Fedora.</td>
<div id="footnotes"><hr /></div>
<div id="footer">
<div id="footer-text">
Last updated 2017-02-15 15:31:41 CET
Last updated 2017-04-02 16:42:05 CEST
</div>
</div>
</body>
......
......@@ -2027,7 +2027,7 @@ Xenomai 3.x, you should have a look at
<div id="footnotes"><hr /></div>
<div id="footer">
<div id="footer-text">
Last updated 2017-02-15 15:31:41 CET
Last updated 2017-04-02 16:42:05 CEST
</div>
</div>
</body>
......
......@@ -1486,7 +1486,7 @@ allocation requests.</p></div>
<div id="footnotes"><hr /></div>
<div id="footer">
<div id="footer-text">
Last updated 2017-02-15 15:31:41 CET
Last updated 2017-04-02 16:42:05 CEST
</div>
</div>
</body>
......
......@@ -775,7 +775,7 @@ way to gain those capabilities.</p></div>
<div id="footnotes"><hr /></div>
<div id="footer">
<div id="footer-text">
Last updated 2017-02-15 15:31:41 CET
Last updated 2017-04-02 16:42:05 CEST
</div>
</div>
</body>
......
......@@ -755,7 +755,7 @@ XENO-CONFIG(1) Manual Page
<div class="paragraph"><p><strong>xeno-config</strong> <strong>--info</strong></p></div>
<div class="paragraph"><p><strong>xeno-config</strong> <strong>--core</strong></p></div>
<div class="paragraph"><p><strong>xeno-config</strong> <strong>--version</strong></p></div>
<div class="paragraph"><p><strong>xeno-config</strong> [<strong>--cc</strong>] [<strong>--ccld</strong>] [<strong>--arch</strong>] [<strong>--prefix</strong>] [<strong>--posix|alchemy|rtdm|psos|vxworks|smokey</strong>] [<strong>--compat</strong>] [<strong>--auto-init</strong>|<strong>no-auto-init</strong>] [<strong>--auto-init-solib</strong>] [<strong>--cflags</strong>] [<strong>--ldflags</strong>] [<strong>--library-dir</strong>|<strong>--libdir</strong>|<strong>--user-libdir</strong>]</p></div>
<div class="paragraph"><p><strong>xeno-config</strong> [<strong>--cc</strong>] [<strong>--ccld</strong>] [<strong>--arch</strong>] [<strong>--prefix</strong>] [<strong>--posix|alchemy|rtdm|psos|vxworks|smokey</strong>] [<strong>--compat</strong>] [<strong>--auto-init</strong>|<strong>no-auto-init</strong>] [<strong>--auto-init-solib</strong>] [<strong>--mode-check</strong>|<strong>no-mode-check</strong>] [<strong>--cflags</strong>] [<strong>--ldflags</strong>] [<strong>--library-dir</strong>|<strong>libdir</strong>|<strong>user-libdir</strong>]</p></div>
</div>
</div>
<div class="sect1">
......@@ -929,6 +929,28 @@ only. <strong>xeno-config</strong> enables the Copperplate auto-init feature by
default.</p></div>
<div class="dlist"><dl>
<dt class="hdlist1">
<strong>--mode-check</strong>
</dt>
<dt class="hdlist1">
<strong>--no-mode-check</strong>
</dt>
<dd>
<p>
Over Cobalt, a set of standard routines which may invoke regular Linux
system calls can trigger an assertion failure on entry, if the caller
must leave the real-time mode (aka "secondary mode switch") to execute
such routine.
</p>
</dd>
</dl></div>
<div class="paragraph"><p>The assertion failure is triggered if the calling thread has set the
PTHREAD_WARNSW flag by a call to <code>pthread_setmode_np()</code>.</p></div>
<div class="paragraph"><p>By default, the mode checking routines are substituted to the original
ones using the symbol wrapping mechanism also used for interposing on
POSIX services. <strong>--no-mode-check</strong> disables such substitution.</p></div>
<div class="paragraph"><p>These flags make sense when passed along with --ldflags only.</p></div>
<div class="dlist"><dl>
<dt class="hdlist1">
<strong>--auto-init-solib</strong>
</dt>
<dd>
......@@ -943,7 +965,7 @@ used for bootstrapping the initialization.
<div class="paragraph"><p>The bootstrap code runs when the shared library is attached to a
running executable, either because it appears in the static
dependencies of this executable, or when loaded dynamically via the
dlopen() interface.</p></div>
<code>dlopen()</code> interface.</p></div>
<div class="dlist"><dl>
<dt class="hdlist1">
<strong>--core</strong>
......@@ -1045,7 +1067,7 @@ Error.
<div id="footnotes"><hr /></div>
<div id="footer">
<div id="footer-text">
Last updated 2016-12-16 10:06:33 CET
Last updated 2017-04-02 10:22:34 CEST
</div>
</div>
</body>
......
......@@ -154,7 +154,7 @@ $(document).ready(function(){initNavTree('driver_8h_source.html','');});
<div class="ttc" id="group__rtdm__task_html_gae52cca97ebaf78eec2e31553a4dacd5e"><div class="ttname"><a href="group__rtdm__task.html#gae52cca97ebaf78eec2e31553a4dacd5e">rtdm_task_unblock</a></div><div class="ttdeci">int rtdm_task_unblock(rtdm_task_t *task)</div><div class="ttdoc">Activate a blocked real-time task. </div></div>
<div class="ttc" id="structrtdm__dev__context_html_a8fea6f19169a166aa183d2e9da09df51"><div class="ttname"><a href="structrtdm__dev__context.html#a8fea6f19169a166aa183d2e9da09df51">rtdm_dev_context::device</a></div><div class="ttdeci">struct rtdm_device * device</div><div class="ttdoc">Set of active device operation handlers. </div><div class="ttdef"><b>Definition:</b> driver.h:141</div></div>
<div class="ttc" id="group__rtdm__sync__event_html_ga1217402b82034b26fe25c26f1e5b32c9"><div class="ttname"><a href="group__rtdm__sync__event.html#ga1217402b82034b26fe25c26f1e5b32c9">rtdm_event_signal</a></div><div class="ttdeci">void rtdm_event_signal(rtdm_event_t *event)</div><div class="ttdoc">Signal an event occurrence. </div><div class="ttdef"><b>Definition:</b> drvlib.c:783</div></div>
<div class="ttc" id="group__cobalt__core__synch_html_ga51cec970cb57608abe882c98bee72347"><div class="ttname"><a href="group__cobalt__core__synch.html#ga51cec970cb57608abe882c98bee72347">xnsynch_sleep_on</a></div><div class="ttdeci">int xnsynch_sleep_on(struct xnsynch *synch, xnticks_t timeout, xntmode_t timeout_mode)</div><div class="ttdoc">Sleep on an ownerless synchronization object. </div><div class="ttdef"><b>Definition:</b> synch.c:162</div></div>
<div class="ttc" id="group__cobalt__core__synch_html_ga51cec970cb57608abe882c98bee72347"><div class="ttname"><a href="group__cobalt__core__synch.html#ga51cec970cb57608abe882c98bee72347">xnsynch_sleep_on</a></div><div class="ttdeci">int __must_check xnsynch_sleep_on(struct xnsynch *synch, xnticks_t timeout, xntmode_t timeout_mode)</div><div class="ttdoc">Sleep on an ownerless synchronization object. </div><div class="ttdef"><b>Definition:</b> synch.c:162</div></div>
<div class="ttc" id="group__rtdm__sync__mutex_html_ga8d58a144bf71df7b38bb887d036cbbb5"><div class="ttname"><a href="group__rtdm__sync__mutex.html#ga8d58a144bf71df7b38bb887d036cbbb5">rtdm_mutex_init</a></div><div class="ttdeci">void rtdm_mutex_init(rtdm_mutex_t *mutex)</div><div class="ttdoc">Initialise a mutex. </div><div class="ttdef"><b>Definition:</b> drvlib.c:1241</div></div>
<div class="ttc" id="group__rtdm__clock_html_ga861a79090031b981c627107248cf2d14"><div class="ttname"><a href="group__rtdm__clock.html#ga861a79090031b981c627107248cf2d14">rtdm_clock_read_monotonic</a></div><div class="ttdeci">nanosecs_abs_t rtdm_clock_read_monotonic(void)</div><div class="ttdoc">Get monotonic time. </div></div>
<div class="ttc" id="group__rtdm__util_html_gab42031be84dba5825ac90dbf28606c54"><div class="ttname"><a href="group__rtdm__util.html#gab42031be84dba5825ac90dbf28606c54">rtdm_rt_capable</a></div><div class="ttdeci">int rtdm_rt_capable(struct rtdm_fd *fd)</div><div class="ttdoc">Test if the caller is capable of running in real-time context. </div></div>
......
......@@ -92,7 +92,7 @@ Functions</h2></td></tr>
<tr class="memitem:gadd862461f55506485f04f4f98cdb6fb8"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__cobalt__core__synch.html#gadd862461f55506485f04f4f98cdb6fb8">xnsynch_destroy</a> (struct xnsynch *synch)</td></tr>
<tr class="memdesc:gadd862461f55506485f04f4f98cdb6fb8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Destroy a synchronization object. <a href="#gadd862461f55506485f04f4f98cdb6fb8">More...</a><br /></td></tr>
<tr class="separator:gadd862461f55506485f04f4f98cdb6fb8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga51cec970cb57608abe882c98bee72347"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__cobalt__core__synch.html#ga51cec970cb57608abe882c98bee72347">xnsynch_sleep_on</a> (struct xnsynch *synch, xnticks_t timeout, xntmode_t timeout_mode)</td></tr>
<tr class="memitem:ga51cec970cb57608abe882c98bee72347"><td class="memItemLeft" align="right" valign="top">int __must_check&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__cobalt__core__synch.html#ga51cec970cb57608abe882c98bee72347">xnsynch_sleep_on</a> (struct xnsynch *synch, xnticks_t timeout, xntmode_t timeout_mode)</td></tr>
<tr class="memdesc:ga51cec970cb57608abe882c98bee72347"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sleep on an ownerless synchronization object. <a href="#ga51cec970cb57608abe882c98bee72347">More...</a><br /></td></tr>
<tr class="separator:ga51cec970cb57608abe882c98bee72347"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga54162964059c62d7a7b45ef22911662f"><td class="memItemLeft" align="right" valign="top">struct xnthread *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__cobalt__core__synch.html#ga54162964059c62d7a7b45ef22911662f">xnsynch_wakeup_one_sleeper</a> (struct xnsynch *synch)</td></tr>
......@@ -101,10 +101,10 @@ Functions</h2></td></tr>
<tr class="memitem:ga8096364cd5d717dae816c74dcc05a8ac"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__cobalt__core__synch.html#ga8096364cd5d717dae816c74dcc05a8ac">xnsynch_wakeup_this_sleeper</a> (struct xnsynch *synch, struct xnthread *sleeper)</td></tr>
<tr class="memdesc:ga8096364cd5d717dae816c74dcc05a8ac"><td class="mdescLeft">&#160;</td><td class="mdescRight">Unblock a particular thread from wait. <a href="#ga8096364cd5d717dae816c74dcc05a8ac">More...</a><br /></td></tr>
<tr class="separator:ga8096364cd5d717dae816c74dcc05a8ac"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga43fa3ecdc81f6ae157f840175c7ea091"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__cobalt__core__synch.html#ga43fa3ecdc81f6ae157f840175c7ea091">xnsynch_acquire</a> (struct xnsynch *synch, xnticks_t timeout, xntmode_t timeout_mode)</td></tr>
<tr class="memitem:ga43fa3ecdc81f6ae157f840175c7ea091"><td class="memItemLeft" align="right" valign="top">int __must_check&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__cobalt__core__synch.html#ga43fa3ecdc81f6ae157f840175c7ea091">xnsynch_acquire</a> (struct xnsynch *synch, xnticks_t timeout, xntmode_t timeout_mode)</td></tr>
<tr class="memdesc:ga43fa3ecdc81f6ae157f840175c7ea091"><td class="mdescLeft">&#160;</td><td class="mdescRight">Acquire the ownership of a synchronization object. <a href="#ga43fa3ecdc81f6ae157f840175c7ea091">More...</a><br /></td></tr>
<tr class="separator:ga43fa3ecdc81f6ae157f840175c7ea091"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gad5cad7eeaa18834c9ba8843511a67628"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__cobalt__core__synch.html#gad5cad7eeaa18834c9ba8843511a67628">xnsynch_try_acquire</a> (struct xnsynch *synch)</td></tr>
<tr class="memitem:gad5cad7eeaa18834c9ba8843511a67628"><td class="memItemLeft" align="right" valign="top">int __must_check&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__cobalt__core__synch.html#gad5cad7eeaa18834c9ba8843511a67628">xnsynch_try_acquire</a> (struct xnsynch *synch)</td></tr>
<tr class="memdesc:gad5cad7eeaa18834c9ba8843511a67628"><td class="mdescLeft">&#160;</td><td class="mdescRight">Try acquiring the ownership of a synchronization object. <a href="#gad5cad7eeaa18834c9ba8843511a67628">More...</a><br /></td></tr>
<tr class="separator:gad5cad7eeaa18834c9ba8843511a67628"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gad38fe2be85e02bf1298418674ab6386f"><td class="memItemLeft" align="right" valign="top">struct xnthread *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__cobalt__core__synch.html#gad38fe2be85e02bf1298418674ab6386f">xnsynch_release</a> (struct xnsynch *synch, struct xnthread *thread)</td></tr>
......
......@@ -72,7 +72,7 @@ $(document).ready(function(){initNavTree('kernel_2drivers_2ipc_2internal_8h_sour
<div class="title">internal.h</div> </div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span>&#160;</div><div class="line"><a name="l00020"></a><span class="lineno"> 20</span>&#160;<span class="preprocessor">#ifndef _RTIPC_INTERNAL_H</span></div><div class="line"><a name="l00021"></a><span class="lineno"> 21</span>&#160;<span class="preprocessor">#define _RTIPC_INTERNAL_H</span></div><div class="line"><a name="l00022"></a><span class="lineno"> 22</span>&#160;</div><div class="line"><a name="l00023"></a><span class="lineno"> 23</span>&#160;<span class="preprocessor">#include &lt;cobalt/kernel/registry.h&gt;</span></div><div class="line"><a name="l00024"></a><span class="lineno"> 24</span>&#160;<span class="preprocessor">#include &lt;cobalt/kernel/clock.h&gt;</span></div><div class="line"><a name="l00025"></a><span class="lineno"> 25</span>&#160;<span class="preprocessor">#include &lt;cobalt/kernel/select.h&gt;</span></div><div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160;<span class="preprocessor">#include &lt;rtdm/rtdm.h&gt;</span></div><div class="line"><a name="l00027"></a><span class="lineno"> 27</span>&#160;<span class="preprocessor">#include &lt;rtdm/compat.h&gt;</span></div><div class="line"><a name="l00028"></a><span class="lineno"> 28</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="driver_8h.html">rtdm/driver.h</a>&gt;</span></div><div class="line"><a name="l00029"></a><span class="lineno"> 29</span>&#160;</div><div class="line"><a name="l00030"></a><span class="lineno"> 30</span>&#160;<span class="preprocessor">#define RTIPC_IOV_MAX 64</span></div><div class="line"><a name="l00031"></a><span class="lineno"> 31</span>&#160;</div><div class="line"><a name="l00032"></a><span class="lineno"> 32</span>&#160;<span class="keyword">struct </span>rtipc_protocol;</div><div class="line"><a name="l00033"></a><span class="lineno"> 33</span>&#160;</div><div class="line"><a name="l00034"></a><span class="lineno"> 34</span>&#160;<span class="keyword">struct </span>rtipc_private {</div><div class="line"><a name="l00035"></a><span class="lineno"> 35</span>&#160; <span class="keyword">struct </span>rtipc_protocol *proto;</div><div class="line"><a name="l00036"></a><span class="lineno"> 36</span>&#160; DECLARE_XNSELECT(send_block);</div><div class="line"><a name="l00037"></a><span class="lineno"> 37</span>&#160; DECLARE_XNSELECT(recv_block);</div><div class="line"><a name="l00038"></a><span class="lineno"> 38</span>&#160; <span class="keywordtype">void</span> *state;</div><div class="line"><a name="l00039"></a><span class="lineno"> 39</span>&#160;};</div><div class="line"><a name="l00040"></a><span class="lineno"> 40</span>&#160;</div><div class="line"><a name="l00041"></a><span class="lineno"> 41</span>&#160;<span class="keyword">struct </span>rtipc_protocol {</div><div class="line"><a name="l00042"></a><span class="lineno"> 42</span>&#160; <span class="keyword">const</span> <span class="keywordtype">char</span> *proto_name;</div><div class="line"><a name="l00043"></a><span class="lineno"> 43</span>&#160; <span class="keywordtype">int</span> proto_statesz;</div><div class="line"><a name="l00044"></a><span class="lineno"> 44</span>&#160; int (*proto_init)(void);</div><div class="line"><a name="l00045"></a><span class="lineno"> 45</span>&#160; void (*proto_exit)(void);</div><div class="line"><a name="l00046"></a><span class="lineno"> 46</span>&#160; <span class="keyword">struct </span>{</div><div class="line"><a name="l00047"></a><span class="lineno"> 47</span>&#160; int (*socket)(<span class="keyword">struct </span>rtdm_fd *fd);</div><div class="line"><a name="l00048"></a><span class="lineno"> 48</span>&#160; void (*close)(<span class="keyword">struct </span>rtdm_fd *fd);</div><div class="line"><a name="l00049"></a><span class="lineno"> 49</span>&#160; ssize_t (*recvmsg)(<span class="keyword">struct </span>rtdm_fd *fd,</div><div class="line"><a name="l00050"></a><span class="lineno"> 50</span>&#160; <span class="keyword">struct </span>user_msghdr *msg, <span class="keywordtype">int</span> flags);</div><div class="line"><a name="l00051"></a><span class="lineno"> 51</span>&#160; ssize_t (*sendmsg)(<span class="keyword">struct </span>rtdm_fd *fd,</div><div class="line"><a name="l00052"></a><span class="lineno"> 52</span>&#160; <span class="keyword">const</span> <span class="keyword">struct </span>user_msghdr *msg, <span class="keywordtype">int</span> flags);</div><div class="line"><a name="l00053"></a><span class="lineno"> 53</span>&#160; ssize_t (*read)(<span class="keyword">struct </span>rtdm_fd *fd,</div><div class="line"><a name="l00054"></a><span class="lineno"> 54</span>&#160; <span class="keywordtype">void</span> *buf, <span class="keywordtype">size_t</span> len);</div><div class="line"><a name="l00055"></a><span class="lineno"> 55</span>&#160; ssize_t (*write)(<span class="keyword">struct </span>rtdm_fd *fd,</div><div class="line"><a name="l00056"></a><span class="lineno"> 56</span>&#160; <span class="keyword">const</span> <span class="keywordtype">void</span> *buf, <span class="keywordtype">size_t</span> len);</div><div class="line"><a name="l00057"></a><span class="lineno"> 57</span>&#160; int (*ioctl)(<span class="keyword">struct </span>rtdm_fd *fd,</div><div class="line"><a name="l00058"></a><span class="lineno"> 58</span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> request, <span class="keywordtype">void</span> *arg);</div><div class="line"><a name="l00059"></a><span class="lineno"> 59</span>&#160; <span class="keywordtype">unsigned</span> int (*pollstate)(<span class="keyword">struct </span>rtdm_fd *fd);</div><div class="line"><a name="l00060"></a><span class="lineno"> 60</span>&#160; } proto_ops;</div><div class="line"><a name="l00061"></a><span class="lineno"> 61</span>&#160;};</div><div class="line"><a name="l00062"></a><span class="lineno"> 62</span>&#160;</div><div class="line"><a name="l00063"></a><span class="lineno"> 63</span>&#160;<span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> *rtipc_fd_to_state(<span class="keyword">struct</span> rtdm_fd *fd)</div><div class="line"><a name="l00064"></a><span class="lineno"> 64</span>&#160;{</div><div class="line"><a name="l00065"></a><span class="lineno"> 65</span>&#160; <span class="keyword">struct </span>rtipc_private *p = <a class="code" href="driver_8h.html#aa1aec6568a871126146498a32549c609">rtdm_fd_to_private</a>(fd);</div><div class="line"><a name="l00066"></a><span class="lineno"> 66</span>&#160; <span class="keywordflow">return</span> p-&gt;state;</div><div class="line"><a name="l00067"></a><span class="lineno"> 67</span>&#160;}</div><div class="line"><a name="l00068"></a><span class="lineno"> 68</span>&#160;</div><div class="line"><a name="l00069"></a><span class="lineno"> 69</span>&#160;<span class="keyword">static</span> <span class="keyword">inline</span> <a class="code" href="group__rtdm.html#gaededf91e760e3268235351dcc9d9dcda">nanosecs_rel_t</a> rtipc_timeval_to_ns(<span class="keyword">const</span> <span class="keyword">struct</span> timeval *tv)</div><div class="line"><a name="l00070"></a><span class="lineno"> 70</span>&#160;{</div><div class="line"><a name="l00071"></a><span class="lineno"> 71</span>&#160; <a class="code" href="group__rtdm.html#gaededf91e760e3268235351dcc9d9dcda">nanosecs_rel_t</a> ns = tv-&gt;tv_usec * 1000;</div><div class="line"><a name="l00072"></a><span class="lineno"> 72</span>&#160;</div><div class="line"><a name="l00073"></a><span class="lineno"> 73</span>&#160; <span class="keywordflow">if</span> (tv-&gt;tv_sec)</div><div class="line"><a name="l00074"></a><span class="lineno"> 74</span>&#160; ns += (<a class="code" href="group__rtdm.html#gaededf91e760e3268235351dcc9d9dcda">nanosecs_rel_t</a>)tv-&gt;tv_sec * 1000000000UL;</div><div class="line"><a name="l00075"></a><span class="lineno"> 75</span>&#160;</div><div class="line"><a name="l00076"></a><span class="lineno"> 76</span>&#160; <span class="keywordflow">return</span> ns;</div><div class="line"><a name="l00077"></a><span class="lineno"> 77</span>&#160;}</div><div class="line"><a name="l00078"></a><span class="lineno"> 78</span>&#160;</div><div class="line"><a name="l00079"></a><span class="lineno"> 79</span>&#160;<span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> rtipc_ns_to_timeval(<span class="keyword">struct</span> timeval *tv, <a class="code" href="group__rtdm.html#gaededf91e760e3268235351dcc9d9dcda">nanosecs_rel_t</a> ns)</div><div class="line"><a name="l00080"></a><span class="lineno"> 80</span>&#160;{</div><div class="line"><a name="l00081"></a><span class="lineno"> 81</span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> nsecs;</div><div class="line"><a name="l00082"></a><span class="lineno"> 82</span>&#160;</div><div class="line"><a name="l00083"></a><span class="lineno"> 83</span>&#160; tv-&gt;tv_sec = xnclock_divrem_billion(ns, &amp;nsecs);</div><div class="line"><a name="l00084"></a><span class="lineno"> 84</span>&#160; tv-&gt;tv_usec = nsecs / 1000;</div><div class="line"><a name="l00085"></a><span class="lineno"> 85</span>&#160;}</div><div class="line"><a name="l00086"></a><span class="lineno"> 86</span>&#160;</div><div class="line"><a name="l00087"></a><span class="lineno"> 87</span>&#160;<span class="keywordtype">int</span> rtipc_get_iovec(<span class="keyword">struct</span> rtdm_fd *fd, <span class="keyword">struct</span> iovec *iov,</div><div class="line"><a name="l00088"></a><span class="lineno"> 88</span>&#160; <span class="keyword">const</span> <span class="keyword">struct</span> user_msghdr *msg);</div><div class="line"><a name="l00089"></a><span class="lineno"> 89</span>&#160;</div><div class="line"><a name="l00090"></a><span class="lineno"> 90</span>&#160;<span class="keywordtype">int</span> rtipc_put_iovec(<span class="keyword">struct</span> rtdm_fd *fd, <span class="keyword">const</span> <span class="keyword">struct</span> iovec *iov,</div><div class="line"><a name="l00091"></a><span class="lineno"> 91</span>&#160; <span class="keyword">const</span> <span class="keyword">struct</span> user_msghdr *msg);</div><div class="line"><a name="l00092"></a><span class="lineno"> 92</span>&#160;</div><div class="line"><a name="l00093"></a><span class="lineno"> 93</span>&#160;<span class="keywordtype">int</span> rtipc_get_sockaddr(<span class="keyword">struct</span> rtdm_fd *fd,</div><div class="line"><a name="l00094"></a><span class="lineno"> 94</span>&#160; <span class="keyword">struct</span> <a class="code" href="structsockaddr__ipc.html">sockaddr_ipc</a> **saddrp,</div><div class="line"><a name="l00095"></a><span class="lineno"> 95</span>&#160; <span class="keyword">const</span> <span class="keywordtype">void</span> *arg);</div><div class="line"><a name="l00096"></a><span class="lineno"> 96</span>&#160;</div><div class="line"><a name="l00097"></a><span class="lineno"> 97</span>&#160;<span class="keywordtype">int</span> rtipc_put_sockaddr(<span class="keyword">struct</span> rtdm_fd *fd, <span class="keywordtype">void</span> *arg,</div><div class="line"><a name="l00098"></a><span class="lineno"> 98</span>&#160; <span class="keyword">const</span> <span class="keyword">struct</span> <a class="code" href="structsockaddr__ipc.html">sockaddr_ipc</a> *saddr);</div><div class="line"><a name="l00099"></a><span class="lineno"> 99</span>&#160;</div><div class="line"><a name="l00100"></a><span class="lineno"> 100</span>&#160;<span class="keywordtype">int</span> rtipc_get_sockoptout(<span class="keyword">struct</span> rtdm_fd *fd,</div><div class="line"><a name="l00101"></a><span class="lineno"> 101</span>&#160; <span class="keyword">struct</span> _rtdm_getsockopt_args *sopt,</div><div class="line"><a name="l00102"></a><span class="lineno"> 102</span>&#160; <span class="keyword">const</span> <span class="keywordtype">void</span> *arg);</div><div class="line"><a name="l00103"></a><span class="lineno"> 103</span>&#160;</div><div class="line"><a name="l00104"></a><span class="lineno"> 104</span>&#160;<span class="keywordtype">int</span> rtipc_put_sockoptout(<span class="keyword">struct</span> rtdm_fd *fd, <span class="keywordtype">void</span> *arg,</div><div class="line"><a name="l00105"></a><span class="lineno"> 105</span>&#160; <span class="keyword">const</span> <span class="keyword">struct</span> _rtdm_getsockopt_args *sopt);</div><div class="line"><a name="l00106"></a><span class="lineno"> 106</span>&#160;</div><div class="line"><a name="l00107"></a><span class="lineno"> 107</span>&#160;<span class="keywordtype">int</span> rtipc_get_sockoptin(<span class="keyword">struct</span> rtdm_fd *fd,</div><div class="line"><a name="l00108"></a><span class="lineno"> 108</span>&#160; <span class="keyword">struct</span> _rtdm_setsockopt_args *sopt,</div><div class="line"><a name="l00109"></a><span class="lineno"> 109</span>&#160; <span class="keyword">const</span> <span class="keywordtype">void</span> *arg);</div><div class="line"><a name="l00110"></a><span class="lineno"> 110</span>&#160;</div><div class="line"><a name="l00111"></a><span class="lineno"> 111</span>&#160;<span class="keywordtype">int</span> rtipc_get_timeval(<span class="keyword">struct</span> rtdm_fd *fd, <span class="keyword">struct</span> timeval *tv,</div><div class="line"><a name="l00112"></a><span class="lineno"> 112</span>&#160; <span class="keyword">const</span> <span class="keywordtype">void</span> *arg, <span class="keywordtype">size_t</span> arglen);</div><div class="line"><a name="l00113"></a><span class="lineno"> 113</span>&#160;</div><div class="line"><a name="l00114"></a><span class="lineno"> 114</span>&#160;<span class="keywordtype">int</span> rtipc_put_timeval(<span class="keyword">struct</span> rtdm_fd *fd, <span class="keywordtype">void</span> *arg,</div><div class="line"><a name="l00115"></a><span class="lineno"> 115</span>&#160; <span class="keyword">const</span> <span class="keyword">struct</span> timeval *tv, <span class="keywordtype">size_t</span> arglen);</div><div class="line"><a name="l00116"></a><span class="lineno"> 116</span>&#160;</div><div class="line"><a name="l00117"></a><span class="lineno"> 117</span>&#160;<span class="keywordtype">int</span> rtipc_get_length(<span class="keyword">struct</span> rtdm_fd *fd, <span class="keywordtype">size_t</span> *lenp,</div><div class="line"><a name="l00118"></a><span class="lineno"> 118</span>&#160; <span class="keyword">const</span> <span class="keywordtype">void</span> *arg, <span class="keywordtype">size_t</span> arglen);</div><div class="line"><a name="l00119"></a><span class="lineno"> 119</span>&#160;</div><div class="line"><a name="l00120"></a><span class="lineno"> 120</span>&#160;<span class="keywordtype">int</span> rtipc_get_arg(<span class="keyword">struct</span> rtdm_fd *fd, <span class="keywordtype">void</span> *dst, <span class="keyword">const</span> <span class="keywordtype">void</span> *src,</div><div class="line"><a name="l00121"></a><span class="lineno"> 121</span>&#160; <span class="keywordtype">size_t</span> len);</div><div class="line"><a name="l00122"></a><span class="lineno"> 122</span>&#160;</div><div class="line"><a name="l00123"></a><span class="lineno"> 123</span>&#160;<span class="keywordtype">int</span> rtipc_put_arg(<span class="keyword">struct</span> rtdm_fd *fd, <span class="keywordtype">void</span> *dst, <span class="keyword">const</span> <span class="keywordtype">void</span> *src,</div><div class="line"><a name="l00124"></a><span class="lineno"> 124</span>&#160; <span class="keywordtype">size_t</span> len);</div><div class="line"><a name="l00125"></a><span class="lineno"> 125</span>&#160;</div><div class="line"><a name="l00126"></a><span class="lineno"> 126</span>&#160;ssize_t rtipc_get_iov_flatlen(<span class="keyword">struct</span> iovec *iov, <span class="keywordtype">int</span> iovlen);</div><div class="line"><a name="l00127"></a><span class="lineno"> 127</span>&#160;</div><div class="line"><a name="l00128"></a><span class="lineno"> 128</span>&#160;<span class="keyword">extern</span> <span class="keyword">struct </span>rtipc_protocol xddp_proto_driver;</div><div class="line"><a name="l00129"></a><span class="lineno"> 129</span>&#160;</div><div class="line"><a name="l00130"></a><span class="lineno"> 130</span>&#160;<span class="keyword">extern</span> <span class="keyword">struct </span>rtipc_protocol iddp_proto_driver;</div><div class="line"><a name="l00131"></a><span class="lineno"> 131</span>&#160;</div><div class="line"><a name="l00132"></a><span class="lineno"> 132</span>&#160;<span class="keyword">extern</span> <span class="keyword">struct </span>rtipc_protocol bufp_proto_driver;</div><div class="line"><a name="l00133"></a><span class="lineno"> 133</span>&#160;</div><div class="line"><a name="l00134"></a><span class="lineno"> 134</span>&#160;<span class="keyword">extern</span> <span class="keyword">struct </span>xnptree rtipc_ptree;</div><div class="line"><a name="l00135"></a><span class="lineno"> 135</span>&#160;</div><div class="line"><a name="l00136"></a><span class="lineno"> 136</span>&#160;<span class="preprocessor">#define rtipc_wait_context xnthread_wait_context</span></div><div class="line"><a name="l00137"></a><span class="lineno"> 137</span>&#160;<span class="preprocessor">#define rtipc_prepare_wait xnthread_prepare_wait</span></div><div class="line"><a name="l00138"></a><span class="lineno"> 138</span>&#160;<span class="preprocessor">#define rtipc_get_wait_context xnthread_get_wait_context</span></div><div class="line"><a name="l00139"></a><span class="lineno"> 139</span>&#160;<span class="preprocessor">#define rtipc_peek_wait_head(obj) xnsynch_peek_pendq(&amp;(obj)-&gt;synch_base)</span></div><div class="line"><a name="l00140"></a><span class="lineno"> 140</span>&#160;</div><div class="line"><a name="l00141"></a><span class="lineno"> 141</span>&#160;<span class="preprocessor">#define COMPAT_CASE(__op) case __op __COMPAT_CASE(__op ## _COMPAT)</span></div><div class="line"><a name="l00142"></a><span class="lineno"> 142</span>&#160;</div><div class="line"><a name="l00143"></a><span class="lineno"> 143</span>&#160;<span class="preprocessor">#endif </span><span class="comment">/* !_RTIPC_INTERNAL_H */</span><span class="preprocessor"></span></div><div class="ttc" id="structsockaddr__ipc_html"><div class="ttname"><a href="structsockaddr__ipc.html">sockaddr_ipc</a></div><div class="ttdoc">Socket address structure for the RTIPC address family. </div><div class="ttdef"><b>Definition:</b> ipc.h:480</div></div>
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span>&#160;</div><div class="line"><a name="l00020"></a><span class="lineno"> 20</span>&#160;<span class="preprocessor">#ifndef _RTIPC_INTERNAL_H</span></div><div class="line"><a name="l00021"></a><span class="lineno"> 21</span>&#160;<span class="preprocessor">#define _RTIPC_INTERNAL_H</span></div><div class="line"><a name="l00022"></a><span class="lineno"> 22</span>&#160;</div><div class="line"><a name="l00023"></a><span class="lineno"> 23</span>&#160;<span class="preprocessor">#include &lt;linux/uio.h&gt;</span></div><div class="line"><a name="l00024"></a><span class="lineno"> 24</span>&#160;<span class="preprocessor">#include &lt;cobalt/kernel/registry.h&gt;</span></div><div class="line"><a name="l00025"></a><span class="lineno"> 25</span>&#160;<span class="preprocessor">#include &lt;cobalt/kernel/clock.h&gt;</span></div><div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160;<span class="preprocessor">#include &lt;cobalt/kernel/select.h&gt;</span></div><div class="line"><a name="l00027"></a><span class="lineno"> 27</span>&#160;<span class="preprocessor">#include &lt;rtdm/rtdm.h&gt;</span></div><div class="line"><a name="l00028"></a><span class="lineno"> 28</span>&#160;<span class="preprocessor">#include &lt;rtdm/compat.h&gt;</span></div><div class="line"><a name="l00029"></a><span class="lineno"> 29</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="driver_8h.html">rtdm/driver.h</a>&gt;</span></div><div class="line"><a name="l00030"></a><span class="lineno"> 30</span>&#160;</div><div class="line"><a name="l00031"></a><span class="lineno"> 31</span>&#160;<span class="preprocessor">#define RTIPC_IOV_FASTMAX 16</span></div><div class="line"><a name="l00032"></a><span class="lineno"> 32</span>&#160;</div><div class="line"><a name="l00033"></a><span class="lineno"> 33</span>&#160;<span class="keyword">struct </span>rtipc_protocol;</div><div class="line"><a name="l00034"></a><span class="lineno"> 34</span>&#160;</div><div class="line"><a name="l00035"></a><span class="lineno"> 35</span>&#160;<span class="keyword">struct </span>rtipc_private {</div><div class="line"><a name="l00036"></a><span class="lineno"> 36</span>&#160; <span class="keyword">struct </span>rtipc_protocol *proto;</div><div class="line"><a name="l00037"></a><span class="lineno"> 37</span>&#160; DECLARE_XNSELECT(send_block);</div><div class="line"><a name="l00038"></a><span class="lineno"> 38</span>&#160; DECLARE_XNSELECT(recv_block);</div><div class="line"><a name="l00039"></a><span class="lineno"> 39</span>&#160; <span class="keywordtype">void</span> *state;</div><div class="line"><a name="l00040"></a><span class="lineno"> 40</span>&#160;};</div><div class="line"><a name="l00041"></a><span class="lineno"> 41</span>&#160;</div><div class="line"><a name="l00042"></a><span class="lineno"> 42</span>&#160;<span class="keyword">struct </span>rtipc_protocol {</div><div class="line"><a name="l00043"></a><span class="lineno"> 43</span>&#160; <span class="keyword">const</span> <span class="keywordtype">char</span> *proto_name;</div><div class="line"><a name="l00044"></a><span class="lineno"> 44</span>&#160; <span class="keywordtype">int</span> proto_statesz;</div><div class="line"><a name="l00045"></a><span class="lineno"> 45</span>&#160; int (*proto_init)(void);</div><div class="line"><a name="l00046"></a><span class="lineno"> 46</span>&#160; void (*proto_exit)(void);</div><div class="line"><a name="l00047"></a><span class="lineno"> 47</span>&#160; <span class="keyword">struct </span>{</div><div class="line"><a name="l00048"></a><span class="lineno"> 48</span>&#160; int (*socket)(<span class="keyword">struct </span>rtdm_fd *fd);</div><div class="line"><a name="l00049"></a><span class="lineno"> 49</span>&#160; void (*close)(<span class="keyword">struct </span>rtdm_fd *fd);</div><div class="line"><a name="l00050"></a><span class="lineno"> 50</span>&#160; ssize_t (*recvmsg)(<span class="keyword">struct </span>rtdm_fd *fd,</div><div class="line"><a name="l00051"></a><span class="lineno"> 51</span>&#160; <span class="keyword">struct </span>user_msghdr *msg, <span class="keywordtype">int</span> flags);</div><div class="line"><a name="l00052"></a><span class="lineno"> 52</span>&#160; ssize_t (*sendmsg)(<span class="keyword">struct </span>rtdm_fd *fd,</div><div class="line"><a name="l00053"></a><span class="lineno"> 53</span>&#160; <span class="keyword">const</span> <span class="keyword">struct </span>user_msghdr *msg, <span class="keywordtype">int</span> flags);</div><div class="line"><a name="l00054"></a><span class="lineno"> 54</span>&#160; ssize_t (*read)(<span class="keyword">struct </span>rtdm_fd *fd,</div><div class="line"><a name="l00055"></a><span class="lineno"> 55</span>&#160; <span class="keywordtype">void</span> *buf, <span class="keywordtype">size_t</span> len);</div><div class="line"><a name="l00056"></a><span class="lineno"> 56</span>&#160; ssize_t (*write)(<span class="keyword">struct </span>rtdm_fd *fd,</div><div class="line"><a name="l00057"></a><span class="lineno"> 57</span>&#160; <span class="keyword">const</span> <span class="keywordtype">void</span> *buf, <span class="keywordtype">size_t</span> len);</div><div class="line"><a name="l00058"></a><span class="lineno"> 58</span>&#160; int (*ioctl)(<span class="keyword">struct </span>rtdm_fd *fd,</div><div class="line"><a name="l00059"></a><span class="lineno"> 59</span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> request, <span class="keywordtype">void</span> *arg);</div><div class="line"><a name="l00060"></a><span class="lineno"> 60</span>&#160; <span class="keywordtype">unsigned</span> int (*pollstate)(<span class="keyword">struct </span>rtdm_fd *fd);</div><div class="line"><a name="l00061"></a><span class="lineno"> 61</span>&#160; } proto_ops;</div><div class="line"><a name="l00062"></a><span class="lineno"> 62</span>&#160;};</div><div class="line"><a name="l00063"></a><span class="lineno"> 63</span>&#160;</div><div class="line"><a name="l00064"></a><span class="lineno"> 64</span>&#160;<span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> *rtipc_fd_to_state(<span class="keyword">struct</span> rtdm_fd *fd)</div><div class="line"><a name="l00065"></a><span class="lineno"> 65</span>&#160;{</div><div class="line"><a name="l00066"></a><span class="lineno"> 66</span>&#160; <span class="keyword">struct </span>rtipc_private *p = <a class="code" href="driver_8h.html#aa1aec6568a871126146498a32549c609">rtdm_fd_to_private</a>(fd);</div><div class="line"><a name="l00067"></a><span class="lineno"> 67</span>&#160; <span class="keywordflow">return</span> p-&gt;state;</div><div class="line"><a name="l00068"></a><span class="lineno"> 68</span>&#160;}</div><div class="line"><a name="l00069"></a><span class="lineno"> 69</span>&#160;</div><div class="line"><a name="l00070"></a><span class="lineno"> 70</span>&#160;<span class="keyword">static</span> <span class="keyword">inline</span> <a class="code" href="group__rtdm.html#gaededf91e760e3268235351dcc9d9dcda">nanosecs_rel_t</a> rtipc_timeval_to_ns(<span class="keyword">const</span> <span class="keyword">struct</span> timeval *tv)</div><div class="line"><a name="l00071"></a><span class="lineno"> 71</span>&#160;{</div><div class="line"><a name="l00072"></a><span class="lineno"> 72</span>&#160; <a class="code" href="group__rtdm.html#gaededf91e760e3268235351dcc9d9dcda">nanosecs_rel_t</a> ns = tv-&gt;tv_usec * 1000;</div><div class="line"><a name="l00073"></a><span class="lineno"> 73</span>&#160;</div><div class="line"><a name="l00074"></a><span class="lineno"> 74</span>&#160; <span class="keywordflow">if</span> (tv-&gt;tv_sec)</div><div class="line"><a name="l00075"></a><span class="lineno"> 75</span>&#160; ns += (<a class="code" href="group__rtdm.html#gaededf91e760e3268235351dcc9d9dcda">nanosecs_rel_t</a>)tv-&gt;tv_sec * 1000000000UL;</div><div class="line"><a name="l00076"></a><span class="lineno"> 76</span>&#160;</div><div class="line"><a name="l00077"></a><span class="lineno"> 77</span>&#160; <span class="keywordflow">return</span> ns;</div><div class="line"><a name="l00078"></a><span class="lineno"> 78</span>&#160;}</div><div class="line"><a name="l00079"></a><span class="lineno"> 79</span>&#160;</div><div class="line"><a name="l00080"></a><span class="lineno"> 80</span>&#160;<span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> rtipc_ns_to_timeval(<span class="keyword">struct</span> timeval *tv, <a class="code" href="group__rtdm.html#gaededf91e760e3268235351dcc9d9dcda">nanosecs_rel_t</a> ns)</div><div class="line"><a name="l00081"></a><span class="lineno"> 81</span>&#160;{</div><div class="line"><a name="l00082"></a><span class="lineno"> 82</span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> nsecs;</div><div class="line"><a name="l00083"></a><span class="lineno"> 83</span>&#160;</div><div class="line"><a name="l00084"></a><span class="lineno"> 84</span>&#160; tv-&gt;tv_sec = xnclock_divrem_billion(ns, &amp;nsecs);</div><div class="line"><a name="l00085"></a><span class="lineno"> 85</span>&#160; tv-&gt;tv_usec = nsecs / 1000;</div><div class="line"><a name="l00086"></a><span class="lineno"> 86</span>&#160;}</div><div class="line"><a name="l00087"></a><span class="lineno"> 87</span>&#160;</div><div class="line"><a name="l00088"></a><span class="lineno"> 88</span>&#160;<span class="keywordtype">int</span> rtipc_get_iovec(<span class="keyword">struct</span> rtdm_fd *fd, <span class="keyword">struct</span> iovec **iov,</div><div class="line"><a name="l00089"></a><span class="lineno"> 89</span>&#160; <span class="keyword">const</span> <span class="keyword">struct</span> user_msghdr *msg,</div><div class="line"><a name="l00090"></a><span class="lineno"> 90</span>&#160; <span class="keyword">struct</span> iovec *iov_fast);</div><div class="line"><a name="l00091"></a><span class="lineno"> 91</span>&#160;</div><div class="line"><a name="l00092"></a><span class="lineno"> 92</span>&#160;<span class="keywordtype">int</span> rtipc_put_iovec(<span class="keyword">struct</span> rtdm_fd *fd, <span class="keyword">struct</span> iovec *iov,</div><div class="line"><a name="l00093"></a><span class="lineno"> 93</span>&#160; <span class="keyword">const</span> <span class="keyword">struct</span> user_msghdr *msg,</div><div class="line"><a name="l00094"></a><span class="lineno"> 94</span>&#160; <span class="keyword">struct</span> iovec *iov_fast);</div><div class="line"><a name="l00095"></a><span class="lineno"> 95</span>&#160;</div><div class="line"><a name="l00096"></a><span class="lineno"> 96</span>&#160;<span class="keyword">static</span> <span class="keyword">inline</span></div><div class="line"><a name="l00097"></a><span class="lineno"> 97</span>&#160;<span class="keywordtype">void</span> rtipc_drop_iovec(<span class="keyword">struct</span> iovec *iov, <span class="keyword">struct</span> iovec *iov_fast)</div><div class="line"><a name="l00098"></a><span class="lineno"> 98</span>&#160;{</div><div class="line"><a name="l00099"></a><span class="lineno"> 99</span>&#160; <span class="keywordflow">if</span> (iov != iov_fast)</div><div class="line"><a name="l00100"></a><span class="lineno"> 100</span>&#160; xnfree(iov);</div><div class="line"><a name="l00101"></a><span class="lineno"> 101</span>&#160;}</div><div class="line"><a name="l00102"></a><span class="lineno"> 102</span>&#160;</div><div class="line"><a name="l00103"></a><span class="lineno"> 103</span>&#160;<span class="keywordtype">int</span> rtipc_get_sockaddr(<span class="keyword">struct</span> rtdm_fd *fd,</div><div class="line"><a name="l00104"></a><span class="lineno"> 104</span>&#160; <span class="keyword">struct</span> <a class="code" href="structsockaddr__ipc.html">sockaddr_ipc</a> **saddrp,</div><div class="line"><a name="l00105"></a><span class="lineno"> 105</span>&#160; <span class="keyword">const</span> <span class="keywordtype">void</span> *arg);</div><div class="line"><a name="l00106"></a><span class="lineno"> 106</span>&#160;</div><div class="line"><a name="l00107"></a><span class="lineno"> 107</span>&#160;<span class="keywordtype">int</span> rtipc_put_sockaddr(<span class="keyword">struct</span> rtdm_fd *fd, <span class="keywordtype">void</span> *arg,</div><div class="line"><a name="l00108"></a><span class="lineno"> 108</span>&#160; <span class="keyword">const</span> <span class="keyword">struct</span> <a class="code" href="structsockaddr__ipc.html">sockaddr_ipc</a> *saddr);</div><div class="line"><a name="l00109"></a><span class="lineno"> 109</span>&#160;</div><div class="line"><a name="l00110"></a><span class="lineno"> 110</span>&#160;<span class="keywordtype">int</span> rtipc_get_sockoptout(<span class="keyword">struct</span> rtdm_fd *fd,</div><div class="line"><a name="l00111"></a><span class="lineno"> 111</span>&#160; <span class="keyword">struct</span> _rtdm_getsockopt_args *sopt,</div><div class="line"><a name="l00112"></a><span class="lineno"> 112</span>&#160; <span class="keyword">const</span> <span class="keywordtype">void</span> *arg);</div><div class="line"><a name="l00113"></a><span class="lineno"> 113</span>&#160;</div><div class="line"><a name="l00114"></a><span class="lineno"> 114</span>&#160;<span class="keywordtype">int</span> rtipc_put_sockoptout(<span class="keyword">struct</span> rtdm_fd *fd, <span class="keywordtype">void</span> *arg,</div><div class="line"><a name="l00115"></a><span class="lineno"> 115</span>&#160; <span class="keyword">const</span> <span class="keyword">struct</span> _rtdm_getsockopt_args *sopt);</div><div class="line"><a name="l00116"></a><span class="lineno"> 116</span>&#160;</div><div class="line"><a name="l00117"></a><span class="lineno"> 117</span>&#160;<span class="keywordtype">int</span> rtipc_get_sockoptin(<span class="keyword">struct</span> rtdm_fd *fd,</div><div class="line"><a name="l00118"></a><span class="lineno"> 118</span>&#160; <span class="keyword">struct</span> _rtdm_setsockopt_args *sopt,</div><div class="line"><a name="l00119"></a><span class="lineno"> 119</span>&#160; <span class="keyword">const</span> <span class="keywordtype">void</span> *arg);</div><div class="line"><a name="l00120"></a><span class="lineno"> 120</span>&#160;</div><div class="line"><a name="l00121"></a><span class="lineno"> 121</span>&#160;<span class="keywordtype">int</span> rtipc_get_timeval(<span class="keyword">struct</span> rtdm_fd *fd, <span class="keyword">struct</span> timeval *tv,</div><div class="line"><a name="l00122"></a><span class="lineno"> 122</span>&#160; <span class="keyword">const</span> <span class="keywordtype">void</span> *arg, <span class="keywordtype">size_t</span> arglen);</div><div class="line"><a name="l00123"></a><span class="lineno"> 123</span>&#160;</div><div class="line"><a name="l00124"></a><span class="lineno"> 124</span>&#160;<span class="keywordtype">int</span> rtipc_put_timeval(<span class="keyword">struct</span> rtdm_fd *fd, <span class="keywordtype">void</span> *arg,</div><div class="line"><a name="l00125"></a><span class="lineno"> 125</span>&#160; <span class="keyword">const</span> <span class="keyword">struct</span> timeval *tv, <span class="keywordtype">size_t</span> arglen);</div><div class="line"><a name="l00126"></a><span class="lineno"> 126</span>&#160;</div><div class="line"><a name="l00127"></a><span class="lineno"> 127</span>&#160;<span class="keywordtype">int</span> rtipc_get_length(<span class="keyword">struct</span> rtdm_fd *fd, <span class="keywordtype">size_t</span> *lenp,</div><div class="line"><a name="l00128"></a><span class="lineno"> 128</span>&#160; <span class="keyword">const</span> <span class="keywordtype">void</span> *arg, <span class="keywordtype">size_t</span> arglen);</div><div class="line"><a name="l00129"></a><span class="lineno"> 129</span>&#160;</div><div class="line"><a name="l00130"></a><span class="lineno"> 130</span>&#160;<span class="keywordtype">int</span> rtipc_get_arg(<span class="keyword">struct</span> rtdm_fd *fd, <span class="keywordtype">void</span> *dst, <span class="keyword">const</span> <span class="keywordtype">void</span> *src,</div><div class="line"><a name="l00131"></a><span class="lineno"> 131</span>&#160; <span class="keywordtype">size_t</span> len);</div><div class="line"><a name="l00132"></a><span class="lineno"> 132</span>&#160;</div><div class="line"><a name="l00133"></a><span class="lineno"> 133</span>&#160;<span class="keywordtype">int</span> rtipc_put_arg(<span class="keyword">struct</span> rtdm_fd *fd, <span class="keywordtype">void</span> *dst, <span class="keyword">const</span> <span class="keywordtype">void</span> *src,</div><div class="line"><a name="l00134"></a><span class="lineno"> 134</span>&#160; <span class="keywordtype">size_t</span> len);</div><div class="line"><a name="l00135"></a><span class="lineno"> 135</span>&#160;</div><div class="line"><a name="l00136"></a><span class="lineno"> 136</span>&#160;ssize_t rtipc_get_iov_flatlen(<span class="keyword">struct</span> iovec *iov, <span class="keywordtype">int</span> iovlen);</div><div class="line"><a name="l00137"></a><span class="lineno"> 137</span>&#160;</div><div class="line"><a name="l00138"></a><span class="lineno"> 138</span>&#160;<span class="keyword">extern</span> <span class="keyword">struct </span>rtipc_protocol xddp_proto_driver;</div><div class="line"><a name="l00139"></a><span class="lineno"> 139</span>&#160;</div><div class="line"><a name="l00140"></a><span class="lineno"> 140</span>&#160;<span class="keyword">extern</span> <span class="keyword">struct </span>rtipc_protocol iddp_proto_driver;</div><div class="line"><a name="l00141"></a><span class="lineno"> 141</span>&#160;</div><div class="line"><a name="l00142"></a><span class="lineno"> 142</span>&#160;<span class="keyword">extern</span> <span class="keyword">struct </span>rtipc_protocol bufp_proto_driver;</div><div class="line"><a name="l00143"></a><span class="lineno"> 143</span>&#160;</div><div class="line"><a name="l00144"></a><span class="lineno"> 144</span>&#160;<span class="keyword">extern</span> <span class="keyword">struct </span>xnptree rtipc_ptree;</div><div class="line"><a name="l00145"></a><span class="lineno"> 145</span>&#160;</div><div class="line"><a name="l00146"></a><span class="lineno"> 146</span>&#160;<span class="preprocessor">#define rtipc_wait_context xnthread_wait_context</span></div><div class="line"><a name="l00147"></a><span class="lineno"> 147</span>&#160;<span class="preprocessor">#define rtipc_prepare_wait xnthread_prepare_wait</span></div><div class="line"><a name="l00148"></a><span class="lineno"> 148</span>&#160;<span class="preprocessor">#define rtipc_get_wait_context xnthread_get_wait_context</span></div><div class="line"><a name="l00149"></a><span class="lineno"> 149</span>&#160;<span class="preprocessor">#define rtipc_peek_wait_head(obj) xnsynch_peek_pendq(&amp;(obj)-&gt;synch_base)</span></div><div class="line"><a name="l00150"></a><span class="lineno"> 150</span>&#160;</div><div class="line"><a name="l00151"></a><span class="lineno"> 151</span>&#160;<span class="preprocessor">#define COMPAT_CASE(__op) case __op __COMPAT_CASE(__op ## _COMPAT)</span></div><div class="line"><a name="l00152"></a><span class="lineno"> 152</span>&#160;</div><div class="line"><a name="l00153"></a><span class="lineno"> 153</span>&#160;<span class="preprocessor">#endif </span><span class="comment">/* !_RTIPC_INTERNAL_H */</span><span class="preprocessor"></span></div><div class="ttc" id="structsockaddr__ipc_html"><div class="ttname"><a href="structsockaddr__ipc.html">sockaddr_ipc</a></div><div class="ttdoc">Socket address structure for the RTIPC address family. </div><div class="ttdef"><b>Definition:</b> ipc.h:480</div></div>
<div class="ttc" id="driver_8h_html_aa1aec6568a871126146498a32549c609"><div class="ttname"><a href="driver_8h.html#aa1aec6568a871126146498a32549c609">rtdm_fd_to_private</a></div><div class="ttdeci">static void * rtdm_fd_to_private(struct rtdm_fd *fd)</div><div class="ttdoc">Locate the driver private area associated to a device context structure. </div><div class="ttdef"><b>Definition:</b> driver.h:161</div></div>
<div class="ttc" id="group__rtdm_html_gaededf91e760e3268235351dcc9d9dcda"><div class="ttname"><a href="group__rtdm.html#gaededf91e760e3268235351dcc9d9dcda">nanosecs_rel_t</a></div><div class="ttdeci">int64_t nanosecs_rel_t</div><div class="ttdoc">RTDM type for representing relative intervals. </div><div class="ttdef"><b>Definition:</b> rtdm.h:49</div></div>
<div class="ttc" id="driver_8h_html"><div class="ttname"><a href="driver_8h.html">driver.h</a></div><div class="ttdoc">Real-Time Driver Model for Xenomai, driver API header. </div></div>
......
......@@ -72,15 +72,15 @@ $(document).ready(function(){initNavTree('kernel_2synch_8h_source.html','');});
<div class="title">synch.h</div> </div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span>&#160;<span class="comment">/*</span></div><div class="line"><a name="l00002"></a><span class="lineno"> 2</span>&#160;<span class="comment"> * Copyright (C) 2001,2002,2003 Philippe Gerum &lt;rpm@xenomai.org&gt;.</span></div><div class="line"><a name="l00003"></a><span class="lineno"> 3</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00004"></a><span class="lineno"> 4</span>&#160;<span class="comment"> * Xenomai is free software; you can redistribute it and/or modify</span></div><div class="line"><a name="l00005"></a><span class="lineno"> 5</span>&#160;<span class="comment"> * it under the terms of the GNU General Public License as published</span></div><div class="line"><a name="l00006"></a><span class="lineno"> 6</span>&#160;<span class="comment"> * by the Free Software Foundation; either version 2 of the License,</span></div><div class="line"><a name="l00007"></a><span class="lineno"> 7</span>&#160;<span class="comment"> * or (at your option) any later version.</span></div><div class="line"><a name="l00008"></a><span class="lineno"> 8</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00009"></a><span class="lineno"> 9</span>&#160;<span class="comment"> * Xenomai is distributed in the hope that it will be useful, but</span></div><div class="line"><a name="l00010"></a><span class="lineno"> 10</span>&#160;<span class="comment"> * WITHOUT ANY WARRANTY; without even the implied warranty of</span></div><div class="line"><a name="l00011"></a><span class="lineno"> 11</span>&#160;<span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU</span></div><div class="line"><a name="l00012"></a><span class="lineno"> 12</span>&#160;<span class="comment"> * General Public License for more details.</span></div><div class="line"><a name="l00013"></a><span class="lineno"> 13</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00014"></a><span class="lineno"> 14</span>&#160;<span class="comment"> * You should have received a copy of the GNU General Public License</span></div><div class="line"><a name="l00015"></a><span class="lineno"> 15</span>&#160;<span class="comment"> * along with Xenomai; if not, write to the Free Software</span></div><div class="line"><a name="l00016"></a><span class="lineno"> 16</span>&#160;<span class="comment"> * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA</span></div><div class="line"><a name="l00017"></a><span class="lineno"> 17</span>&#160;<span class="comment"> * 02111-1307, USA.</span></div><div class="line"><a name="l00018"></a><span class="lineno"> 18</span>&#160;<span class="comment"> */</span></div><div class="line"><a name="l00019"></a><span class="lineno"> 19</span>&#160;<span class="preprocessor">#ifndef _COBALT_KERNEL_SYNCH_H</span></div><div class="line"><a name="l00020"></a><span class="lineno"> 20</span>&#160;<span class="preprocessor">#define _COBALT_KERNEL_SYNCH_H</span></div><div class="line"><a name="l00021"></a><span class="lineno"> 21</span>&#160;</div><div class="line"><a name="l00022"></a><span class="lineno"> 22</span>&#160;<span class="preprocessor">#include &lt;cobalt/kernel/list.h&gt;</span></div><div class="line"><a name="l00023"></a><span class="lineno"> 23</span>&#160;<span class="preprocessor">#include &lt;cobalt/kernel/assert.h&gt;</span></div><div class="line"><a name="l00024"></a><span class="lineno"> 24</span>&#160;<span class="preprocessor">#include &lt;cobalt/kernel/timer.h&gt;</span></div><div class="line"><a name="l00025"></a><span class="lineno"> 25</span>&#160;<span class="preprocessor">#include &lt;cobalt/uapi/kernel/synch.h&gt;</span></div><div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160;</div><div class="line"><a name="l00031"></a><span class="lineno"> 31</span>&#160;<span class="preprocessor">#define XNSYNCH_CLAIMED 0x10 </span><span class="comment">/* Claimed by other thread(s) w/ PIP */</span><span class="preprocessor"></span></div><div class="line"><a name="l00032"></a><span class="lineno"> 32</span>&#160;</div><div class="line"><a name="l00033"></a><span class="lineno"> 33</span>&#160;<span class="comment">/* Spare flags usable by upper interfaces */</span></div><div class="line"><a name="l00034"></a><span class="lineno"> 34</span>&#160;<span class="preprocessor">#define XNSYNCH_SPARE0 0x01000000</span></div><div class="line"><a name="l00035"></a><span class="lineno"> 35</span>&#160;<span class="preprocessor">#define XNSYNCH_SPARE1 0x02000000</span></div><div class="line"><a name="l00036"></a><span class="lineno"> 36</span>&#160;<span class="preprocessor">#define XNSYNCH_SPARE2 0x04000000</span></div><div class="line"><a name="l00037"></a><span class="lineno"> 37</span>&#160;<span class="preprocessor">#define XNSYNCH_SPARE3 0x08000000</span></div><div class="line"><a name="l00038"></a><span class="lineno"> 38</span>&#160;<span class="preprocessor">#define XNSYNCH_SPARE4 0x10000000</span></div><div class="line"><a name="l00039"></a><span class="lineno"> 39</span>&#160;<span class="preprocessor">#define XNSYNCH_SPARE5 0x20000000</span></div><div class="line"><a name="l00040"></a><span class="lineno"> 40</span>&#160;<span class="preprocessor">#define XNSYNCH_SPARE6 0x40000000</span></div><div class="line"><a name="l00041"></a><span class="lineno"> 41</span>&#160;<span class="preprocessor">#define XNSYNCH_SPARE7 0x80000000</span></div><div class="line"><a name="l00042"></a><span class="lineno"> 42</span>&#160;</div><div class="line"><a name="l00043"></a><span class="lineno"> 43</span>&#160;<span class="comment">/* Statuses */</span></div><div class="line"><a name="l00044"></a><span class="lineno"> 44</span>&#160;<span class="preprocessor">#define XNSYNCH_DONE 0 </span><span class="comment">/* Resource available / operation complete */</span><span class="preprocessor"></span></div><div class="line"><a name="l00045"></a><span class="lineno"> 45</span>&#160;<span class="preprocessor">#define XNSYNCH_WAIT 1 </span><span class="comment">/* Calling thread blocked -- start rescheduling */</span><span class="preprocessor"></span></div><div class="line"><a name="l00046"></a><span class="lineno"> 46</span>&#160;<span class="preprocessor">#define XNSYNCH_RESCHED 2 </span><span class="comment">/* Force rescheduling */</span><span class="preprocessor"></span></div><div class="line"><a name="l00047"></a><span class="lineno"> 47</span>&#160;</div><div class="line"><a name="l00048"></a><span class="lineno"> 48</span>&#160;<span class="keyword">struct </span>xnthread;</div><div class="line"><a name="l00049"></a><span class="lineno"> 49</span>&#160;<span class="keyword">struct </span>xnsynch;</div><div class="line"><a name="l00050"></a><span class="lineno"> 50</span>&#160;</div><div class="line"><a name="l00051"></a><span class="lineno"> 51</span>&#160;<span class="keyword">struct </span>xnsynch {</div><div class="line"><a name="l00052"></a><span class="lineno"> 52</span>&#160; <span class="keyword">struct </span>list_head link; </div><div class="line"><a name="l00053"></a><span class="lineno"> 53</span>&#160; <span class="keywordtype">int</span> wprio; </div><div class="line"><a name="l00054"></a><span class="lineno"> 54</span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> status; </div><div class="line"><a name="l00055"></a><span class="lineno"> 55</span>&#160; <span class="keyword">struct </span>list_head pendq; </div><div class="line"><a name="l00056"></a><span class="lineno"> 56</span>&#160; <span class="keyword">struct </span>xnthread *owner; </div><div class="line"><a name="l00057"></a><span class="lineno"> 57</span>&#160; <a class="code" href="structatomic__t.html">atomic_t</a> *fastlock; </div><div class="line"><a name="l00058"></a><span class="lineno"> 58</span>&#160; void (*cleanup)(<span class="keyword">struct </span>xnsynch *synch); <span class="comment">/* Cleanup handler */</span></div><div class="line"><a name="l00059"></a><span class="lineno"> 59</span>&#160;};</div><div class="line"><a name="l00060"></a><span class="lineno"> 60</span>&#160;</div><div class="line"><a name="l00061"></a><span class="lineno"> 61</span>&#160;<span class="preprocessor">#define XNSYNCH_WAITQUEUE_INITIALIZER(__name) { \</span></div><div class="line"><a name="l00062"></a><span class="lineno"> 62</span>&#160;<span class="preprocessor"> .status = XNSYNCH_PRIO, \</span></div><div class="line"><a name="l00063"></a><span class="lineno"> 63</span>&#160;<span class="preprocessor"> .wprio = -1, \</span></div><div class="line"><a name="l00064"></a><span class="lineno"> 64</span>&#160;<span class="preprocessor"> .pendq = LIST_HEAD_INIT((__name).pendq), \</span></div><div class="line"><a name="l00065"></a><span class="lineno"> 65</span>&#160;<span class="preprocessor"> .owner = NULL, \</span></div><div class="line"><a name="l00066"></a><span class="lineno"> 66</span>&#160;<span class="preprocessor"> .cleanup = NULL, \</span></div><div class="line"><a name="l00067"></a><span class="lineno"> 67</span>&#160;<span class="preprocessor"> .fastlock = NULL, \</span></div><div class="line"><a name="l00068"></a><span class="lineno"> 68</span>&#160;<span class="preprocessor"> }</span></div><div class="line"><a name="l00069"></a><span class="lineno"> 69</span>&#160;</div><div class="line"><a name="l00070"></a><span class="lineno"> 70</span>&#160;<span class="preprocessor">#define DEFINE_XNWAITQ(__name) \</span></div><div class="line"><a name="l00071"></a><span class="lineno"> 71</span>&#160;<span class="preprocessor"> struct xnsynch __name = XNSYNCH_WAITQUEUE_INITIALIZER(__name)</span></div><div class="line"><a name="l00072"></a><span class="lineno"> 72</span>&#160;</div><div class="line"><a name="l00073"></a><span class="lineno"> 73</span>&#160;<span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> xnsynch_set_status(<span class="keyword">struct</span> xnsynch *synch, <span class="keywordtype">int</span> bits)</div><div class="line"><a name="l00074"></a><span class="lineno"> 74</span>&#160;{</div><div class="line"><a name="l00075"></a><span class="lineno"> 75</span>&#160; synch-&gt;status |= bits;</div><div class="line"><a name="l00076"></a><span class="lineno"> 76</span>&#160;}</div><div class="line"><a name="l00077"></a><span class="lineno"> 77</span>&#160;</div><div class="line"><a name="l00078"></a><span class="lineno"> 78</span>&#160;<span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> xnsynch_clear_status(<span class="keyword">struct</span> xnsynch *synch, <span class="keywordtype">int</span> bits)</div><div class="line"><a name="l00079"></a><span class="lineno"> 79</span>&#160;{</div><div class="line"><a name="l00080"></a><span class="lineno"> 80</span>&#160; synch-&gt;status &amp;= ~bits;</div><div class="line"><a name="l00081"></a><span class="lineno"> 81</span>&#160;}</div><div class="line"><a name="l00082"></a><span class="lineno"> 82</span>&#160;</div><div class="line"><a name="l00083"></a><span class="lineno"> 83</span>&#160;<span class="preprocessor">#define xnsynch_for_each_sleeper(__pos, __synch) \</span></div><div class="line"><a name="l00084"></a><span class="lineno"> 84</span>&#160;<span class="preprocessor"> list_for_each_entry(__pos, &amp;(__synch)-&gt;pendq, plink)</span></div><div class="line"><a name="l00085"></a><span class="lineno"> 85</span>&#160;</div><div class="line"><a name="l00086"></a><span class="lineno"> 86</span>&#160;<span class="preprocessor">#define xnsynch_for_each_sleeper_safe(__pos, __tmp, __synch) \</span></div><div class="line"><a name="l00087"></a><span class="lineno"> 87</span>&#160;<span class="preprocessor"> list_for_each_entry_safe(__pos, __tmp, &amp;(__synch)-&gt;pendq, plink)</span></div><div class="line"><a name="l00088"></a><span class="lineno"> 88</span>&#160;</div><div class="line"><a name="l00089"></a><span class="lineno"> 89</span>&#160;<span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">int</span> xnsynch_pended_p(<span class="keyword">struct</span> xnsynch *synch)</div><div class="line"><a name="l00090"></a><span class="lineno"> 90</span>&#160;{</div><div class="line"><a name="l00091"></a><span class="lineno"> 91</span>&#160; <span class="keywordflow">return</span> !list_empty(&amp;synch-&gt;pendq);</div><div class="line"><a name="l00092"></a><span class="lineno"> 92</span>&#160;}</div><div class="line"><a name="l00093"></a><span class="lineno"> 93</span>&#160;</div><div class="line"><a name="l00094"></a><span class="lineno"> 94</span>&#160;<span class="keyword">static</span> <span class="keyword">inline</span> <span class="keyword">struct </span>xnthread *xnsynch_owner(<span class="keyword">struct</span> xnsynch *synch)</div><div class="line"><a name="l00095"></a><span class="lineno"> 95</span>&#160;{</div><div class="line"><a name="l00096"></a><span class="lineno"> 96</span>&#160; <span class="keywordflow">return</span> synch-&gt;owner;</div><div class="line"><a name="l00097"></a><span class="lineno"> 97</span>&#160;}</div><div class="line"><a name="l00098"></a><span class="lineno"> 98</span>&#160;</div><div class="line"><a name="l00099"></a><span class="lineno"> 99</span>&#160;<span class="preprocessor">#define xnsynch_fastlock(synch) ((synch)-&gt;fastlock)</span></div><div class="line"><a name="l00100"></a><span class="lineno"> 100</span>&#160;<span class="preprocessor">#define xnsynch_fastlock_p(synch) ((synch)-&gt;fastlock != NULL)</span></div><div class="line"><a name="l00101"></a><span class="lineno"> 101</span>&#160;<span class="preprocessor">#define xnsynch_owner_check(synch, thread) \</span></div><div class="line"><a name="l00102"></a><span class="lineno"> 102</span>&#160;<span class="preprocessor"> xnsynch_fast_owner_check((synch)-&gt;fastlock, thread-&gt;handle)</span></div><div class="line"><a name="l00103"></a><span class="lineno"> 103</span>&#160;</div><div class="line"><a name="l00104"></a><span class="lineno"> 104</span>&#160;<span class="preprocessor">#if XENO_DEBUG(MUTEX_RELAXED)</span></div><div class="line"><a name="l00105"></a><span class="lineno"> 105</span>&#160;</div><div class="line"><a name="l00106"></a><span class="lineno"> 106</span>&#160;<span class="keywordtype">void</span> xnsynch_detect_relaxed_owner(<span class="keyword">struct</span> xnsynch *synch,</div><div class="line"><a name="l00107"></a><span class="lineno"> 107</span>&#160; <span class="keyword">struct</span> xnthread *sleeper);</div><div class="line"><a name="l00108"></a><span class="lineno"> 108</span>&#160;</div><div class="line"><a name="l00109"></a><span class="lineno"> 109</span>&#160;<span class="keywordtype">void</span> xnsynch_detect_claimed_relax(<span class="keyword">struct</span> xnthread *owner);</div><div class="line"><a name="l00110"></a><span class="lineno"> 110</span>&#160;</div><div class="line"><a name="l00111"></a><span class="lineno"> 111</span>&#160;<span class="preprocessor">#else </span><span class="comment">/* !XENO_DEBUG(MUTEX_RELAXED) */</span><span class="preprocessor"></span></div><div class="line"><a name="l00112"></a><span class="lineno"> 112</span>&#160;</div><div class="line"><a name="l00113"></a><span class="lineno"> 113</span>&#160;<span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> xnsynch_detect_relaxed_owner(<span class="keyword">struct</span> xnsynch *synch,</div><div class="line"><a name="l00114"></a><span class="lineno"> 114</span>&#160; <span class="keyword">struct</span> xnthread *sleeper)</div><div class="line"><a name="l00115"></a><span class="lineno"> 115</span>&#160;{</div><div class="line"><a name="l00116"></a><span class="lineno"> 116</span>&#160;}</div><div class="line"><a name="l00117"></a><span class="lineno"> 117</span>&#160;</div><div class="line"><a name="l00118"></a><span class="lineno"> 118</span>&#160;<span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> xnsynch_detect_claimed_relax(<span class="keyword">struct</span> xnthread *owner)</div><div class="line"><a name="l00119"></a><span class="lineno"> 119</span>&#160;{</div><div class="line"><a name="l00120"></a><span class="lineno"> 120</span>&#160;}</div><div class="line"><a name="l00121"></a><span class="lineno"> 121</span>&#160;</div><div class="line"><a name="l00122"></a><span class="lineno"> 122</span>&#160;<span class="preprocessor">#endif </span><span class="comment">/* !XENO_DEBUG(MUTEX_RELAXED) */</span><span class="preprocessor"></span></div><div class="line"><a name="l00123"></a><span class="lineno"> 123</span>&#160;</div><div class="line"><a name="l00124"></a><span class="lineno"> 124</span>&#160;<span class="keywordtype">void</span> <a class="code" href="group__cobalt__core__synch.html#gafc3030603c9054b69f1abb44014f1838">xnsynch_init</a>(<span class="keyword">struct</span> xnsynch *synch, <span class="keywordtype">int</span> flags,</div><div class="line"><a name="l00125"></a><span class="lineno"> 125</span>&#160; <a class="code" href="structatomic__t.html">atomic_t</a> *fastlock);</div><div class="line"><a name="l00126"></a><span class="lineno"> 126</span>&#160;</div><div class="line"><a name="l00127"></a><span class="lineno"> 127</span>&#160;<span class="keywordtype">int</span> <a class="code" href="group__cobalt__core__synch.html#gadd862461f55506485f04f4f98cdb6fb8">xnsynch_destroy</a>(<span class="keyword">struct</span> xnsynch *synch);</div><div class="line"><a name="l00128"></a><span class="lineno"> 128</span>&#160;</div><div class="line"><a name="l00129"></a><span class="lineno"> 129</span>&#160;<span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> xnsynch_set_owner(<span class="keyword">struct</span> xnsynch *synch,</div><div class="line"><a name="l00130"></a><span class="lineno"> 130</span>&#160; <span class="keyword">struct</span> xnthread *thread)</div><div class="line"><a name="l00131"></a><span class="lineno"> 131</span>&#160;{</div><div class="line"><a name="l00132"></a><span class="lineno"> 132</span>&#160; synch-&gt;owner = thread;</div><div class="line"><a name="l00133"></a><span class="lineno"> 133</span>&#160;}</div><div class="line"><a name="l00134"></a><span class="lineno"> 134</span>&#160;</div><div class="line"><a name="l00135"></a><span class="lineno"> 135</span>&#160;<span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> xnsynch_register_cleanup(<span class="keyword">struct</span> xnsynch *synch,</div><div class="line"><a name="l00136"></a><span class="lineno"> 136</span>&#160; <span class="keywordtype">void</span> (*handler)(<span class="keyword">struct</span> xnsynch *))</div><div class="line"><a name="l00137"></a><span class="lineno"> 137</span>&#160;{</div><div class="line"><a name="l00138"></a><span class="lineno"> 138</span>&#160; synch-&gt;cleanup = handler;</div><div class="line"><a name="l00139"></a><span class="lineno"> 139</span>&#160;}</div><div class="line"><a name="l00140"></a><span class="lineno"> 140</span>&#160;</div><div class="line"><a name="l00141"></a><span class="lineno"> 141</span>&#160;<span class="keywordtype">int</span> <a class="code" href="group__cobalt__core__synch.html#ga51cec970cb57608abe882c98bee72347">xnsynch_sleep_on</a>(<span class="keyword">struct</span> xnsynch *synch,</div><div class="line"><a name="l00142"></a><span class="lineno"> 142</span>&#160; xnticks_t timeout,</div><div class="line"><a name="l00143"></a><span class="lineno"> 143</span>&#160; xntmode_t timeout_mode);</div><div class="line"><a name="l00144"></a><span class="lineno"> 144</span>&#160;</div><div class="line"><a name="l00145"></a><span class="lineno"> 145</span>&#160;<span class="keyword">struct </span>xnthread *<a class="code" href="group__cobalt__core__synch.html#ga54162964059c62d7a7b45ef22911662f">xnsynch_wakeup_one_sleeper</a>(<span class="keyword">struct</span> xnsynch *synch);</div><div class="line"><a name="l00146"></a><span class="lineno"> 146</span>&#160;</div><div class="line"><a name="l00147"></a><span class="lineno"> 147</span>&#160;<span class="keywordtype">int</span> xnsynch_wakeup_many_sleepers(<span class="keyword">struct</span> xnsynch *synch, <span class="keywordtype">int</span> nr);</div><div class="line"><a name="l00148"></a><span class="lineno"> 148</span>&#160;</div><div class="line"><a name="l00149"></a><span class="lineno"> 149</span>&#160;<span class="keywordtype">void</span> <a class="code" href="group__cobalt__core__synch.html#ga8096364cd5d717dae816c74dcc05a8ac">xnsynch_wakeup_this_sleeper</a>(<span class="keyword">struct</span> xnsynch *synch,</div><div class="line"><a name="l00150"></a><span class="lineno"> 150</span>&#160; <span class="keyword">struct</span> xnthread *sleeper);</div><div class="line"><a name="l00151"></a><span class="lineno"> 151</span>&#160;</div><div class="line"><a name="l00152"></a><span class="lineno"> 152</span>&#160;<span class="keywordtype">int</span> <a class="code" href="group__cobalt__core__synch.html#ga43fa3ecdc81f6ae157f840175c7ea091">xnsynch_acquire</a>(<span class="keyword">struct</span> xnsynch *synch,</div><div class="line"><a name="l00153"></a><span class="lineno"> 153</span>&#160; xnticks_t timeout,</div><div class="line"><a name="l00154"></a><span class="lineno"> 154</span>&#160; xntmode_t timeout_mode);</div><div class="line"><a name="l00155"></a><span class="lineno"> 155</span>&#160;</div><div class="line"><a name="l00156"></a><span class="lineno"> 156</span>&#160;<span class="keywordtype">int</span> <a class="code" href="group__cobalt__core__synch.html#gad5cad7eeaa18834c9ba8843511a67628">xnsynch_try_acquire</a>(<span class="keyword">struct</span> xnsynch *synch);</div><div class="line"><a name="l00157"></a><span class="lineno"> 157</span>&#160;</div><div class="line"><a name="l00158"></a><span class="lineno"> 158</span>&#160;<span class="keyword">struct </span>xnthread *<a class="code" href="group__cobalt__core__synch.html#gad38fe2be85e02bf1298418674ab6386f">xnsynch_release</a>(<span class="keyword">struct</span> xnsynch *synch,</div><div class="line"><a name="l00159"></a><span class="lineno"> 159</span>&#160; <span class="keyword">struct</span> xnthread *thread);</div><div class="line"><a name="l00160"></a><span class="lineno"> 160</span>&#160;</div><div class="line"><a name="l00161"></a><span class="lineno"> 161</span>&#160;<span class="keyword">struct </span>xnthread *<a class="code" href="group__cobalt__core__synch.html#ga4f98598194fa76a8b0ff298387429b9d">xnsynch_peek_pendq</a>(<span class="keyword">struct</span> xnsynch *synch);</div><div class="line"><a name="l00162"></a><span class="lineno"> 162</span>&#160;</div><div class="line"><a name="l00163"></a><span class="lineno"> 163</span>&#160;<span class="keywordtype">int</span> <a class="code" href="group__cobalt__core__synch.html#ga51febbfe4ff33ef18778fe9ecf62c43a">xnsynch_flush</a>(<span class="keyword">struct</span> xnsynch *synch, <span class="keywordtype">int</span> reason);</div><div class="line"><a name="l00164"></a><span class="lineno"> 164</span>&#160;</div><div class="line"><a name="l00165"></a><span class="lineno"> 165</span>&#160;<span class="keywordtype">void</span> xnsynch_release_all_ownerships(<span class="keyword">struct</span> xnthread *thread);</div><div class="line"><a name="l00166"></a><span class="lineno"> 166</span>&#160;</div><div class="line"><a name="l00167"></a><span class="lineno"> 167</span>&#160;<span class="keywordtype">void</span> xnsynch_requeue_sleeper(<span class="keyword">struct</span> xnthread *thread);</div><div class="line"><a name="l00168"></a><span class="lineno"> 168</span>&#160;</div><div class="line"><a name="l00169"></a><span class="lineno"> 169</span>&#160;<span class="keywordtype">void</span> xnsynch_forget_sleeper(<span class="keyword">struct</span> xnthread *thread);</div><div class="line"><a name="l00170"></a><span class="lineno"> 170</span>&#160;</div><div class="line"><a name="l00173"></a><span class="lineno"> 173</span>&#160;<span class="preprocessor">#endif </span><span class="comment">/* !_COBALT_KERNEL_SYNCH_H_ */</span><span class="preprocessor"></span></div><div class="ttc" id="group__cobalt__core__synch_html_ga51febbfe4ff33ef18778fe9ecf62c43a"><div class="ttname"><a href="group__cobalt__core__synch.html#ga51febbfe4ff33ef18778fe9ecf62c43a">xnsynch_flush</a></div><div class="ttdeci">int xnsynch_flush(struct xnsynch *synch, int reason)</div><div class="ttdoc">Unblock all waiters pending on a resource. </div><div class="ttdef"><b>Definition:</b> synch.c:810</div></div>
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span>&#160;<span class="comment">/*</span></div><div class="line"><a name="l00002"></a><span class="lineno"> 2</span>&#160;<span class="comment"> * Copyright (C) 2001,2002,2003 Philippe Gerum &lt;rpm@xenomai.org&gt;.</span></div><div class="line"><a name="l00003"></a><span class="lineno"> 3</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00004"></a><span class="lineno"> 4</span>&#160;<span class="comment"> * Xenomai is free software; you can redistribute it and/or modify</span></div><div class="line"><a name="l00005"></a><span class="lineno"> 5</span>&#160;<span class="comment"> * it under the terms of the GNU General Public License as published</span></div><div class="line"><a name="l00006"></a><span class="lineno"> 6</span>&#160;<span class="comment"> * by the Free Software Foundation; either version 2 of the License,</span></div><div class="line"><a name="l00007"></a><span class="lineno"> 7</span>&#160;<span class="comment"> * or (at your option) any later version.</span></div><div class="line"><a name="l00008"></a><span class="lineno"> 8</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00009"></a><span class="lineno"> 9</span>&#160;<span class="comment"> * Xenomai is distributed in the hope that it will be useful, but</span></div><div class="line"><a name="l00010"></a><span class="lineno"> 10</span>&#160;<span class="comment"> * WITHOUT ANY WARRANTY; without even the implied warranty of</span></div><div class="line"><a name="l00011"></a><span class="lineno"> 11</span>&#160;<span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU</span></div><div class="line"><a name="l00012"></a><span class="lineno"> 12</span>&#160;<span class="comment"> * General Public License for more details.</span></div><div class="line"><a name="l00013"></a><span class="lineno"> 13</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00014"></a><span class="lineno"> 14</span>&#160;<span class="comment"> * You should have received a copy of the GNU General Public License</span></div><div class="line"><a name="l00015"></a><span class="lineno"> 15</span>&#160;<span class="comment"> * along with Xenomai; if not, write to the Free Software</span></div><div class="line"><a name="l00016"></a><span class="lineno"> 16</span>&#160;<span class="comment"> * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA</span></div><div class="line"><a name="l00017"></a><span class="lineno"> 17</span>&#160;<span class="comment"> * 02111-1307, USA.</span></div><div class="line"><a name="l00018"></a><span class="lineno"> 18</span>&#160;<span class="comment"> */</span></div><div class="line"><a name="l00019"></a><span class="lineno"> 19</span>&#160;<span class="preprocessor">#ifndef _COBALT_KERNEL_SYNCH_H</span></div><div class="line"><a name="l00020"></a><span class="lineno"> 20</span>&#160;<span class="preprocessor">#define _COBALT_KERNEL_SYNCH_H</span></div><div class="line"><a name="l00021"></a><span class="lineno"> 21</span>&#160;</div><div class="line"><a name="l00022"></a><span class="lineno"> 22</span>&#160;<span class="preprocessor">#include &lt;cobalt/kernel/list.h&gt;</span></div><div class="line"><a name="l00023"></a><span class="lineno"> 23</span>&#160;<span class="preprocessor">#include &lt;cobalt/kernel/assert.h&gt;</span></div><div class="line"><a name="l00024"></a><span class="lineno"> 24</span>&#160;<span class="preprocessor">#include &lt;cobalt/kernel/timer.h&gt;</span></div><div class="line"><a name="l00025"></a><span class="lineno"> 25</span>&#160;<span class="preprocessor">#include &lt;cobalt/uapi/kernel/synch.h&gt;</span></div><div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160;</div><div class="line"><a name="l00031"></a><span class="lineno"> 31</span>&#160;<span class="preprocessor">#define XNSYNCH_CLAIMED 0x10 </span><span class="comment">/* Claimed by other thread(s) w/ PIP */</span><span class="preprocessor"></span></div><div class="line"><a name="l00032"></a><span class="lineno"> 32</span>&#160;</div><div class="line"><a name="l00033"></a><span class="lineno"> 33</span>&#160;<span class="comment">/* Spare flags usable by upper interfaces */</span></div><div class="line"><a name="l00034"></a><span class="lineno"> 34</span>&#160;<span class="preprocessor">#define XNSYNCH_SPARE0 0x01000000</span></div><div class="line"><a name="l00035"></a><span class="lineno"> 35</span>&#160;<span class="preprocessor">#define XNSYNCH_SPARE1 0x02000000</span></div><div class="line"><a name="l00036"></a><span class="lineno"> 36</span>&#160;<span class="preprocessor">#define XNSYNCH_SPARE2 0x04000000</span></div><div class="line"><a name="l00037"></a><span class="lineno"> 37</span>&#160;<span class="preprocessor">#define XNSYNCH_SPARE3 0x08000000</span></div><div class="line"><a name="l00038"></a><span class="lineno"> 38</span>&#160;<span class="preprocessor">#define XNSYNCH_SPARE4 0x10000000</span></div><div class="line"><a name="l00039"></a><span class="lineno"> 39</span>&#160;<span class="preprocessor">#define XNSYNCH_SPARE5 0x20000000</span></div><div class="line"><a name="l00040"></a><span class="lineno"> 40</span>&#160;<span class="preprocessor">#define XNSYNCH_SPARE6 0x40000000</span></div><div class="line"><a name="l00041"></a><span class="lineno"> 41</span>&#160;<span class="preprocessor">#define XNSYNCH_SPARE7 0x80000000</span></div><div class="line"><a name="l00042"></a><span class="lineno"> 42</span>&#160;</div><div class="line"><a name="l00043"></a><span class="lineno"> 43</span>&#160;<span class="comment">/* Statuses */</span></div><div class="line"><a name="l00044"></a><span class="lineno"> 44</span>&#160;<span class="preprocessor">#define XNSYNCH_DONE 0 </span><span class="comment">/* Resource available / operation complete */</span><span class="preprocessor"></span></div><div class="line"><a name="l00045"></a><span class="lineno"> 45</span>&#160;<span class="preprocessor">#define XNSYNCH_WAIT 1 </span><span class="comment">/* Calling thread blocked -- start rescheduling */</span><span class="preprocessor"></span></div><div class="line"><a name="l00046"></a><span class="lineno"> 46</span>&#160;<span class="preprocessor">#define XNSYNCH_RESCHED 2 </span><span class="comment">/* Force rescheduling */</span><span class="preprocessor"></span></div><div class="line"><a name="l00047"></a><span class="lineno"> 47</span>&#160;</div><div class="line"><a name="l00048"></a><span class="lineno"> 48</span>&#160;<span class="keyword">struct </span>xnthread;</div><div class="line"><a name="l00049"></a><span class="lineno"> 49</span>&#160;<span class="keyword">struct </span>xnsynch;</div><div class="line"><a name="l00050"></a><span class="lineno"> 50</span>&#160;</div><div class="line"><a name="l00051"></a><span class="lineno"> 51</span>&#160;<span class="keyword">struct </span>xnsynch {</div><div class="line"><a name="l00052"></a><span class="lineno"> 52</span>&#160; <span class="keyword">struct </span>list_head link; </div><div class="line"><a name="l00053"></a><span class="lineno"> 53</span>&#160; <span class="keywordtype">int</span> wprio; </div><div class="line"><a name="l00054"></a><span class="lineno"> 54</span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> status; </div><div class="line"><a name="l00055"></a><span class="lineno"> 55</span>&#160; <span class="keyword">struct </span>list_head pendq; </div><div class="line"><a name="l00056"></a><span class="lineno"> 56</span>&#160; <span class="keyword">struct </span>xnthread *owner; </div><div class="line"><a name="l00057"></a><span class="lineno"> 57</span>&#160; <a class="code" href="structatomic__t.html">atomic_t</a> *fastlock; </div><div class="line"><a name="l00058"></a><span class="lineno"> 58</span>&#160; void (*cleanup)(<span class="keyword">struct </span>xnsynch *synch); <span class="comment">/* Cleanup handler */</span></div><div class="line"><a name="l00059"></a><span class="lineno"> 59</span>&#160;};</div><div class="line"><a name="l00060"></a><span class="lineno"> 60</span>&#160;</div><div class="line"><a name="l00061"></a><span class="lineno"> 61</span>&#160;<span class="preprocessor">#define XNSYNCH_WAITQUEUE_INITIALIZER(__name) { \</span></div><div class="line"><a name="l00062"></a><span class="lineno"> 62</span>&#160;<span class="preprocessor"> .status = XNSYNCH_PRIO, \</span></div><div class="line"><a name="l00063"></a><span class="lineno"> 63</span>&#160;<span class="preprocessor"> .wprio = -1, \</span></div><div class="line"><a name="l00064"></a><span class="lineno"> 64</span>&#160;<span class="preprocessor"> .pendq = LIST_HEAD_INIT((__name).pendq), \</span></div><div class="line"><a name="l00065"></a><span class="lineno"> 65</span>&#160;<span class="preprocessor"> .owner = NULL, \</span></div><div class="line"><a name="l00066"></a><span class="lineno"> 66</span>&#160;<span class="preprocessor"> .cleanup = NULL, \</span></div><div class="line"><a name="l00067"></a><span class="lineno"> 67</span>&#160;<span class="preprocessor"> .fastlock = NULL, \</span></div><div class="line"><a name="l00068"></a><span class="lineno"> 68</span>&#160;<span class="preprocessor"> }</span></div><div class="line"><a name="l00069"></a><span class="lineno"> 69</span>&#160;</div><div class="line"><a name="l00070"></a><span class="lineno"> 70</span>&#160;<span class="preprocessor">#define DEFINE_XNWAITQ(__name) \</span></div><div class="line"><a name="l00071"></a><span class="lineno"> 71</span>&#160;<span class="preprocessor"> struct xnsynch __name = XNSYNCH_WAITQUEUE_INITIALIZER(__name)</span></div><div class="line"><a name="l00072"></a><span class="lineno"> 72</span>&#160;</div><div class="line"><a name="l00073"></a><span class="lineno"> 73</span>&#160;<span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> xnsynch_set_status(<span class="keyword">struct</span> xnsynch *synch, <span class="keywordtype">int</span> bits)</div><div class="line"><a name="l00074"></a><span class="lineno"> 74</span>&#160;{</div><div class="line"><a name="l00075"></a><span class="lineno"> 75</span>&#160; synch-&gt;status |= bits;</div><div class="line"><a name="l00076"></a><span class="lineno"> 76</span>&#160;}</div><div class="line"><a name="l00077"></a><span class="lineno"> 77</span>&#160;</div><div class="line"><a name="l00078"></a><span class="lineno"> 78</span>&#160;<span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> xnsynch_clear_status(<span class="keyword">struct</span> xnsynch *synch, <span class="keywordtype">int</span> bits)</div><div class="line"><a name="l00079"></a><span class="lineno"> 79</span>&#160;{</div><div class="line"><a name="l00080"></a><span class="lineno"> 80</span>&#160; synch-&gt;status &amp;= ~bits;</div><div class="line"><a name="l00081"></a><span class="lineno"> 81</span>&#160;}</div><div class="line"><a name="l00082"></a><span class="lineno"> 82</span>&#160;</div><div class="line"><a name="l00083"></a><span class="lineno"> 83</span>&#160;<span class="preprocessor">#define xnsynch_for_each_sleeper(__pos, __synch) \</span></div><div class="line"><a name="l00084"></a><span class="lineno"> 84</span>&#160;<span class="preprocessor"> list_for_each_entry(__pos, &amp;(__synch)-&gt;pendq, plink)</span></div><div class="line"><a name="l00085"></a><span class="lineno"> 85</span>&#160;</div><div class="line"><a name="l00086"></a><span class="lineno"> 86</span>&#160;<span class="preprocessor">#define xnsynch_for_each_sleeper_safe(__pos, __tmp, __synch) \</span></div><div class="line"><a name="l00087"></a><span class="lineno"> 87</span>&#160;<span class="preprocessor"> list_for_each_entry_safe(__pos, __tmp, &amp;(__synch)-&gt;pendq, plink)</span></div><div class="line"><a name="l00088"></a><span class="lineno"> 88</span>&#160;</div><div class="line"><a name="l00089"></a><span class="lineno"> 89</span>&#160;<span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">int</span> xnsynch_pended_p(<span class="keyword">struct</span> xnsynch *synch)</div><div class="line"><a name="l00090"></a><span class="lineno"> 90</span>&#160;{</div><div class="line"><a name="l00091"></a><span class="lineno"> 91</span>&#160; <span class="keywordflow">return</span> !list_empty(&amp;synch-&gt;pendq);</div><div class="line"><a name="l00092"></a><span class="lineno"> 92</span>&#160;}</div><div class="line"><a name="l00093"></a><span class="lineno"> 93</span>&#160;</div><div class="line"><a name="l00094"></a><span class="lineno"> 94</span>&#160;<span class="keyword">static</span> <span class="keyword">inline</span> <span class="keyword">struct </span>xnthread *xnsynch_owner(<span class="keyword">struct</span> xnsynch *synch)</div><div class="line"><a name="l00095"></a><span class="lineno"> 95</span>&#160;{</div><div class="line"><a name="l00096"></a><span class="lineno"> 96</span>&#160; <span class="keywordflow">return</span> synch-&gt;owner;</div><div class="line"><a name="l00097"></a><span class="lineno"> 97</span>&#160;}</div><div class="line"><a name="l00098"></a><span class="lineno"> 98</span>&#160;</div><div class="line"><a name="l00099"></a><span class="lineno"> 99</span>&#160;<span class="preprocessor">#define xnsynch_fastlock(synch) ((synch)-&gt;fastlock)</span></div><div class="line"><a name="l00100"></a><span class="lineno"> 100</span>&#160;<span class="preprocessor">#define xnsynch_fastlock_p(synch) ((synch)-&gt;fastlock != NULL)</span></div><div class="line"><a name="l00101"></a><span class="lineno"> 101</span>&#160;<span class="preprocessor">#define xnsynch_owner_check(synch, thread) \</span></div><div class="line"><a name="l00102"></a><span class="lineno"> 102</span>&#160;<span class="preprocessor"> xnsynch_fast_owner_check((synch)-&gt;fastlock, thread-&gt;handle)</span></div><div class="line"><a name="l00103"></a><span class="lineno"> 103</span>&#160;</div><div class="line"><a name="l00104"></a><span class="lineno"> 104</span>&#160;<span class="preprocessor">#if XENO_DEBUG(MUTEX_RELAXED)</span></div><div class="line"><a name="l00105"></a><span class="lineno"> 105</span>&#160;</div><div class="line"><a name="l00106"></a><span class="lineno"> 106</span>&#160;<span class="keywordtype">void</span> xnsynch_detect_relaxed_owner(<span class="keyword">struct</span> xnsynch *synch,</div><div class="line"><a name="l00107"></a><span class="lineno"> 107</span>&#160; <span class="keyword">struct</span> xnthread *sleeper);</div><div class="line"><a name="l00108"></a><span class="lineno"> 108</span>&#160;</div><div class="line"><a name="l00109"></a><span class="lineno"> 109</span>&#160;<span class="keywordtype">void</span> xnsynch_detect_claimed_relax(<span class="keyword">struct</span> xnthread *owner);</div><div class="line"><a name="l00110"></a><span class="lineno"> 110</span>&#160;</div><div class="line"><a name="l00111"></a><span class="lineno"> 111</span>&#160;<span class="preprocessor">#else </span><span class="comment">/* !XENO_DEBUG(MUTEX_RELAXED) */</span><span class="preprocessor"></span></div><div class="line"><a name="l00112"></a><span class="lineno"> 112</span>&#160;</div><div class="line"><a name="l00113"></a><span class="lineno"> 113</span>&#160;<span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> xnsynch_detect_relaxed_owner(<span class="keyword">struct</span> xnsynch *synch,</div><div class="line"><a name="l00114"></a><span class="lineno"> 114</span>&#160; <span class="keyword">struct</span> xnthread *sleeper)</div><div class="line"><a name="l00115"></a><span class="lineno"> 115</span>&#160;{</div><div class="line"><a name="l00116"></a><span class="lineno"> 116</span>&#160;}</div><div class="line"><a name="l00117"></a><span class="lineno"> 117</span>&#160;</div><div class="line"><a name="l00118"></a><span class="lineno"> 118</span>&#160;<span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> xnsynch_detect_claimed_relax(<span class="keyword">struct</span> xnthread *owner)</div><div class="line"><a name="l00119"></a><span class="lineno"> 119</span>&#160;{</div><div class="line"><a name="l00120"></a><span class="lineno"> 120</span>&#160;}</div><div class="line"><a name="l00121"></a><span class="lineno"> 121</span>&#160;</div><div class="line"><a name="l00122"></a><span class="lineno"> 122</span>&#160;<span class="preprocessor">#endif </span><span class="comment">/* !XENO_DEBUG(MUTEX_RELAXED) */</span><span class="preprocessor"></span></div><div class="line"><a name="l00123"></a><span class="lineno"> 123</span>&#160;</div><div class="line"><a name="l00124"></a><span class="lineno"> 124</span>&#160;<span class="keywordtype">void</span> <a class="code" href="group__cobalt__core__synch.html#gafc3030603c9054b69f1abb44014f1838">xnsynch_init</a>(<span class="keyword">struct</span> xnsynch *synch, <span class="keywordtype">int</span> flags,</div><div class="line"><a name="l00125"></a><span class="lineno"> 125</span>&#160; <a class="code" href="structatomic__t.html">atomic_t</a> *fastlock);</div><div class="line"><a name="l00126"></a><span class="lineno"> 126</span>&#160;</div><div class="line"><a name="l00127"></a><span class="lineno"> 127</span>&#160;<span class="keywordtype">int</span> <a class="code" href="group__cobalt__core__synch.html#gadd862461f55506485f04f4f98cdb6fb8">xnsynch_destroy</a>(<span class="keyword">struct</span> xnsynch *synch);</div><div class="line"><a name="l00128"></a><span class="lineno"> 128</span>&#160;</div><div class="line"><a name="l00129"></a><span class="lineno"> 129</span>&#160;<span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> xnsynch_set_owner(<span class="keyword">struct</span> xnsynch *synch,</div><div class="line"><a name="l00130"></a><span class="lineno"> 130</span>&#160; <span class="keyword">struct</span> xnthread *thread)</div><div class="line"><a name="l00131"></a><span class="lineno"> 131</span>&#160;{</div><div class="line"><a name="l00132"></a><span class="lineno"> 132</span>&#160; synch-&gt;owner = thread;</div><div class="line"><a name="l00133"></a><span class="lineno"> 133</span>&#160;}</div><div class="line"><a name="l00134"></a><span class="lineno"> 134</span>&#160;</div><div class="line"><a name="l00135"></a><span class="lineno"> 135</span>&#160;<span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> xnsynch_register_cleanup(<span class="keyword">struct</span> xnsynch *synch,</div><div class="line"><a name="l00136"></a><span class="lineno"> 136</span>&#160; <span class="keywordtype">void</span> (*handler)(<span class="keyword">struct</span> xnsynch *))</div><div class="line"><a name="l00137"></a><span class="lineno"> 137</span>&#160;{</div><div class="line"><a name="l00138"></a><span class="lineno"> 138</span>&#160; synch-&gt;cleanup = handler;</div><div class="line"><a name="l00139"></a><span class="lineno"> 139</span>&#160;}</div><div class="line"><a name="l00140"></a><span class="lineno"> 140</span>&#160;</div><div class="line"><a name="l00141"></a><span class="lineno"> 141</span>&#160;<span class="keywordtype">int</span> __must_check <a class="code" href="group__cobalt__core__synch.html#ga51cec970cb57608abe882c98bee72347">xnsynch_sleep_on</a>(<span class="keyword">struct</span> xnsynch *synch,</div><div class="line"><a name="l00142"></a><span class="lineno"> 142</span>&#160; xnticks_t timeout,</div><div class="line"><a name="l00143"></a><span class="lineno"> 143</span>&#160; xntmode_t timeout_mode);</div><div class="line"><a name="l00144"></a><span class="lineno"> 144</span>&#160;</div><div class="line"><a name="l00145"></a><span class="lineno"> 145</span>&#160;<span class="keyword">struct </span>xnthread *<a class="code" href="group__cobalt__core__synch.html#ga54162964059c62d7a7b45ef22911662f">xnsynch_wakeup_one_sleeper</a>(<span class="keyword">struct</span> xnsynch *synch);</div><div class="line"><a name="l00146"></a><span class="lineno"> 146</span>&#160;</div><div class="line"><a name="l00147"></a><span class="lineno"> 147</span>&#160;<span class="keywordtype">int</span> xnsynch_wakeup_many_sleepers(<span class="keyword">struct</span> xnsynch *synch, <span class="keywordtype">int</span> nr);</div><div class="line"><a name="l00148"></a><span class="lineno"> 148</span>&#160;</div><div class="line"><a name="l00149"></a><span class="lineno"> 149</span>&#160;<span class="keywordtype">void</span> <a class="code" href="group__cobalt__core__synch.html#ga8096364cd5d717dae816c74dcc05a8ac">xnsynch_wakeup_this_sleeper</a>(<span class="keyword">struct</span> xnsynch *synch,</div><div class="line"><a name="l00150"></a><span class="lineno"> 150</span>&#160; <span class="keyword">struct</span> xnthread *sleeper);</div><div class="line"><a name="l00151"></a><span class="lineno"> 151</span>&#160;</div><div class="line"><a name="l00152"></a><span class="lineno"> 152</span>&#160;<span class="keywordtype">int</span> __must_check <a class="code" href="group__cobalt__core__synch.html#ga43fa3ecdc81f6ae157f840175c7ea091">xnsynch_acquire</a>(<span class="keyword">struct</span> xnsynch *synch,</div><div class="line"><a name="l00153"></a><span class="lineno"> 153</span>&#160; xnticks_t timeout,</div><div class="line"><a name="l00154"></a><span class="lineno"> 154</span>&#160; xntmode_t timeout_mode);</div><div class="line"><a name="l00155"></a><span class="lineno"> 155</span>&#160;</div><div class="line"><a name="l00156"></a><span class="lineno"> 156</span>&#160;<span class="keywordtype">int</span> __must_check <a class="code" href="group__cobalt__core__synch.html#gad5cad7eeaa18834c9ba8843511a67628">xnsynch_try_acquire</a>(<span class="keyword">struct</span> xnsynch *synch);</div><div class="line"><a name="l00157"></a><span class="lineno"> 157</span>&#160;</div><div class="line"><a name="l00158"></a><span class="lineno"> 158</span>&#160;<span class="keyword">struct </span>xnthread *<a class="code" href="group__cobalt__core__synch.html#gad38fe2be85e02bf1298418674ab6386f">xnsynch_release</a>(<span class="keyword">struct</span> xnsynch *synch,</div><div class="line"><a name="l00159"></a><span class="lineno"> 159</span>&#160; <span class="keyword">struct</span> xnthread *thread);</div><div class="line"><a name="l00160"></a><span class="lineno"> 160</span>&#160;</div><div class="line"><a name="l00161"></a><span class="lineno"> 161</span>&#160;<span class="keyword">struct </span>xnthread *<a class="code" href="group__cobalt__core__synch.html#ga4f98598194fa76a8b0ff298387429b9d">xnsynch_peek_pendq</a>(<span class="keyword">struct</span> xnsynch *synch);</div><div class="line"><a name="l00162"></a><span class="lineno"> 162</span>&#160;</div><div class="line"><a name="l00163"></a><span class="lineno"> 163</span>&#160;<span class="keywordtype">int</span> <a class="code" href="group__cobalt__core__synch.html#ga51febbfe4ff33ef18778fe9ecf62c43a">xnsynch_flush</a>(<span class="keyword">struct</span> xnsynch *synch, <span class="keywordtype">int</span> reason);</div><div class="line"><a name="l00164"></a><span class="lineno"> 164</span>&#160;</div><div class="line"><a name="l00165"></a><span class="lineno"> 165</span>&#160;<span class="keywordtype">void</span> xnsynch_release_all_ownerships(<span class="keyword">struct</span> xnthread *thread);</div><div class="line"><a name="l00166"></a><span class="lineno"> 166</span>&#160;</div><div class="line"><a name="l00167"></a><span class="lineno"> 167</span>&#160;<span class="keywordtype">void</span> xnsynch_requeue_sleeper(<span class="keyword">struct</span> xnthread *thread);</div><div class="line"><a name="l00168"></a><span class="lineno"> 168</span>&#160;</div><div class="line"><a name="l00169"></a><span class="lineno"> 169</span>&#160;<span class="keywordtype">void</span> xnsynch_forget_sleeper(<span class="keyword">struct</span> xnthread *thread);</div><div class="line"><a name="l00170"></a><span class="lineno"> 170</span>&#160;</div><div class="line"><a name="l00173"></a><span class="lineno"> 173</span>&#160;<span class="preprocessor">#endif </span><span class="comment">/* !_COBALT_KERNEL_SYNCH_H_ */</span><span class="preprocessor"></span></div><div class="ttc" id="group__cobalt__core__synch_html_ga51febbfe4ff33ef18778fe9ecf62c43a"><div class="ttname"><a href="group__cobalt__core__synch.html#ga51febbfe4ff33ef18778fe9ecf62c43a">xnsynch_flush</a></div><div class="ttdeci">int xnsynch_flush(struct xnsynch *synch, int reason)</div><div class="ttdoc">Unblock all waiters pending on a resource. </div><div class="ttdef"><b>Definition:</b> synch.c:810</div></div>
<div class="ttc" id="group__cobalt__core__synch_html_gad38fe2be85e02bf1298418674ab6386f"><div class="ttname"><a href="group__cobalt__core__synch.html#gad38fe2be85e02bf1298418674ab6386f">xnsynch_release</a></div><div class="ttdeci">struct xnthread * xnsynch_release(struct xnsynch *synch, struct xnthread *thread)</div><div class="ttdoc">Give the resource ownership to the next waiting thread. </div><div class="ttdef"><b>Definition:</b> synch.c:662</div></div>
<div class="ttc" id="group__cobalt__core__synch_html_gadd862461f55506485f04f4f98cdb6fb8"><div class="ttname"><a href="group__cobalt__core__synch.html#gadd862461f55506485f04f4f98cdb6fb8">xnsynch_destroy</a></div><div class="ttdeci">int xnsynch_destroy(struct xnsynch *synch)</div><div class="ttdoc">Destroy a synchronization object. </div><div class="ttdef"><b>Definition:</b> synch.c:117</div></div>
<div class="ttc" id="group__cobalt__core__synch_html_ga43fa3ecdc81f6ae157f840175c7ea091"><div class="ttname"><a href="group__cobalt__core__synch.html#ga43fa3ecdc81f6ae157f840175c7ea091">xnsynch_acquire</a></div><div class="ttdeci">int xnsynch_acquire(struct xnsynch *synch, xnticks_t timeout, xntmode_t timeout_mode)</div><div class="ttdoc">Acquire the ownership of a synchronization object. </div><div class="ttdef"><b>Definition:</b> synch.c:424</div></div>
<div class="ttc" id="group__cobalt__core__synch_html_ga43fa3ecdc81f6ae157f840175c7ea091"><div class="ttname"><a href="group__cobalt__core__synch.html#ga43fa3ecdc81f6ae157f840175c7ea091">xnsynch_acquire</a></div><div class="ttdeci">int __must_check xnsynch_acquire(struct xnsynch *synch, xnticks_t timeout, xntmode_t timeout_mode)</div><div class="ttdoc">Acquire the ownership of a synchronization object. </div><div class="ttdef"><b>Definition:</b> synch.c:424</div></div>
<div class="ttc" id="group__cobalt__core__synch_html_ga8096364cd5d717dae816c74dcc05a8ac"><div class="ttname"><a href="group__cobalt__core__synch.html#ga8096364cd5d717dae816c74dcc05a8ac">xnsynch_wakeup_this_sleeper</a></div><div class="ttdeci">void xnsynch_wakeup_this_sleeper(struct xnsynch *synch, struct xnthread *sleeper)</div><div class="ttdoc">Unblock a particular thread from wait. </div><div class="ttdef"><b>Definition:</b> synch.c:292</div></div>
<div class="ttc" id="group__cobalt__core__synch_html_ga54162964059c62d7a7b45ef22911662f"><div class="ttname"><a href="group__cobalt__core__synch.html#ga54162964059c62d7a7b45ef22911662f">xnsynch_wakeup_one_sleeper</a></div><div class="ttdeci">struct xnthread * xnsynch_wakeup_one_sleeper(struct xnsynch *synch)</div><div class="ttdoc">Unblock the heading thread from wait. </div><div class="ttdef"><b>Definition:</b> synch.c:216</div></div>
<div class="ttc" id="group__cobalt__core__synch_html_ga51cec970cb57608abe882c98bee72347"><div class="ttname"><a href="group__cobalt__core__synch.html#ga51cec970cb57608abe882c98bee72347">xnsynch_sleep_on</a></div><div class="ttdeci">int xnsynch_sleep_on(struct xnsynch *synch, xnticks_t timeout, xntmode_t timeout_mode)</div><div class="ttdoc">Sleep on an ownerless synchronization object. </div><div class="ttdef"><b>Definition:</b> synch.c:162</div></div>
<div class="ttc" id="group__cobalt__core__synch_html_ga51cec970cb57608abe882c98bee72347"><div class="ttname"><a href="group__cobalt__core__synch.html#ga51cec970cb57608abe882c98bee72347">xnsynch_sleep_on</a></div><div class="ttdeci">int __must_check xnsynch_sleep_on(struct xnsynch *synch, xnticks_t timeout, xntmode_t timeout_mode)</div><div class="ttdoc">Sleep on an ownerless synchronization object. </div><div class="ttdef"><b>Definition:</b> synch.c:162</div></div>
<div class="ttc" id="group__cobalt__core__synch_html_gafc3030603c9054b69f1abb44014f1838"><div class="ttname"><a href="group__cobalt__core__synch.html#gafc3030603c9054b69f1abb44014f1838">xnsynch_init</a></div><div class="ttdeci">void xnsynch_init(struct xnsynch *synch, int flags, atomic_t *fastlock)</div><div class="ttdoc">Initialize a synchronization object. </div><div class="ttdef"><b>Definition:</b> synch.c:81</div></div>
<div class="ttc" id="group__cobalt__core__synch_html_gad5cad7eeaa18834c9ba8843511a67628"><div class="ttname"><a href="group__cobalt__core__synch.html#gad5cad7eeaa18834c9ba8843511a67628">xnsynch_try_acquire</a></div><div class="ttdeci">int xnsynch_try_acquire(struct xnsynch *synch)</div><div class="ttdoc">Try acquiring the ownership of a synchronization object. </div><div class="ttdef"><b>Definition:</b> synch.c:360</div></div>
<div class="ttc" id="group__cobalt__core__synch_html_gad5cad7eeaa18834c9ba8843511a67628"><div class="ttname"><a href="group__cobalt__core__synch.html#gad5cad7eeaa18834c9ba8843511a67628">xnsynch_try_acquire</a></div><div class="ttdeci">int __must_check xnsynch_try_acquire(struct xnsynch *synch)</div><div class="ttdoc">Try acquiring the ownership of a synchronization object. </div><div class="ttdef"><b>Definition:</b> synch.c:360</div></div>
<div class="ttc" id="structatomic__t_html"><div class="ttname"><a href="structatomic__t.html">atomic_t</a></div><div class="ttdoc">Copyright © 2011 Gilles Chanteperdrix gilles.chanteperdrix@xenomai.org. </div><div class="ttdef"><b>Definition:</b> atomic.h:24</div></div>
<div class="ttc" id="group__cobalt__core__synch_html_ga4f98598194fa76a8b0ff298387429b9d"><div class="ttname"><a href="group__cobalt__core__synch.html#ga4f98598194fa76a8b0ff298387429b9d">xnsynch_peek_pendq</a></div><div class="ttdeci">struct xnthread * xnsynch_peek_pendq(struct xnsynch *synch)</div><div class="ttdoc">Access the thread leading a synch object wait queue. </div><div class="ttdef"><b>Definition:</b> synch.c:750</div></div>
</div><!-- fragment --></div><!-- contents -->
......
......@@ -72,7 +72,8 @@ $(document).ready(function(){initNavTree('lib_2cobalt_2internal_8h_source.html',
<div class="title">internal.h</div> </div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span>&#160;<span class="comment">/*</span></div><div class="line"><a name="l00002"></a><span class="lineno"> 2</span>&#160;<span class="comment"> * Copyright (C) 2008 Philippe Gerum &lt;rpm@xenomai.org&gt;.</span></div><div class="line"><a name="l00003"></a><span class="lineno"> 3</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00004"></a><span class="lineno"> 4</span>&#160;<span class="comment"> * This library is free software; you can redistribute it and/or</span></div><div class="line"><a name="l00005"></a><span class="lineno"> 5</span>&#160;<span class="comment"> * modify it under the terms of the GNU Lesser General Public</span></div><div class="line"><a name="l00006"></a><span class="lineno"> 6</span>&#160;<span class="comment"> * License as published by the Free Software Foundation; either</span></div><div class="line"><a name="l00007"></a><span class="lineno"> 7</span>&#160;<span class="comment"> * version 2 of the License, or (at your option) any later version.</span></div><div class="line"><a name="l00008"></a><span class="lineno"> 8</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00009"></a><span class="lineno"> 9</span>&#160;<span class="comment"> * This library is distributed in the hope that it will be useful,</span></div><div class="line"><a name="l00010"></a><span class="lineno"> 10</span>&#160;<span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div><div class="line"><a name="l00011"></a><span class="lineno"> 11</span>&#160;<span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU</span></div><div class="line"><a name="l00012"></a><span class="lineno"> 12</span>&#160;<span class="comment"> * Lesser General Public License for more details.</span></div><div class="line"><a name="l00013"></a><span class="lineno"> 13</span>&#160;<span class="comment"></span></div><div class="line"><a name="l00014"></a><span class="lineno"> 14</span>&#160;<span class="comment"> * You should have received a copy of the GNU Lesser General Public</span></div><div class="line"><a name="l00015"></a><span class="lineno"> 15</span>&#160;<span class="comment"> * License along with this library; if not, write to the Free Software</span></div><div class="line"><a name="l00016"></a><span class="lineno"> 16</span>&#160;<span class="comment"> * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.</span></div><div class="line"><a name="l00017"></a><span class="lineno"> 17</span>&#160;<span class="comment"> */</span></div><div class="line"><a name="l00018"></a><span class="lineno"> 18</span>&#160;<span class="preprocessor">#ifndef _LIB_COBALT_INTERNAL_H</span></div><div class="line"><a name="l00019"></a><span class="lineno"> 19</span>&#160;<span class="preprocessor">#define _LIB_COBALT_INTERNAL_H</span></div><div class="line"><a name="l00020"></a><span class="lineno"> 20</span>&#160;</div><div class="line"><a name="l00021"></a><span class="lineno"> 21</span>&#160;<span class="preprocessor">#include &lt;limits.h&gt;</span></div><div class="line"><a name="l00022"></a><span class="lineno"> 22</span>&#160;<span class="preprocessor">#include &lt;cobalt/sys/cobalt.h&gt;</span></div><div class="line"><a name="l00023"></a><span class="lineno"> 23</span>&#160;<span class="preprocessor">#include &lt;boilerplate/ancillaries.h&gt;</span></div><div class="line"><a name="l00024"></a><span class="lineno"> 24</span>&#160;<span class="preprocessor">#include &quot;current.h&quot;</span></div><div class="line"><a name="l00025"></a><span class="lineno"> 25</span>&#160;</div><div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160;<span class="keyword">extern</span> <span class="keywordtype">void</span> *cobalt_umm_private;</div><div class="line"><a name="l00027"></a><span class="lineno"> 27</span>&#160;</div><div class="line"><a name="l00028"></a><span class="lineno"> 28</span>&#160;<span class="keyword">extern</span> <span class="keywordtype">void</span> *cobalt_umm_shared;</div><div class="line"><a name="l00029"></a><span class="lineno"> 29</span>&#160;</div><div class="line"><a name="l00030"></a><span class="lineno"> 30</span>&#160;<span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">int</span> cobalt_is_relaxed(<span class="keywordtype">void</span>)</div><div class="line"><a name="l00031"></a><span class="lineno"> 31</span>&#160;{</div><div class="line"><a name="l00032"></a><span class="lineno"> 32</span>&#160; <span class="keywordflow">return</span> cobalt_get_current_mode() &amp; <a class="code" href="group__cobalt__core__thread__states.html#gadf5508cd88c2678ae01dfaf5570c661c">XNRELAX</a>;</div><div class="line"><a name="l00033"></a><span class="lineno"> 33</span>&#160;}</div><div class="line"><a name="l00034"></a><span class="lineno"> 34</span>&#160;</div><div class="line"><a name="l00035"></a><span class="lineno"> 35</span>&#160;<span class="keyword">static</span> <span class="keyword">inline</span></div><div class="line"><a name="l00036"></a><span class="lineno"> 36</span>&#160;<span class="keyword">struct </span>cobalt_mutex_state *mutex_get_state(<span class="keyword">struct</span> cobalt_mutex_shadow *shadow)</div><div class="line"><a name="l00037"></a><span class="lineno"> 37</span>&#160;{</div><div class="line"><a name="l00038"></a><span class="lineno"> 38</span>&#160; <span class="keywordflow">if</span> (shadow-&gt;attr.pshared)</div><div class="line"><a name="l00039"></a><span class="lineno"> 39</span>&#160; <span class="keywordflow">return</span> cobalt_umm_shared + shadow-&gt;state_offset;</div><div class="line"><a name="l00040"></a><span class="lineno"> 40</span>&#160;</div><div class="line"><a name="l00041"></a><span class="lineno"> 41</span>&#160; <span class="keywordflow">return</span> cobalt_umm_private + shadow-&gt;state_offset;</div><div class="line"><a name="l00042"></a><span class="lineno"> 42</span>&#160;}</div><div class="line"><a name="l00043"></a><span class="lineno"> 43</span>&#160;</div><div class="line"><a name="l00044"></a><span class="lineno"> 44</span>&#160;<span class="keyword">static</span> <span class="keyword">inline</span> <a class="code" href="structatomic__t.html">atomic_t</a> *mutex_get_ownerp(<span class="keyword">struct</span> cobalt_mutex_shadow *shadow)</div><div class="line"><a name="l00045"></a><span class="lineno"> 45</span>&#160;{</div><div class="line"><a name="l00046"></a><span class="lineno"> 46</span>&#160; <span class="keywordflow">return</span> &amp;mutex_get_state(shadow)-&gt;owner;</div><div class="line"><a name="l00047"></a><span class="lineno"> 47</span>&#160;}</div><div class="line"><a name="l00048"></a><span class="lineno"> 48</span>&#160;</div><div class="line"><a name="l00049"></a><span class="lineno"> 49</span>&#160;<span class="keywordtype">void</span> cobalt_sigshadow_install_once(<span class="keywordtype">void</span>);</div><div class="line"><a name="l00050"></a><span class="lineno"> 50</span>&#160;</div><div class="line"><a name="l00051"></a><span class="lineno"> 51</span>&#160;<span class="keywordtype">void</span> cobalt_thread_init(<span class="keywordtype">void</span>);</div><div class="line"><a name="l00052"></a><span class="lineno"> 52</span>&#160;</div><div class="line"><a name="l00053"></a><span class="lineno"> 53</span>&#160;<span class="keywordtype">int</span> cobalt_thread_probe(pid_t pid);</div><div class="line"><a name="l00054"></a><span class="lineno"> 54</span>&#160;</div><div class="line"><a name="l00055"></a><span class="lineno"> 55</span>&#160;<span class="keywordtype">void</span> cobalt_print_init(<span class="keywordtype">void</span>);</div><div class="line"><a name="l00056"></a><span class="lineno"> 56</span>&#160;</div><div class="line"><a name="l00057"></a><span class="lineno"> 57</span>&#160;<span class="keywordtype">void</span> cobalt_print_init_atfork(<span class="keywordtype">void</span>);</div><div class="line"><a name="l00058"></a><span class="lineno"> 58</span>&#160;</div><div class="line"><a name="l00059"></a><span class="lineno"> 59</span>&#160;<span class="keywordtype">void</span> cobalt_ticks_init(<span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> <span class="keywordtype">long</span> freq);</div><div class="line"><a name="l00060"></a><span class="lineno"> 60</span>&#160;</div><div class="line"><a name="l00061"></a><span class="lineno"> 61</span>&#160;<span class="keywordtype">void</span> cobalt_mutex_init(<span class="keywordtype">void</span>);</div><div class="line"><a name="l00062"></a><span class="lineno"> 62</span>&#160;</div><div class="line"><a name="l00063"></a><span class="lineno"> 63</span>&#160;<span class="keywordtype">void</span> cobalt_default_condattr_init(<span class="keywordtype">void</span>);</div><div class="line"><a name="l00064"></a><span class="lineno"> 64</span>&#160;</div><div class="line"><a name="l00065"></a><span class="lineno"> 65</span>&#160;<span class="keywordtype">int</span> cobalt_xlate_schedparam(<span class="keywordtype">int</span> policy,</div><div class="line"><a name="l00066"></a><span class="lineno"> 66</span>&#160; <span class="keyword">const</span> <span class="keyword">struct</span> sched_param_ex *param_ex,</div><div class="line"><a name="l00067"></a><span class="lineno"> 67</span>&#160; <span class="keyword">struct</span> sched_param *param);</div><div class="line"><a name="l00068"></a><span class="lineno"> 68</span>&#160;<span class="keywordtype">int</span> cobalt_init(<span class="keywordtype">void</span>);</div><div class="line"><a name="l00069"></a><span class="lineno"> 69</span>&#160;</div><div class="line"><a name="l00070"></a><span class="lineno"> 70</span>&#160;<span class="keyword">struct </span>cobalt_featinfo;</div><div class="line"><a name="l00071"></a><span class="lineno"> 71</span>&#160;</div><div class="line"><a name="l00072"></a><span class="lineno"> 72</span>&#160;<span class="keywordtype">void</span> cobalt_check_features(<span class="keyword">struct</span> cobalt_featinfo *finfo);</div><div class="line"><a name="l00073"></a><span class="lineno"> 73</span>&#160;</div><div class="line"><a name="l00074"></a><span class="lineno"> 74</span>&#160;<span class="keyword">extern</span> <span class="keyword">struct </span>sigaction __cobalt_orig_sigdebug;</div><div class="line"><a name="l00075"></a><span class="lineno"> 75</span>&#160;</div><div class="line"><a name="l00076"></a><span class="lineno"> 76</span>&#160;<span class="preprocessor">#ifdef __ARM_EABI__</span></div><div class="line"><a name="l00077"></a><span class="lineno"> 77</span>&#160;<span class="keyword">typedef</span> uint32_t __guard;</div><div class="line"><a name="l00078"></a><span class="lineno"> 78</span>&#160;<span class="preprocessor">#else</span></div><div class="line"><a name="l00079"></a><span class="lineno"> 79</span>&#160;<span class="keyword">typedef</span> uint64_t __guard;</div><div class="line"><a name="l00080"></a><span class="lineno"> 80</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00081"></a><span class="lineno"> 81</span>&#160;<span class="keywordtype">int</span> __real___cxa_guard_acquire(__guard*);</div><div class="line"><a name="l00082"></a><span class="lineno"> 82</span>&#160;<span class="keywordtype">void</span> __real___cxa_guard_release(__guard*);</div><div class="line"><a name="l00083"></a><span class="lineno"> 83</span>&#160;<span class="keywordtype">void</span> __real___cxa_guard_abort(__guard*);</div><div class="line"><a name="l00084"></a><span class="lineno"> 84</span>&#160;<span class="keywordtype">int</span> __cxa_guard_acquire(__guard*);</div><div class="line"><a name="l00085"></a><span class="lineno"> 85</span>&#160;<span class="keywordtype">void</span> __cxa_guard_release(__guard*);</div><div class="line"><a name="l00086"></a><span class="lineno"> 86</span>&#160;<span class="keywordtype">void</span> __cxa_guard_abort(__guard*);</div><div class="line"><a name="l00087"></a><span class="lineno"> 87</span>&#160;</div><div class="line"><a name="l00088"></a><span class="lineno"> 88</span>&#160;<span class="preprocessor">#endif </span><span class="comment">/* _LIB_COBALT_INTERNAL_H */</span><span class="preprocessor"></span></div><div class="ttc" id="structatomic__t_html"><div class="ttname"><a href="structatomic__t.html">atomic_t</a></div><div class="ttdoc">Copyright © 2011 Gilles Chanteperdrix gilles.chanteperdrix@xenomai.org. </div><div class="ttdef"><b>Definition:</b> atomic.h:24</div></div>
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span>&#160;<span class="comment">/*</span></div><div class="line"><a name="l00002"></a><span class="lineno"> 2</span>&#160;<span class="comment"> * Copyright (C) 2008 Philippe Gerum &lt;rpm@xenomai.org&gt;.</span></div><div class="line"><a name="l00003"></a><span class="lineno"> 3</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00004"></a><span class="lineno"> 4</span>&#160;<span class="comment"> * This library is free software; you can redistribute it and/or</span></div><div class="line"><a name="l00005"></a><span class="lineno"> 5</span>&#160;<span class="comment"> * modify it under the terms of the GNU Lesser General Public</span></div><div class="line"><a name="l00006"></a><span class="lineno"> 6</span>&#160;<span class="comment"> * License as published by the Free Software Foundation; either</span></div><div class="line"><a name="l00007"></a><span class="lineno"> 7</span>&#160;<span class="comment"> * version 2 of the License, or (at your option) any later version.</span></div><div class="line"><a name="l00008"></a><span class="lineno"> 8</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00009"></a><span class="lineno"> 9</span>&#160;<span class="comment"> * This library is distributed in the hope that it will be useful,</span></div><div class="line"><a name="l00010"></a><span class="lineno"> 10</span>&#160;<span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div><div class="line"><a name="l00011"></a><span class="lineno"> 11</span>&#160;<span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU</span></div><div class="line"><a name="l00012"></a><span class="lineno"> 12</span>&#160;<span class="comment"> * Lesser General Public License for more details.</span></div><div class="line"><a name="l00013"></a><span class="lineno"> 13</span>&#160;<span class="comment"></span></div><div class="line"><a name="l00014"></a><span class="lineno"> 14</span>&#160;<span class="comment"> * You should have received a copy of the GNU Lesser General Public</span></div><div class="line"><a name="l00015"></a><span class="lineno"> 15</span>&#160;<span class="comment"> * License along with this library; if not, write to the Free Software</span></div><div class="line"><a name="l00016"></a><span class="lineno"> 16</span>&#160;<span class="comment"> * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.</span></div><div class="line"><a name="l00017"></a><span class="lineno"> 17</span>&#160;<span class="comment"> */</span></div><div class="line"><a name="l00018"></a><span class="lineno"> 18</span>&#160;<span class="preprocessor">#ifndef _LIB_COBALT_INTERNAL_H</span></div><div class="line"><a name="l00019"></a><span class="lineno"> 19</span>&#160;<span class="preprocessor">#define _LIB_COBALT_INTERNAL_H</span></div><div class="line"><a name="l00020"></a><span class="lineno"> 20</span>&#160;</div><div class="line"><a name="l00021"></a><span class="lineno"> 21</span>&#160;<span class="preprocessor">#include &lt;limits.h&gt;</span></div><div class="line"><a name="l00022"></a><span class="lineno"> 22</span>&#160;<span class="preprocessor">#include &lt;cobalt/sys/cobalt.h&gt;</span></div><div class="line"><a name="l00023"></a><span class="lineno"> 23</span>&#160;<span class="preprocessor">#include &lt;boilerplate/ancillaries.h&gt;</span></div><div class="line"><a name="l00024"></a><span class="lineno"> 24</span>&#160;<span class="preprocessor">#include &quot;current.h&quot;</span></div><div class="line"><a name="l00025"></a><span class="lineno"> 25</span>&#160;</div><div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160;<span class="keyword">extern</span> <span class="keywordtype">void</span> *cobalt_umm_private;</div><div class="line"><a name="l00027"></a><span class="lineno"> 27</span>&#160;</div><div class="line"><a name="l00028"></a><span class="lineno"> 28</span>&#160;<span class="keyword">extern</span> <span class="keywordtype">void</span> *cobalt_umm_shared;</div><div class="line"><a name="l00029"></a><span class="lineno"> 29</span>&#160;</div><div class="line"><a name="l00030"></a><span class="lineno"> 30</span>&#160;<span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">int</span> cobalt_is_relaxed(<span class="keywordtype">void</span>)</div><div class="line"><a name="l00031"></a><span class="lineno"> 31</span>&#160;{</div><div class="line"><a name="l00032"></a><span class="lineno"> 32</span>&#160; <span class="keywordflow">return</span> cobalt_get_current_mode() &amp; <a class="code" href="group__cobalt__core__thread__states.html#gadf5508cd88c2678ae01dfaf5570c661c">XNRELAX</a>;</div><div class="line"><a