From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1G3Gag-0000Ty-9E for qemu-devel@nongnu.org; Wed, 19 Jul 2006 14:16:10 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1G3Gae-0000Oj-LJ for qemu-devel@nongnu.org; Wed, 19 Jul 2006 14:16:09 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1G3Gae-0000ON-FV for qemu-devel@nongnu.org; Wed, 19 Jul 2006 14:16:08 -0400 Received: from [65.74.133.4] (helo=mail.codesourcery.com) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1G3Gaf-00019d-AF for qemu-devel@nongnu.org; Wed, 19 Jul 2006 14:16:09 -0400 From: Paul Brook Subject: Re: [Qemu-devel] smc91x irq patch Date: Wed, 19 Jul 2006 19:15:59 +0100 References: <44BCD9E8.6060108@nomovok.com> <200607190429.22717.paul@codesourcery.com> <44BE719A.2000708@bellard.org> In-Reply-To: <44BE719A.2000708@bellard.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200607191916.00635.paul@codesourcery.com> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org > > 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. It means all the device emulation code has got to keep track of three bits of information rather than two, which seems silly when the callback and the object are inherently linked. I can't think of any cases where the callback is not be implied by the object. > 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). Extending the arm_pic code to work with all targets on my list of things to do. Paul