<p><br>
在 2012-12-21 AM2:05,&quot;anish singh&quot; &lt;<a href="mailto:anish198519851985@gmail.com">anish198519851985@gmail.com</a>&gt;写道:<br>
&gt;<br>
&gt;<br>
&gt; On Dec 20, 2012 6:30 AM, &quot;Woody Wu&quot; &lt;<a href="mailto:narkewoody@gmail.com">narkewoody@gmail.com</a>&gt; wrote:<br>
&gt; &gt;<br>
&gt; &gt; Hi, List<br>
&gt; &gt;<br>
&gt; &gt; Where is the Kernel code that handles external interrupts? I want to<br>
&gt; &gt; have a look at it but haven&#39;t found out where it is.<br>
&gt; &gt;<br>
&gt; &gt; Actually, I have some basic questions about interrupt handling in Linux.<br>
&gt; &gt; 1. After Kernel&#39;s ISR received an interrupt, I believe it will invoke a<br>
&gt; &gt;    handler defined in a device driver if any. But it should be the<br>
&gt; &gt;    device driver&#39;s responsibility or kernel ISR&#39;s responsibility to<br>
&gt; &gt;    clear (or acknowledge) the interrupt?<br>
&gt; If the interrupt in question is currently being handled then in<br>
&gt; the case of edge triggered interrupt we just mask the interrupt,set it pending and bail out.Once the interrupt handler completes then we check for pending interrupt and handle it.In level triggered we don&#39;t do that.<br>

&gt; Kerenel ISR -this is mixture of core kernel interrupt handling code + your device driver interrupt handler(if this is chip driver which is supposed to get one interrupt and is reponsible for calling other interrupt handlers based on the chip register status then you do explicit masking unmasking yourself).<br>

&gt; If you device driver is a interrupt controller driver then you register your driver with kernel interrupt handling code and need to write some callbacks such as .mask,.unmask and so on.This callbacks are called at appropiate places whenever the interrupt is raised.This interrupt is then passed to drivers who has requested for this interrupt by calling request_irq.</p>

<p>Sorry not fully understand . My device is an Ethernet controller. It needs to response TX and RX interrupts triggered by the device itself. In this case , my driver is a chip driver or interrupt controller driver in your terms?</p>

<p>If my driver needs to do the mask and unmask job, what&#39;s the kernel API I should call?</p>
<p>And , I don&#39;t understand why there exists differences between level and edge triggered interrupts in terms of kernel handling.</p>
<p>I know my questions might be basic , so would please tell me what&#39;s the kernel code for ARM architecture doing these complex jobs as you explained?</p>
<p>Thanks in advance !</p>
<p>&gt;<br>
&gt; &gt;<br>
&gt; &gt; 2. My device, an AX88796B network controller, asserting the interrupt<br>
&gt; &gt;    line in a level-triggered manner. Now I met problem with the device that<br>
&gt; &gt;    might caused by the CPU interrupt mode is not set as level-triggered by<br>
&gt; &gt;    edge trigger.  My CPU is Samsung S3C2410, an ARM920T powered one.  Does<br>
&gt; &gt;    anyone know usually where and how should I do this kind of setting?<br>
&gt; Just pass the parameter &quot;level triggered&quot; in request_irq in your device driver.<br>
&gt;<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; Thanks in advance.<br>
&gt; &gt;<br>
&gt; &gt; --<br>
&gt; &gt; woody<br>
&gt; &gt; I can&#39;t go back to yesterday - because I was a different person then.<br>
&gt; &gt;<br>
&gt; &gt; _______________________________________________<br>
&gt; &gt; Kernelnewbies mailing list<br>
&gt; &gt; <a href="mailto:Kernelnewbies@kernelnewbies.org">Kernelnewbies@kernelnewbies.org</a><br>
&gt; &gt; <a href="http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies">http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies</a><br>
</p>