Paul Brook wrote:
On Tuesday 18 July 2006 18:03, Thorsten Zitterell wrote:
I am working on a Gumstix system [1] emulation for QEMU which is based
on a Intel XScale processor. The board has an expansion card for network
support which is a smc91x compatible NIC. However, the irq line is not
directly connected to the processor's interrupt controller but to an
GPIO which triggers an irq when a level edge is detected.
As discussed on IRC this is the wrong way to do this. Instead use the
mechanisms in arm_pic.[ch] and make you GPIO emulation look like an interrupt
controller.
There's no point passing round both a pic callback and an object when we can
embed the callback in the object.
I don't think that adding a callback is bad. It can be useful to use the
device with another CPU or IRQ controller for example.
In fact, I would like to go further by adding a type such as
"QEMUSignal" which could be used for IRQs or any other I/Os. Then you
can pass it to devices. You can used qemu_signal_set(QEMUSignal *signal,
int level) to set the level and add listeners to get notified on the
changes with something like: qemu_add_signal_cb(QEMUSignal *signal, void
(*cb)(void *opaque), void *opaque).
Regards,
Fabrice.
_______________________________________________
Qemu-devel mailing list
Qemu-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/qemu-devel