Question about irq

Adam Lackorzynski adam at os.inf.tu-dresden.de
Thu Jul 24 23:11:36 CEST 2014


Hi,

On Wed Jul 23, 2014 at 18:39:38 +0200, Maria Soler wrote:
> I have a question about how the irqs work in L4re. I am running
> FIASCO.OC + L4re on qemu for arm. I want to be able to raise an
> interruption from qemu and handle it from my VM. I am basing my work
> on the example at examples/libs/libirq (I am coding in C, so it is
> more convenient than other examples in C++).
> 
> I have a qemu device that has the interrupt number #N in qemu. I rise
> the interrupt but the l4irq_wait function doesn't return. I have tried
> both with qemu_irq_pulse(state->irq); and with
> qemu_set_irq(state->irq, 1), also I have tried attaching the irq and
> requesting it; but there is no difference.
>
> My basic doubts are:
> - Is the number of the interruption the same within L4re as in qemu?
> and if not, how can I calculate/check what the number is in L4re?

The numbers are the same. However, on ARM with the GIC there might be an
offset of 32 in the number compared to the one inside qemu.

> - If the number is OK, what can be the problem I am facing? The
> mentioned example doesn't work for me either (l4irq_request returns 0
> in this case), so I don't know how to solve this exactly.

Leaving the libirq aside you could directly use l4io_request_irq(). Does
it make a difference?

> - Is there a better example for this that I can use as a baseline?

The libirq hides most of the details (on purpose) so with using
l4io_request_irq() you'll be closer to the source. Use then l4_irq_wait
or l4_irq_receive. You can also enable IRQ logging in JDB (use shift-O
for enabling the IRQ-Log (make sure to enable extended logging in
Fiasco's configuration), run, and then look at it with shift-T).

> In case this is relevant, this is part of a more complex project, so I
> have a .devs file where I have a line like:
> 
>     Io.Res.irq(#N);
> 
> I am also using this file in the present step to keep things as
> similar as possible to the real scenario.

Good approach!



Adam
-- 
Adam                 adam at os.inf.tu-dresden.de
  Lackorzynski         http://os.inf.tu-dresden.de/~adam/



More information about the l4-hackers mailing list