Sophie

Sophie

distrib > CentOS > 6 > i386 > by-pkgid > cf93d8a8acdcc6fe2225039da0502495 > files > 3765

kernel-doc-2.6.32-131.17.1.el6.centos.plus.noarch.rpm

<?xml version="1.0" encoding="ANSI_X3.4-1968" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968" /><title>Waiting for interrupts</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /><link rel="home" href="index.html" title="The Userspace I/O HOWTO" /><link rel="up" href="userspace_driver.html" title="Chapter&#160;4.&#160;Writing a driver in userspace" /><link rel="prev" href="ch04s02.html" title="mmap() device memory" /><link rel="next" href="uio_pci_generic.html" title="Chapter&#160;5.&#160;Generic PCI UIO driver" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Waiting for interrupts</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch04s02.html">Prev</a>&#160;</td><th width="60%" align="center">Chapter&#160;4.&#160;Writing a driver in userspace</th><td width="20%" align="right">&#160;<a accesskey="n" href="uio_pci_generic.html">Next</a></td></tr></table><hr /></div><div class="sect1" title="Waiting for interrupts"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="wait_for_interrupts"></a>Waiting for interrupts</h2></div></div></div><p>
	After you successfully mapped your devices memory, you
	can access it like an ordinary array. Usually, you will
	perform some initialization. After that, your hardware
	starts working and will generate an interrupt as soon
	as it's finished, has some data available, or needs your
	attention because an error occured.
	</p><p>
	<code class="filename">/dev/uioX</code> is a read-only file. A
	<code class="function">read()</code> will always block until an
	interrupt occurs. There is only one legal value for the
	<code class="varname">count</code> parameter of
	<code class="function">read()</code>, and that is the size of a
	signed 32 bit integer (4). Any other value for
	<code class="varname">count</code> causes <code class="function">read()</code>
	to fail. The signed 32 bit integer read is the interrupt
	count of your device. If the value is one more than the value
	you read the last time, everything is OK. If the difference
	is greater than one, you missed interrupts.
	</p><p>
	You can also use <code class="function">select()</code> on
	<code class="filename">/dev/uioX</code>.
	</p></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch04s02.html">Prev</a>&#160;</td><td width="20%" align="center"><a accesskey="u" href="userspace_driver.html">Up</a></td><td width="40%" align="right">&#160;<a accesskey="n" href="uio_pci_generic.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">mmap() device memory&#160;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">&#160;Chapter&#160;5.&#160;Generic PCI UIO driver</td></tr></table></div></body></html>