From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1ILMaC-0004C7-Ib for qemu-devel@nongnu.org; Wed, 15 Aug 2007 13:23:00 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1ILMaC-0004Bm-1N for qemu-devel@nongnu.org; Wed, 15 Aug 2007 13:23:00 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ILMaB-0004Bf-RG for qemu-devel@nongnu.org; Wed, 15 Aug 2007 13:22:59 -0400 Received: from mail.codesourcery.com ([65.74.133.4]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1ILMaB-0000B2-BO for qemu-devel@nongnu.org; Wed, 15 Aug 2007 13:22:59 -0400 From: Paul Brook Date: Wed, 15 Aug 2007 18:22:55 +0100 References: <200708151821.17608.paul@codesourcery.com> In-Reply-To: <200708151821.17608.paul@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200708151822.56446.paul@codesourcery.com> Subject: [Qemu-devel] Re: Extending qemu_irq for reset signals Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Blue Swirl Cc: qemu-devel On Wednesday 15 August 2007, Paul Brook wrote: > > Okay, more explaining. This is the case where I'd want to use the > > signal: DMA controller ("upstream") can reset the slave device (ESP or > > Lance). DMA controller is created first and I also want to allocate > > reset signals at that point. Later when ESP is created, it should be > > possible to put ESP reset function and opaque data to the signal given > > but this is not possible with current API. Currently the DMA data > > would be passed to qemu_allocate_irqs. > > Ah, I see. The problem here is that you've got a cyclic dependency. For DMA > operations the ESP is in charge, so it makes sense to create the > subservient DMA device first. For the reset signals the DMA controller is > in charge so ideally you create the ESP device first. Because the DMA > interface is most complicated, it's probably takes precedence. > > I think you need to modify or use sparc32_dma_set_reset_data to take a > qemu_irq rather than a callback and opaque argument. Alternatively you can > move things around a bit and have the sun4m code do something similar. i.e. > the ESP and lance devices return the reset lines, then the sun4m code pokes > into the DMA device state. Oh, or you can pass a pointer to a qemu_irq from the DMA to the ESP and have the ESP poke its reset object in there that way. Paul