|
From: | Fabrice Bellard |
Subject: | Re: [Qemu-devel] smc91x irq patch |
Date: | Wed, 19 Jul 2006 19:53:30 +0200 |
User-agent: | Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20040913 |
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.
[Prev in Thread] | Current Thread | [Next in Thread] |