宏函数writesb writesw writesl 与readsb readsw readsl详解

<h1 id="subject_tpc" class="read_h1">writesb(), writesw(), writesl() 宏函数</h1>
<p><strong>功能</strong>
:</p>
<ul style="margin: 0pt 0pt 0pt 15px;">
<li>writesb() I/O 上写入 8 位数据流数据 (1字节)</li>
<li>writesw() I/O 上写入 16 位流数据 (2字节)</li>
<li>writesl() I/O 上写入 32 位流数据 ( 4字节 )</li>
</ul>
<p><strong>原型</strong>
:<br><span style="color: #008800;"> </span>
</p>
<blockquote class="blockquote3">
<div class="quote">引用 </div>
<div class="text">
<span style="color: #008800;">#include &lt;asm/io.h&gt;</span>
<br><br><strong><span style="color: #00bb00;">void</span>
</strong>
<span style="color: #000000;">writesb</span>
(<strong><span style="color: #00bb00;">unsigned</span>
</strong>
<strong><span style="color: #00bb00;">short</span>
</strong>
<span style="color: #000000;">ioaddr</span>
<span style="color: #000000;">,</span>
<strong><span style="color: #00bb00;">void</span>
</strong>
<span style="color: #666666;">*</span>
<span style="color: #000000;">addr</span>
<span style="color: #000000;">,</span>
<strong><span style="color: #00bb00;">unsigned</span>
</strong>
<strong><span style="color: #00bb00;">long</span>
</strong>
<span style="color: #000000;">count</span>
)<br><strong><span style="color: #00bb00;">void</span>
</strong>
<span style="color: #000000;">writesw</span>
(<strong><span style="color: #00bb00;">unsigned</span>
</strong>
<strong><span style="color: #00bb00;">short</span>
</strong>
<span style="color: #000000;">ioaddr</span>
<span style="color: #000000;">,</span>
<strong><span style="color: #00bb00;">void</span>
</strong>
<span style="color: #666666;">*</span>
<span style="color: #000000;">addr</span>
<span style="color: #000000;">,</span>
<strong><span style="color: #00bb00;">unsigned</span>
</strong>
<strong><span style="color: #00bb00;">long</span>
</strong>
<span style="color: #000000;">count</span>
)<br><strong><span style="color: #00bb00;">void</span>
</strong>
<span style="color: #000000;">writesl</span>
(<strong><span style="color: #00bb00;">unsigned</span>
</strong>
<strong><span style="color: #00bb00;">short</span>
</strong>
<span style="color: #000000;">ioaddr</span>
<span style="color: #000000;">,</span>
<strong><span style="color: #00bb00;">void</span>
</strong>
<span style="color: #666666;">*</span>
<span style="color: #000000;">addr</span>
<span style="color: #000000;">,</span>
<strong><span style="color: #00bb00;">unsigned</span>
</strong>
<strong><span style="color: #00bb00;">long</span>
</strong>
<span style="color: #000000;">count</span>
)</div>
</blockquote>
<p><br><br><strong>说明</strong>
:<br>
从内存映射的 I/O 空间,把 addr 指定的内存空间数据,以 count 大小连续写入 ioaddr 指定的地址上。<br><br><strong>变量</strong>
:</p>
<ul style="margin: 0pt 0pt 0pt 15px;">
<li>ioaddr I/O 指定地址;</li>
<li>addr 内存缓存起始地址;</li>
<li>count 写入数据的量</li>
</ul>
<p></p>
<p></p>
<p></p>
<h1 id="subject_tpc" class="read_h1">readsb(), readsw(), readsl() 宏函数</h1>
<p></p>
<p><strong>功能</strong>
:</p>
<ul style="margin: 0pt 0pt 0pt 15px;">
<li>readsb() 从 I/O 读取 8 位数据流 ( 1字节 )</li>
<li>readsw() 从 I/O 读取 16位数据流 ( 2字节 )</li>
<li>readsl() 从 I/O 读取 32 位数据流 ( 4 字节 )</li>
</ul>
<p><strong>原型</strong>
:<br><span style="color: #008800;"> </span>
</p>
<blockquote class="blockquote3">
<div class="quote">引用 </div>
<div class="text">
<span style="color: #008800;">#include &lt;asm/io.h&gt;</span>
<br><br><strong><span style="color: #00bb00;">void</span>
</strong>
<span style="color: #000000;">readsb</span>
(<span style="color: #000000;">unsgined</span>
<strong><span style="color: #00bb00;">short</span>
</strong>
<span style="color: #000000;">ioaddr</span>
<span style="color: #000000;">,</span>
<strong><span style="color: #00bb00;">void</span>
</strong>
<span style="color: #666666;">*</span>
<span style="color: #000000;">addr</span>
<span style="color: #000000;">,</span>
<strong><span style="color: #00bb00;">unsigned</span>
</strong>
<strong><span style="color: #00bb00;">long</span>
</strong>
<span style="color: #000000;">count</span>
)<br><strong><span style="color: #00bb00;">void</span>
</strong>
<span style="color: #000000;">readsw</span>
(<span style="color: #000000;">unsgined</span>
<strong><span style="color: #00bb00;">short</span>
</strong>
<span style="color: #000000;">ioaddr</span>
<span style="color: #000000;">,</span>
<strong><span style="color: #00bb00;">void</span>
</strong>
<span style="color: #666666;">*</span>
<span style="color: #000000;">addr</span>
<span style="color: #000000;">,</span>
<strong><span style="color: #00bb00;">unsigned</span>
</strong>
<strong><span style="color: #00bb00;">long</span>
</strong>
<span style="color: #000000;">count</span>
)<br><strong><span style="color: #00bb00;">void</span>
</strong>
<span style="color: #000000;">readsl</span>
(<span style="color: #000000;">unsgined</span>
<strong><span style="color: #00bb00;">short</span>
</strong>
<span style="color: #000000;">ioaddr</span>
<span style="color: #000000;">,</span>
<strong><span style="color: #00bb00;">void</span>
</strong>
<span style="color: #666666;">*</span>
<span style="color: #000000;">addr</span>
<span style="color: #000000;">,</span>
<strong><span style="color: #00bb00;">unsigned</span>
</strong>
<strong><span style="color: #00bb00;">long</span>
</strong>
<span style="color: #000000;">count</span>
)</div>
</blockquote>
<p><br><br><strong>说明</strong>
:<br>
从内存映射的 I/O 空间,在 loadder 指定的地址上,以 count 大小连续读取数据,然后写入 addr 指定的内存空间。<br><br><strong>变量</strong>
:</p>
<ul style="margin: 0pt 0pt 0pt 15px;">
<li>ioaddr I/O地址</li>
<li>addr 内存缓存起始地址</li>
<li>count 读取数据的数量</li>
</ul>

你可能感兴趣的:(write)