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 ? 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 <<a href="mailto:michael@ellerman.id.au">michael@ellerman.id.au</a>>:</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> > Hello,<br> ><br> > 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's a hook you can use to setup your interrupt controller. It'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't<br> kmalloc yet. ioremap should work.<br> <br><br> <br> > What is the aim or get_irq ? Does it retun an information about the<br>
> mask, the states, or... ?<br> <br> <br>The aim of ppc_md.get_irq() ? It'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'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>