qemu-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-discuss] Sending IRQ in ARM emulation


From: Peter Maydell
Subject: Re: [Qemu-discuss] Sending IRQ in ARM emulation
Date: Tue, 22 Sep 2015 08:48:27 -0700

On 22 September 2015 at 08:30, Maciej Bielski <address@hidden> wrote:
> Hi,
>
> I am using qemu-system-arm for ARM emulation. I have found that an
> interrupt may be sent by qemu_set_irq(), with all device configuration
> done inside fdt. But then, the only result is that a cpu flag is set:
>
> cpu->tcg_exit_req = 1
>
> Is there a way to invoke any kind of callback on such event?

What are you actually trying to achieve?

qemu_set_irq() is used for doing the modelled equivalent of
"my device just set its outbound 'interrupt' signal to 1".
Typically the board model will connect that signal wire up
to an interrupt controller. The interrupt controller in turn
will have outbound wires that connect to the CPU's IRQ and
FIQ inputs. So the device raises its interrupt line; the
interrupt controller will handle that in the same way the
hardware would (depending on how the guest has programmed
it to set the interrupt priority, whether that interrupt
is enabled/disabled, etc, whether the line is configured to
raise IRQ or FIQ), and might raise either the IRQ or FIQ
line to the CPU, or might do neither immediately. Then the
CPU model handles having its IRQ or FIQ input set, by doing
what a CPU does in that situation: it causes the guest to
stop doing what it was doing and start executing at the
appropriate entry point for an interrupt handler. The
tcg_exit_req flag is part of QEMU's internal mechanism for
causing the emulated CPU to stop doing whatever it was doing.
When the CPU reaches the beginning of the next basic block
it will check that flag and break out of its "execute code"
inner loop, at which point it will notice that it has a
pending exception to take.

All of this should just work with no particular need for
you to write any kind of callback function.

thanks
-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]