Initial commit.

This commit is contained in:
2017-10-26 19:57:24 +02:00
commit 9ce8b5485d
1090 changed files with 47036 additions and 0 deletions
@@ -0,0 +1,63 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>MPI On Cell (Documentation): src/ppu/internal/dma/imoc_dma-tags_ppu.c Source File</title>
<link href="../../doxygen.css" rel="stylesheet" type="text/css">
<link href="../../tabs.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.5.6 -->
<div class="navigation" id="top">
<div class="tabs">
<ul>
<li><a href="../../main.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="../../modules.html"><span>Modules</span></a></li>
<li><a href="../../annotated.html"><span>Data&nbsp;Structures</span></a></li>
<li class="current"><a href="../../files.html"><span>Files</span></a></li>
</ul>
</div>
<h1>src/ppu/internal/dma/imoc_dma-tags_ppu.c</h1><a href="../../d0/dba/imoc__dma-tags__ppu_8c.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="preprocessor">#include &lt;stdint.h&gt;</span>
<a name="l00002"></a>00002
<a name="l00003"></a>00003 <span class="preprocessor">#include &lt;<a class="code" href="../../d0/d3a/spu_2moc_8h.html">moc.h</a>&gt;</span>
<a name="l00004"></a>00004 <span class="preprocessor">#include &lt;<a class="code" href="../../d6/d09/imoc__core__ppu_8h.html">internal/ppu/imoc_core_ppu.h</a>&gt;</span>
<a name="l00005"></a>00005 <span class="preprocessor">#include &lt;<a class="code" href="../../de/df9/imoc__dma__ppu_8h.html">internal/ppu/imoc_dma_ppu.h</a>&gt;</span>
<a name="l00006"></a>00006
<a name="l00007"></a>00007 <span class="comment">/*</span>
<a name="l00008"></a>00008 <span class="comment"> * Methods for PPE tag reservation system needed for IGet and IPut. Per SPE the PPE can reserve Tags 0-14. Tag 15 is used by</span>
<a name="l00009"></a>00009 <span class="comment"> * blocking Get and Put, and more tags are not allowed on the PPE</span>
<a name="l00010"></a>00010 <span class="comment"> */</span>
<a name="l00011"></a>00011
<a name="l00012"></a><a class="code" href="../../d0/dba/imoc__dma-tags__ppu_8c.html#cf3af1b7d35fd283c6038a63e44d80cf">00012</a> <span class="keyword">static</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> <a class="code" href="../../d0/dba/imoc__dma-tags__ppu_8c.html#cf3af1b7d35fd283c6038a63e44d80cf">tags</a>[8];
<a name="l00013"></a>00013
<a name="l00014"></a><a class="code" href="../../d2/de2/group__internal__p2p__dma.html#g29d3bf9879af70f97d63e774a5aa4d33">00014</a> <span class="keywordtype">int</span> <a class="code" href="../../d2/de2/group__internal__p2p__dma.html#g29d3bf9879af70f97d63e774a5aa4d33" title="Reserves a tag on the ppu, for communication with a given spu.">moc_tag_reserve</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> speid)
<a name="l00015"></a>00015 {
<a name="l00016"></a>00016 <span class="keywordflow">if</span> (speid &gt; 8)
<a name="l00017"></a>00017 <span class="keywordflow">return</span> <a class="code" href="../../d8/da1/group__environment__error.html#g05b3a70831c823a59014c4853a76ca7e" title="Internal MOC (implementation) error.">MOC_ERR_INTERN</a>;
<a name="l00018"></a>00018 <span class="keywordtype">int</span> i;
<a name="l00019"></a>00019 <span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> bit_tag = 1;
<a name="l00020"></a>00020 <span class="keywordflow">for</span> (i = 0; i &lt; 15; i++)
<a name="l00021"></a>00021 {
<a name="l00022"></a>00022 <span class="comment">// if last position is a zero the number is even</span>
<a name="l00023"></a>00023 <span class="keywordflow">if</span> ((<a class="code" href="../../d0/dba/imoc__dma-tags__ppu_8c.html#cf3af1b7d35fd283c6038a63e44d80cf">tags</a>[speid] &gt;&gt; i) % 2 == 0)
<a name="l00024"></a>00024 {
<a name="l00025"></a>00025 <a class="code" href="../../d0/dba/imoc__dma-tags__ppu_8c.html#cf3af1b7d35fd283c6038a63e44d80cf">tags</a>[speid] |= bit_tag &lt;&lt; i; <span class="comment">// set the bit found to 1</span>
<a name="l00026"></a>00026 <span class="keywordflow">return</span> i;
<a name="l00027"></a>00027 }
<a name="l00028"></a>00028 }
<a name="l00029"></a>00029 <span class="keywordflow">return</span> <a class="code" href="../../d8/da1/group__environment__error.html#g05b3a70831c823a59014c4853a76ca7e" title="Internal MOC (implementation) error.">MOC_ERR_INTERN</a>;
<a name="l00030"></a>00030 }
<a name="l00031"></a>00031
<a name="l00032"></a><a class="code" href="../../d2/de2/group__internal__p2p__dma.html#gf465203c58c5a8066a7ef3ee91b15cec">00032</a> <span class="keywordtype">int</span> <a class="code" href="../../d2/de2/group__internal__p2p__dma.html#gf465203c58c5a8066a7ef3ee91b15cec" title="Releases a reserved tag.">moc_tag_release</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> speid, <span class="keywordtype">int</span> tag)
<a name="l00033"></a>00033 {
<a name="l00034"></a>00034 <span class="keywordflow">if</span> ((speid &gt; 8) || (tag &lt; 0) || (tag &gt; 14))
<a name="l00035"></a>00035 <span class="keywordflow">return</span> <a class="code" href="../../d8/da1/group__environment__error.html#g05b3a70831c823a59014c4853a76ca7e" title="Internal MOC (implementation) error.">MOC_ERR_INTERN</a>;
<a name="l00036"></a>00036 <span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> bit_tag = 1;
<a name="l00037"></a>00037 bit_tag = bit_tag &lt;&lt; tag; <span class="comment">// translate the tag X to the bitmask with a 1 on only the Xth position</span>
<a name="l00038"></a>00038 bit_tag = ~bit_tag; <span class="comment">// invert it so the position can be removed by bitwise AND</span>
<a name="l00039"></a>00039 <a class="code" href="../../d0/dba/imoc__dma-tags__ppu_8c.html#cf3af1b7d35fd283c6038a63e44d80cf">tags</a>[speid] &amp;= bit_tag;
<a name="l00040"></a>00040 <span class="keywordflow">return</span> <a class="code" href="../../d8/da1/group__environment__error.html#g8a73ed6676bcf0c0607d98482ca1aca4" title="No error.">MOC_SUCCESS</a>;
<a name="l00041"></a>00041 }
</pre></div></div>
<hr size="1"><address style="text-align: right;"><small>Generated on Thu Feb 12 13:49:47 2009 for MPI On Cell (Documentation) by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="../../doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.6 </small></address>
</body>
</html>