Exactly, I mean ppc_md.init_IRQ().<br>
Ok. What have I to setup in this function ? I set the mask and other registers. Is it right ?&nbsp; How do I chose the mask ?<br>
At the end of this funtion, IRQ are disable. Is that right ? So who does enable IRQs ?<br>
<br>
Sorry for all this questions, I am learning the low layer of Linux.<br><br><div><span class="gmail_quote">2008/8/21, Michael Ellerman &lt;<a href="mailto:michael@ellerman.id.au">michael@ellerman.id.au</a>&gt;:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
On Thu, 2008-08-21 at 09:13 +0200, Sébastien Chrétien wrote:<br> &gt; Hello,<br> &gt;<br> &gt; What are the constraints in order to implement a irq_init function ?<br> <br> <br>You mean ppc_md.init_IRQ() ?<br> <br> If so, it&#39;s a hook you can use to setup your interrupt controller. It&#39;s<br>
 called from init_IRQ() (arch/powerpc/kernel/irq.c), which is called from<br> start_kernel() (init/main.c).<br> <br> Not long after it is called irqs are enabled. I think it is the last<br> callback into arch code before irqs are enabled.<br>
 <br> When it is called the device tree is unflattened, so you can use the of_<br> API. Bootmem is setup so you can use alloc_bootmem(), but you can&#39;t<br> kmalloc yet. ioremap should work.<br> <br><br> <br> &gt; What is the aim or get_irq ? Does it retun an information about the<br>
 &gt; mask, the states, or... ?<br> <br> <br>The aim of ppc_md.get_irq() ? It&#39;s called from do_IRQ()<br> (arch/powerpc/kernel/irq.c) which is called from assembler in the<br> appropriate head_x.S<br> <br> It just returns the number (virtual number) of the irq that just fired.<br>
 If for some reason you took a spurious interrupt it should return<br> NO_IRQ.<br> <br> I&#39;m not sure what you mean about masks or states, someone else might<br> though.<br> <br> cheers<br> <br> --<br> Michael Ellerman<br>
 OzLabs, IBM Australia Development Lab<br> <br> wwweb: <a href="http://michael.ellerman.id.au">http://michael.ellerman.id.au</a><br> phone: +61 2 6212 1183 (tie line 70 21183)<br> <br> We do not inherit the earth from our ancestors,<br>
 we borrow it from our children. - S.M.A.R.T Person<br> <br></blockquote></div><br>