<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
	"http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" []>

<book id="Generic-IRQ-Guide">
 <bookinfo>
  <title>Linux generic IRQ handling</title>

  <authorgroup>
   <author>
    <firstname>Thomas</firstname>
    <surname>Gleixner</surname>
    <affiliation>
     <address>
      <email>tglx@linutronix.de</email>
     </address>
    </affiliation>
   </author>
   <author>
    <firstname>Ingo</firstname>
    <surname>Molnar</surname>
    <affiliation>
     <address>
      <email>mingo@elte.hu</email>
     </address>
    </affiliation>
   </author>
  </authorgroup>

  <copyright>
   <year>2005-2006</year>
   <holder>Thomas Gleixner</holder>
  </copyright>
  <copyright>
   <year>2005-2006</year>
   <holder>Ingo Molnar</holder>
  </copyright>

  <legalnotice>
   <para>
     This documentation is free software; you can redistribute
     it and/or modify it under the terms of the GNU General Public
     License version 2 as published by the Free Software Foundation.
   </para>

   <para>
     This program is distributed in the hope that it will be
     useful, but WITHOUT ANY WARRANTY; without even the implied
     warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
     See the GNU General Public License for more details.
   </para>

   <para>
     You should have received a copy of the GNU General Public
     License along with this program; if not, write to the Free
     Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
     MA 02111-1307 USA
   </para>

   <para>
     For more details see the file COPYING in the source
     distribution of Linux.
   </para>
  </legalnotice>
 </bookinfo>

<toc></toc>

  <chapter id="intro">
    <title>Introduction</title>
    <para>
	The generic interrupt handling layer is designed to provide a
	complete abstraction of interrupt handling for device drivers.
	It is able to handle all the different types of interrupt controller
	hardware. Device drivers use generic API functions to request, enable,
	disable and free interrupts. The drivers do not have to know anything
	about interrupt hardware details, so they can be used on different
	platforms without code changes.
    </para>
    <para>
  	This documentation is provided to developers who want to implement
	an interrupt subsystem based for their architecture, with the help
	of the generic IRQ handling layer.
    </para>
  </chapter>

  <chapter id="rationale">
    <title>Rationale</title>
	<para>
	The original implementation of interrupt handling in Linux is using
	the __do_IRQ() super-handler, which is able to deal with every
	type of interrupt logic.
	</para>
	<para>
	Originally, Russell King identified different types of handlers to
	build a quite universal set for the ARM interrupt handler
	implementation in Linux 2.5/2.6. He distinguished between:
	<itemizedlist>
	  <listitem><para>Level type</para></listitem>
	  <listitem><para>Edge type</para></listitem>
	  <listitem><para>Simple type</para></listitem>
	</itemizedlist>
	In the SMP world of the __do_IRQ() super-handler another type
	was identified:
	<itemizedlist>
	  <listitem><para>Per CPU type</para></listitem>
	</itemizedlist>
	</para>
	<para>
	This split implementation of highlevel IRQ handlers allows us to
	optimize the flow of the interrupt handling for each specific
	interrupt type. This reduces complexity in that particular codepath
	and allows the optimized handling of a given type.
	</para>
	<para>
	The original general IRQ implementation used hw_interrupt_type
	structures and their ->ack(), ->end() [etc.] callbacks to
	differentiate the flow control in the super-handler. This leads to
	a mix of flow logic and lowlevel hardware logic, and it also leads
	to unnecessary code duplication: for example in i386, there is a
	ioapic_level_irq and a ioapic_edge_irq irq-type which share many
	of the lowlevel details but have different flow handling.
	</para>
	<para>
	A more natural abstraction is the clean separation of the
	'irq flow' and the 'chip details'.
	</para>
	<para>
	Analysing a couple of architecture's IRQ subsystem implementations
	reveals that most of them can use a generic set of 'irq flow'
	methods and only need to add the chip level specific code.
	The separation is also valuable for (sub)architectures
	which need specific quirks in the irq flow itself but not in the
	chip-details - and thus provides a more transparent IRQ subsystem
	design.
	</para>
	<para>
	Each interrupt descriptor is assigned its own highlevel flow
	handler, which is normally one of the generic
	implementations. (This highlevel flow handler implementation also
	makes it simple to provide demultiplexing handlers which can be
	found in embedded platforms on various architectures.)
	</para>
	<para>
	The separation makes the generic interrupt handling layer more
	flexible and extensible. For example, an (sub)architecture can
	use a generic irq-flow implementation for 'level type' interrupts
	and add a (sub)architecture specific 'edge type' implementation.
	</para>
	<para>
	To make the transition to the new model easier and prevent the
	breakage of existing implementations, the __do_IRQ() super-handler
	is still available. This leads to a kind of duality for the time
	being. Over time the new model should be used in more and more
	architectures, as it enables smaller and cleaner IRQ subsystems.
	</para>
  </chapter>
  <chapter id="bugs">
    <title>Known Bugs And Assumptions</title>
    <para>
	None (knock on wood).
    </para>
  </chapter>

  <chapter id="Abstraction">
    <title>Abstraction layers</title>
    <para>
	There are three main levels of abstraction in the interrupt code:
	<orderedlist>
	  <listitem><para>Highlevel driver API</para></listitem>
	  <listitem><para>Highlevel IRQ flow handlers</para></listitem>
	  <listitem><para>Chiplevel hardware encapsulation</para></listitem>
	</orderedlist>
    </para>
    <sect1>
	<title>Interrupt control flow</title>
	<para>
	Each interrupt is described by an interrupt descriptor structure
	irq_desc. The interrupt is referenced by an 'unsigned int' numeric
	value which selects the corresponding interrupt decription structure
	in the descriptor structures array.
	The descriptor structure contains status information and pointers
	to the interrupt flow method and the interrupt chip structure
	which are assigned to this interrupt.
	</para>
	<para>
	Whenever an interrupt triggers, the lowlevel arch code calls into
	the generic interrupt code by calling desc->handle_irq().
	This highlevel IRQ handling function only uses desc->chip primitives
	referenced by the assigned chip descriptor structure.
	</para>
    </sect1>
    <sect1>
	<title>Highlevel Driver API</title>
	<para>
	  The highlevel Driver API consists of following functions:
	  <itemizedlist>
	  <listitem><para>request_irq()</para></listitem>
	  <listitem><para>free_irq()</para></listitem>
	  <listitem><para>disable_irq()</para></listitem>
	  <listitem><para>enable_irq()</para></listitem>
	  <listitem><para>disable_irq_nosync() (SMP only)</para></listitem>
	  <listitem><para>synchronize_irq() (SMP only)</para></listitem>
	  <listitem><para>set_irq_type()</para></listitem>
	  <listitem><para>set_irq_wake()</para></listitem>
	  <listitem><para>set_irq_data()</para></listitem>
	  <listitem><para>set_irq_chip()</para></listitem>
	  <listitem><para>set_irq_chip_data()</para></listitem>
          </itemizedlist>
	  See the autogenerated function documentation for details.
	</para>
    </sect1>
    <sect1>
	<title>Highlevel IRQ flow handlers</title>
	<para>
	  The generic layer provides a set of pre-defined irq-flow methods:
	  <itemizedlist>
	  <listitem><para>handle_level_irq</para></listitem>
	  <listitem><para>handle_edge_irq</para></listitem>
	  <listitem><para>handle_simple_irq</para></listitem>
	  <listitem><para>handle_percpu_irq</para></listitem>
	  </itemizedlist>
	  The interrupt flow handlers (either predefined or architecture
	  specific) are assigned to specific interrupts by the architecture
	  either during bootup or during device initialization.
	</para>
	<sect2>
	<title>Default flow implementations</title>
	    <sect3>
	 	<title>Helper functions</title>
		<para>
		The helper functions call the chip primitives and
		are used by the default flow implementations.
		The following helper functions are implemented (simplified excerpt):
		<programlisting>
default_enable(irq)
{
	desc->chip->unmask(irq);
}

default_disable(irq)
{
	if (!delay_disable(irq))
		desc->chip->mask(irq);
}

default_ack(irq)
{
	chip->ack(irq);
}

default_mask_ack(irq)
{
	if (chip->mask_ack) {
		chip->mask_ack(irq);
	} else {
		chip->mask(irq);
		chip->ack(irq);
	}
}

noop(irq)
{
}

		</programlisting>
	        </para>
	    </sect3>
	</sect2>
	<sect2>
	<title>Default flow handler implementations</title>
	    <sect3>
	 	<title>Default Level IRQ flow handler</title>
		<para>
		handle_level_irq provides a generic implementation
		for level-triggered interrupts.
		</para>
		<para>
		The following control flow is implemented (simplified excerpt):
		<programlisting>
desc->chip->start();
handle_IRQ_event(desc->action);
desc->chip->end();
		</programlisting>
		</para>
   	    </sect3>
	    <sect3>
	 	<title>Default Edge IRQ flow handler</title>
		<para>
		handle_edge_irq provides a generic implementation
		for edge-triggered interrupts.
		</para>
		<para>
		The following control flow is implemented (simplified excerpt):
		<programlisting>
if (desc->status &amp; running) {
	desc->chip->hold();
	desc->status |= pending | masked;
	return;
}
desc->chip->start();
desc->status |= running;
do {
	if (desc->status &amp; masked)
		desc->chip->enable();
	desc->status &amp;= ~pending;
	handle_IRQ_event(desc->action);
} while (status &amp; pending);
desc->status &amp;= ~running;
desc->chip->end();
		</programlisting>
		</para>
   	    </sect3>
	    <sect3>
	 	<title>Default simple IRQ flow handler</title>
		<para>
		handle_simple_irq provides a generic implementation
		for simple interrupts.
		</para>
		<para>
		Note: The simple flow handler does not call any
		handler/chip primitives.
		</para>
		<para>
		The following control flow is implemented (simplified excerpt):
		<programlisting>
handle_IRQ_event(desc->action);
		</programlisting>
		</para>
   	    </sect3>
	    <sect3>
	 	<title>Default per CPU flow handler</title>
		<para>
		handle_percpu_irq provides a generic implementation
		for per CPU interrupts.
		</para>
		<para>
		Per CPU interrupts are only available on SMP and
		the handler provides a simplified version without
		locking.
		</para>
		<para>
		The following control flow is implemented (simplified excerpt):
		<programlisting>
desc->chip->start();
handle_IRQ_event(desc->action);
desc->chip->end();
		</programlisting>
		</para>
   	    </sect3>
	</sect2>
	<sect2>
	<title>Quirks and optimizations</title>
	<para>
	The generic functions are intended for 'clean' architectures and chips,
	which have no platform-specific IRQ handling quirks. If an architecture
	needs to implement quirks on the 'flow' level then it can do so by
	overriding the highlevel irq-flow handler.
	</para>
	</sect2>
	<sect2>
	<title>Delayed interrupt disable</title>
	<para>
	This per interrupt selectable feature, which was introduced by Russell
	King in the ARM interrupt implementation, does not mask an interrupt
	at the hardware level when disable_irq() is called. The interrupt is
	kept enabled and is masked in the flow handler when an interrupt event
	happens. This prevents losing edge interrupts on hardware which does
	not store an edge interrupt event while the interrupt is disabled at
	the hardware level. When an interrupt arrives while the IRQ_DISABLED
	flag is set, then the interrupt is masked at the hardware level and
	the IRQ_PENDING bit is set. When the interrupt is re-enabled by
	enable_irq() the pending bit is checked and if it is set, the
	interrupt is resent either via hardware or by a software resend
	mechanism. (It's necessary to enable CONFIG_HARDIRQS_SW_RESEND when
	you want to use the delayed interrupt disable feature and your
	hardware is not capable of retriggering	an interrupt.)
	The delayed interrupt disable can be runtime enabled, per interrupt,
	by setting the IRQ_DELAYED_DISABLE flag in the irq_desc status field.
	</para>
	</sect2>
    </sect1>
    <sect1>
	<title>Chiplevel hardware encapsulation</title>
	<para>
	The chip level hardware descriptor structure irq_chip
	contains all the direct chip relevant functions, which
	can be utilized by the irq flow implementations.
	  <itemizedlist>
	  <listitem><para>ack()</para></listitem>
	  <listitem><para>mask_ack() - Optional, recommended for performance</para></listitem>
	  <listitem><para>mask()</para></listitem>
	  <listitem><para>unmask()</para></listitem>
	  <listitem><para>retrigger() - Optional</para></listitem>
	  <listitem><para>set_type() - Optional</para></listitem>
	  <listitem><para>set_wake() - Optional</para></listitem>
	  </itemizedlist>
	These primitives are strictly intended to mean what they say: ack means
	ACK, masking means masking of an IRQ line, etc. It is up to the flow
	handler(s) to use these basic units of lowlevel functionality.
	</para>
    </sect1>
  </chapter>

  <chapter id="doirq">
     <title>__do_IRQ entry point</title>
     <para>
 	The original implementation __do_IRQ() is an alternative entry
	point for all types of interrupts.
     </para>
     <para>
	This handler turned out to be not suitable for all
	interrupt hardware and was therefore reimplemented with split
	functionality for egde/level/simple/percpu interrupts. This is not
	only a functional optimization. It also shortens code paths for
	interrupts.
      </para>
      <para>
	To make use of the split implementation, replace the call to
	__do_IRQ by a call to desc->chip->handle_irq() and associate
        the appropriate handler function to desc->chip->handle_irq().
	In most cases the generic handler implementations should
	be sufficient.
     </para>
  </chapter>

  <chapter id="locking">
     <title>Locking on SMP</title>
     <para>
	The locking of chip registers is up to the architecture that
	defines the chip primitives. There is a chip->lock field that can be used
	for serialization, but the generic layer does not touch it. The per-irq
	structure is protected via desc->lock, by the generic layer.
     </para>
  </chapter>
  <chapter id="structs">
     <title>Structures</title>
     <para>
     This chapter contains the autogenerated documentation of the structures which are
     used in the generic IRQ layer.
     </para>
<!-- include/linux/irq.h -->
<refentry id="API-struct-irq-chip">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>August 2007</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>struct irq_chip</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.23-rc3-git3</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>struct irq_chip</refname>
 <refpurpose>
  hardware interrupt chip descriptor
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <programlisting>
struct irq_chip {
  const char * name;
  unsigned int	(* startup) (unsigned int irq);
  void (* shutdown) (unsigned int irq);
  void (* enable) (unsigned int irq);
  void (* disable) (unsigned int irq);
  void (* ack) (unsigned int irq);
  void (* mask) (unsigned int irq);
  void (* mask_ack) (unsigned int irq);
  void (* unmask) (unsigned int irq);
  void (* eoi) (unsigned int irq);
  void (* end) (unsigned int irq);
  void (* set_affinity) (unsigned int irq, cpumask_t dest);
  int (* retrigger) (unsigned int irq);
  int (* set_type) (unsigned int irq, unsigned int flow_type);
  int (* set_wake) (unsigned int irq, unsigned int on);
#ifdef CONFIG_IRQ_RELEASE_METHOD
  void (* release) (unsigned int irq, void *dev_id);
#endif
  const char * typename;
};  </programlisting>
</refsynopsisdiv>
 <refsect1>
  <title>Members</title>
  <variablelist>
    <varlistentry>      <term>name</term>
      <listitem><para>
name for /proc/interrupts
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>startup</term>
      <listitem><para>
start up the interrupt (defaults to -&gt;enable if NULL)
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>shutdown</term>
      <listitem><para>
shut down the interrupt (defaults to -&gt;disable if NULL)
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>enable</term>
      <listitem><para>
enable the interrupt (defaults to chip-&gt;unmask if NULL)
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>disable</term>
      <listitem><para>
disable the interrupt (defaults to chip-&gt;mask if NULL)
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>ack</term>
      <listitem><para>
start of a new interrupt
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>mask</term>
      <listitem><para>
mask an interrupt source
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>mask_ack</term>
      <listitem><para>
ack and mask an interrupt source
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>unmask</term>
      <listitem><para>
unmask an interrupt source
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>eoi</term>
      <listitem><para>
end of interrupt - chip level
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>end</term>
      <listitem><para>
end of interrupt - flow level
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>set_affinity</term>
      <listitem><para>
set the CPU affinity on SMP machines
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>retrigger</term>
      <listitem><para>
resend an IRQ to the CPU
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>set_type</term>
      <listitem><para>
set the flow type (IRQ_TYPE_LEVEL/etc.) of an IRQ
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>set_wake</term>
      <listitem><para>
enable/disable power-management wake-on of an IRQ
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>release</term>
      <listitem><para>
release function solely used by UML
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>typename</term>
      <listitem><para>
obsoleted by name, kept as migration helper
      </para></listitem>
    </varlistentry>
  </variablelist>
 </refsect1>
<refsect1>
<title>Description</title>
<para>
</para>
</refsect1>
</refentry>

<refentry id="API-struct-irq-desc">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>August 2007</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>struct irq_desc</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.23-rc3-git3</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>struct irq_desc</refname>
 <refpurpose>
     interrupt descriptor
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <programlisting>
struct irq_desc {
  irq_flow_handler_t handle_irq;
  struct irq_chip * chip;
  struct msi_desc * msi_desc;
  void * handler_data;
  void * chip_data;
  struct irqaction * action;
  unsigned int status;
  unsigned int depth;
  unsigned int wake_depth;
  unsigned int irq_count;
  unsigned int irqs_unhandled;
  unsigned long last_unhandled;
  spinlock_t lock;
#ifdef CONFIG_SMP
  cpumask_t affinity;
  unsigned int cpu;
#endif
#if defined(CONFIG_GENERIC_PENDING_IRQ) || defined(CONFIG_IRQBALANCE)
  cpumask_t pending_mask;
#endif
#ifdef CONFIG_PROC_FS
  struct proc_dir_entry * dir;
#endif
  const char * name;
};  </programlisting>
</refsynopsisdiv>
 <refsect1>
  <title>Members</title>
  <variablelist>
    <varlistentry>      <term>handle_irq</term>
      <listitem><para>
   highlevel irq-events handler [if NULL, <function>__do_IRQ</function>]
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>chip</term>
      <listitem><para>
   low level interrupt hardware access
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>msi_desc</term>
      <listitem><para>
   MSI descriptor
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>handler_data</term>
      <listitem><para>
   per-IRQ data for the irq_chip methods
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>chip_data</term>
      <listitem><para>
   platform-specific per-chip private data for the chip
   methods, to allow shared chip implementations
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>action</term>
      <listitem><para>
   the irq action chain
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>status</term>
      <listitem><para>
   status information
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>depth</term>
      <listitem><para>
   disable-depth, for nested <function>irq_disable</function> calls
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>wake_depth</term>
      <listitem><para>
   enable depth, for multiple <function>set_irq_wake</function> callers
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>irq_count</term>
      <listitem><para>
   stats field to detect stalled irqs
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>irqs_unhandled</term>
      <listitem><para>
   stats field for spurious unhandled interrupts
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>last_unhandled</term>
      <listitem><para>
   aging timer for unhandled count
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>lock</term>
      <listitem><para>
   locking for SMP
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>affinity</term>
      <listitem><para>
   IRQ affinity on SMP
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>cpu</term>
      <listitem><para>
   cpu index useful for balancing
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>pending_mask</term>
      <listitem><para>
   pending rebalanced interrupts
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>dir</term>
      <listitem><para>
   /proc/irq/ procfs entry
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>name</term>
      <listitem><para>
   flow handler name for /proc/interrupts output
      </para></listitem>
    </varlistentry>
  </variablelist>
 </refsect1>
<refsect1>
<title>Description</title>
<para>
</para>
</refsect1>
</refentry>

  </chapter>

  <chapter id="pubfunctions">
     <title>Public Functions Provided</title>
     <para>
     This chapter contains the autogenerated documentation of the kernel API functions
      which are exported.
     </para>
<!-- kernel/irq/manage.c -->
<refentry id="API-synchronize-irq">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>August 2007</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>synchronize_irq</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.23-rc3-git3</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>synchronize_irq</refname>
 <refpurpose>
  wait for pending IRQ handlers (on other CPUs)
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>synchronize_irq </function></funcdef>
   <paramdef>unsigned int <parameter>irq</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>irq</parameter></term>
   <listitem>
    <para>
     interrupt number to wait for
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   This function waits for any pending IRQ handlers for this interrupt
   to complete before returning. If you use this function while
   holding a resource the IRQ handler may need you will deadlock.
   </para><para>

   This function may be called - with care - from IRQ context.
</para>
</refsect1>
</refentry>

<refentry id="API-disable-irq-nosync">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>August 2007</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>disable_irq_nosync</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.23-rc3-git3</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>disable_irq_nosync</refname>
 <refpurpose>
     disable an irq without waiting
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>disable_irq_nosync </function></funcdef>
   <paramdef>unsigned int <parameter>irq</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>irq</parameter></term>
   <listitem>
    <para>
     Interrupt to disable
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Disable the selected interrupt line.  Disables and Enables are
   nested.
   Unlike <function>disable_irq</function>, this function does not ensure existing
   instances of the IRQ handler have completed before returning.
   </para><para>

   This function may be called from IRQ context.
</para>
</refsect1>
</refentry>

<refentry id="API-disable-irq">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>August 2007</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>disable_irq</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.23-rc3-git3</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>disable_irq</refname>
 <refpurpose>
     disable an irq and wait for completion
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>disable_irq </function></funcdef>
   <paramdef>unsigned int <parameter>irq</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>irq</parameter></term>
   <listitem>
    <para>
     Interrupt to disable
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Disable the selected interrupt line.  Enables and Disables are
   nested.
   This function waits for any pending IRQ handlers for this interrupt
   to complete before returning. If you use this function while
   holding a resource the IRQ handler may need you will deadlock.
   </para><para>

   This function may be called - with care - from IRQ context.
</para>
</refsect1>
</refentry>

<refentry id="API-enable-irq">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>August 2007</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>enable_irq</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.23-rc3-git3</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>enable_irq</refname>
 <refpurpose>
     enable handling of an irq
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>enable_irq </function></funcdef>
   <paramdef>unsigned int <parameter>irq</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>irq</parameter></term>
   <listitem>
    <para>
     Interrupt to enable
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Undoes the effect of one call to <function>disable_irq</function>.  If this
   matches the last disable, processing of interrupts on this
   IRQ line is re-enabled.
   </para><para>

   This function may be called from IRQ context.
</para>
</refsect1>
</refentry>

<refentry id="API-set-irq-wake">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>August 2007</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>set_irq_wake</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.23-rc3-git3</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>set_irq_wake</refname>
 <refpurpose>
     control irq power management wakeup
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>set_irq_wake </function></funcdef>
   <paramdef>unsigned int <parameter>irq</parameter></paramdef>
   <paramdef>unsigned int <parameter>on</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>irq</parameter></term>
   <listitem>
    <para>
     interrupt to control
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>on</parameter></term>
   <listitem>
    <para>
     enable/disable power management wakeup
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Enable/disable power management wakeup mode, which is
   disabled by default.  Enables and disables must match,
   just as they match for non-wakeup mode support.
   </para><para>

   Wakeup mode lets this IRQ wake the system from sleep
   states like <quote>suspend to RAM</quote>.
</para>
</refsect1>
</refentry>

<refentry id="API-free-irq">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>August 2007</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>free_irq</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.23-rc3-git3</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>free_irq</refname>
 <refpurpose>
     free an interrupt
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>free_irq </function></funcdef>
   <paramdef>unsigned int <parameter>irq</parameter></paramdef>
   <paramdef>void * <parameter>dev_id</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>irq</parameter></term>
   <listitem>
    <para>
     Interrupt line to free
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>dev_id</parameter></term>
   <listitem>
    <para>
     Device identity to free
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Remove an interrupt handler. The handler is removed and if the
   interrupt line is no longer in use by any driver it is disabled.
   On a shared IRQ the caller must ensure the interrupt is disabled
   on the card it drives before calling this function. The function
   does not return until any executing interrupts for this IRQ
   have completed.
   </para><para>

   This function must not be called from interrupt context.
</para>
</refsect1>
</refentry>

<refentry id="API-request-irq">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>August 2007</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>request_irq</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.23-rc3-git3</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>request_irq</refname>
 <refpurpose>
     allocate an interrupt line
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>request_irq </function></funcdef>
   <paramdef>unsigned int <parameter>irq</parameter></paramdef>
   <paramdef>irq_handler_t <parameter>handler</parameter></paramdef>
   <paramdef>unsigned long <parameter>irqflags</parameter></paramdef>
   <paramdef>const char * <parameter>devname</parameter></paramdef>
   <paramdef>void * <parameter>dev_id</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>irq</parameter></term>
   <listitem>
    <para>
     Interrupt line to allocate
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>handler</parameter></term>
   <listitem>
    <para>
     Function to be called when the IRQ occurs
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>irqflags</parameter></term>
   <listitem>
    <para>
     Interrupt type flags
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>devname</parameter></term>
   <listitem>
    <para>
     An ascii name for the claiming device
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>dev_id</parameter></term>
   <listitem>
    <para>
     A cookie passed back to the handler function
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   This call allocates interrupt resources and enables the
   interrupt line and IRQ handling. From the point this
   call is made your handler function may be invoked. Since
   your handler function must clear any interrupt the board
   raises, you must take care both to initialise your hardware
   and to set up the interrupt handler in the right order.
   </para><para>

   Dev_id must be globally unique. Normally the address of the
   device data structure is used as the cookie. Since the handler
   receives this value it makes sense to use it.
   </para><para>

   If your interrupt is shared you must pass a non NULL dev_id
   as this is required when freeing the interrupt.
</para>
</refsect1>
<refsect1>
<title>Flags</title>
<para>
   </para><para>

   IRQF_SHARED		Interrupt is shared
   IRQF_DISABLED	Disable local interrupts while processing
   IRQF_SAMPLE_RANDOM	The interrupt can be used for entropy
</para>
</refsect1>
</refentry>

<!-- kernel/irq/chip.c -->
<refentry id="API-set-irq-chip">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>August 2007</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>set_irq_chip</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.23-rc3-git3</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>set_irq_chip</refname>
 <refpurpose>
  set the irq chip for an irq
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>set_irq_chip </function></funcdef>
   <paramdef>unsigned int <parameter>irq</parameter></paramdef>
   <paramdef>struct irq_chip * <parameter>chip</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>irq</parameter></term>
   <listitem>
    <para>
     irq number
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>chip</parameter></term>
   <listitem>
    <para>
     pointer to irq chip description structure
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
</refentry>

<refentry id="API-set-irq-type">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>August 2007</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>set_irq_type</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.23-rc3-git3</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>set_irq_type</refname>
 <refpurpose>
     set the irq type for an irq
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>set_irq_type </function></funcdef>
   <paramdef>unsigned int <parameter>irq</parameter></paramdef>
   <paramdef>unsigned int <parameter>type</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>irq</parameter></term>
   <listitem>
    <para>
     irq number
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>type</parameter></term>
   <listitem>
    <para>
     interrupt type - see include/linux/interrupt.h
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
</refentry>

<refentry id="API-set-irq-data">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>August 2007</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>set_irq_data</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.23-rc3-git3</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>set_irq_data</refname>
 <refpurpose>
     set irq type data for an irq
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>set_irq_data </function></funcdef>
   <paramdef>unsigned int <parameter>irq</parameter></paramdef>
   <paramdef>void * <parameter>data</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>irq</parameter></term>
   <listitem>
    <para>
     Interrupt number
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>data</parameter></term>
   <listitem>
    <para>
     Pointer to interrupt specific data
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Set the hardware irq controller data for an irq
</para>
</refsect1>
</refentry>

<refentry id="API-set-irq-chip-data">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>August 2007</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>set_irq_chip_data</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.23-rc3-git3</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>set_irq_chip_data</refname>
 <refpurpose>
     set irq chip data for an irq
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>set_irq_chip_data </function></funcdef>
   <paramdef>unsigned int <parameter>irq</parameter></paramdef>
   <paramdef>void * <parameter>data</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>irq</parameter></term>
   <listitem>
    <para>
     Interrupt number
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>data</parameter></term>
   <listitem>
    <para>
     Pointer to chip specific data
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Set the hardware irq chip data for an irq
</para>
</refsect1>
</refentry>

  </chapter>

  <chapter id="intfunctions">
     <title>Internal Functions Provided</title>
     <para>
     This chapter contains the autogenerated documentation of the internal functions.
     </para>
<!-- kernel/irq/handle.c -->
<refentry id="API-handle-bad-irq">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>August 2007</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>handle_bad_irq</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.23-rc3-git3</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>handle_bad_irq</refname>
 <refpurpose>
  handle spurious and unhandled irqs
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void fastcall <function>handle_bad_irq </function></funcdef>
   <paramdef>unsigned int <parameter>irq</parameter></paramdef>
   <paramdef>struct irq_desc * <parameter>desc</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>irq</parameter></term>
   <listitem>
    <para>
     the interrupt number
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>desc</parameter></term>
   <listitem>
    <para>
     description of the interrupt
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Handles spurious and unhandled IRQ's. It also prints a debugmessage.
</para>
</refsect1>
</refentry>

<refentry id="API-handle-IRQ-event">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>August 2007</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>handle_IRQ_event</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.23-rc3-git3</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>handle_IRQ_event</refname>
 <refpurpose>
     irq action chain handler
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>irqreturn_t <function>handle_IRQ_event </function></funcdef>
   <paramdef>unsigned int <parameter>irq</parameter></paramdef>
   <paramdef>struct irqaction * <parameter>action</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>irq</parameter></term>
   <listitem>
    <para>
     the interrupt number
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>action</parameter></term>
   <listitem>
    <para>
     the interrupt action chain for this irq
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Handles the action chain of an irq event
</para>
</refsect1>
</refentry>

<refentry id="API---do-IRQ">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>August 2007</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>__do_IRQ</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.23-rc3-git3</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>__do_IRQ</refname>
 <refpurpose>
     original all in one highlevel IRQ handler
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>unsigned int <function>__do_IRQ </function></funcdef>
   <paramdef>unsigned int <parameter>irq</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>irq</parameter></term>
   <listitem>
    <para>
     the interrupt number
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   __do_IRQ handles all normal device IRQ's (the special
   SMP cross-CPU interrupts have their own specific
   handlers).
   </para><para>

   This is the original x86 implementation which is used for every
   interrupt type.
</para>
</refsect1>
</refentry>

<!-- kernel/irq/chip.c -->
<refentry id="API-dynamic-irq-init">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>August 2007</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>dynamic_irq_init</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.23-rc3-git3</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>dynamic_irq_init</refname>
 <refpurpose>
  initialize a dynamically allocated irq
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>dynamic_irq_init </function></funcdef>
   <paramdef>unsigned int <parameter>irq</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>irq</parameter></term>
   <listitem>
    <para>
     irq number to initialize
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
</refentry>

<refentry id="API-dynamic-irq-cleanup">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>August 2007</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>dynamic_irq_cleanup</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.23-rc3-git3</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>dynamic_irq_cleanup</refname>
 <refpurpose>
     cleanup a dynamically allocated irq
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>dynamic_irq_cleanup </function></funcdef>
   <paramdef>unsigned int <parameter>irq</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>irq</parameter></term>
   <listitem>
    <para>
     irq number to initialize
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
</refentry>

<refentry id="API-set-irq-msi">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>August 2007</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>set_irq_msi</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.23-rc3-git3</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>set_irq_msi</refname>
 <refpurpose>
     set irq type data for an irq
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>set_irq_msi </function></funcdef>
   <paramdef>unsigned int <parameter>irq</parameter></paramdef>
   <paramdef>struct msi_desc * <parameter>entry</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>irq</parameter></term>
   <listitem>
    <para>
     Interrupt number
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>entry</parameter></term>
   <listitem>
    <para>
     Pointer to MSI descriptor data
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Set the hardware irq controller data for an irq
</para>
</refsect1>
</refentry>

<refentry id="API-handle-simple-irq">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>August 2007</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>handle_simple_irq</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.23-rc3-git3</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>handle_simple_irq</refname>
 <refpurpose>
     Simple and software-decoded IRQs.
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void fastcall <function>handle_simple_irq </function></funcdef>
   <paramdef>unsigned int <parameter>irq</parameter></paramdef>
   <paramdef>struct irq_desc * <parameter>desc</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>irq</parameter></term>
   <listitem>
    <para>
     the interrupt number
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>desc</parameter></term>
   <listitem>
    <para>
     the interrupt description structure for this irq
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Simple interrupts are either sent from a demultiplexing interrupt
   handler or come from hardware, where no interrupt hardware control
   is necessary.
</para>
</refsect1>
<refsect1>
<title>Note</title>
<para>
   The caller is expected to handle the ack, clear, mask and
   unmask issues if necessary.
</para>
</refsect1>
</refentry>

<refentry id="API-handle-level-irq">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>August 2007</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>handle_level_irq</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.23-rc3-git3</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>handle_level_irq</refname>
 <refpurpose>
     Level type irq handler
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void fastcall <function>handle_level_irq </function></funcdef>
   <paramdef>unsigned int <parameter>irq</parameter></paramdef>
   <paramdef>struct irq_desc * <parameter>desc</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>irq</parameter></term>
   <listitem>
    <para>
     the interrupt number
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>desc</parameter></term>
   <listitem>
    <para>
     the interrupt description structure for this irq
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Level type interrupts are active as long as the hardware line has
   the active level. This may require to mask the interrupt and unmask
   it after the associated handler has acknowledged the device, so the
   interrupt line is back to inactive.
</para>
</refsect1>
</refentry>

<refentry id="API-handle-fasteoi-irq">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>August 2007</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>handle_fasteoi_irq</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.23-rc3-git3</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>handle_fasteoi_irq</refname>
 <refpurpose>
     irq handler for transparent controllers
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void fastcall <function>handle_fasteoi_irq </function></funcdef>
   <paramdef>unsigned int <parameter>irq</parameter></paramdef>
   <paramdef>struct irq_desc * <parameter>desc</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>irq</parameter></term>
   <listitem>
    <para>
     the interrupt number
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>desc</parameter></term>
   <listitem>
    <para>
     the interrupt description structure for this irq
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Only a single callback will be issued to the chip</title>
<para>
   an -&gt;<function>eoi</function>
   call when the interrupt has been serviced. This enables support
   for modern forms of interrupt handlers, which handle the flow
   details in hardware, transparently.
</para>
</refsect1>
</refentry>

<refentry id="API-handle-edge-irq">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>August 2007</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>handle_edge_irq</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.23-rc3-git3</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>handle_edge_irq</refname>
 <refpurpose>
     edge type IRQ handler
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void fastcall <function>handle_edge_irq </function></funcdef>
   <paramdef>unsigned int <parameter>irq</parameter></paramdef>
   <paramdef>struct irq_desc * <parameter>desc</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>irq</parameter></term>
   <listitem>
    <para>
     the interrupt number
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>desc</parameter></term>
   <listitem>
    <para>
     the interrupt description structure for this irq
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Interrupt occures on the falling and/or rising edge of a hardware
   signal. The occurence is latched into the irq controller hardware
   and must be acked in order to be reenabled. After the ack another
   interrupt can happen on the same source even before the first one
   is handled by the assosiacted event handler. If this happens it
   might be necessary to disable (mask) the interrupt depending on the
   controller hardware. This requires to reenable the interrupt inside
   of the loop which handles the interrupts which have arrived while
   the handler was running. If all pending interrupts are handled, the
   loop is left.
</para>
</refsect1>
</refentry>

<refentry id="API-handle-percpu-irq">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>August 2007</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>handle_percpu_irq</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.23-rc3-git3</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>handle_percpu_irq</refname>
 <refpurpose>
     Per CPU local irq handler
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void fastcall <function>handle_percpu_irq </function></funcdef>
   <paramdef>unsigned int <parameter>irq</parameter></paramdef>
   <paramdef>struct irq_desc * <parameter>desc</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>irq</parameter></term>
   <listitem>
    <para>
     the interrupt number
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>desc</parameter></term>
   <listitem>
    <para>
     the interrupt description structure for this irq
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Per CPU interrupts on SMP machines without locking requirements
</para>
</refsect1>
</refentry>

  </chapter>

  <chapter id="credits">
     <title>Credits</title>
	<para>
		The following people have contributed to this document:
		<orderedlist>
			<listitem><para>Thomas Gleixner<email>tglx@linutronix.de</email></para></listitem>
			<listitem><para>Ingo Molnar<email>mingo@elte.hu</email></para></listitem>
		</orderedlist>
	</para>
  </chapter>
</book>
