From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NezdE-0008Bm-P2 for qemu-devel@nongnu.org; Tue, 09 Feb 2010 18:36:36 -0500 Received: from [199.232.76.173] (port=50350 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NezdE-0008Bd-Ed for qemu-devel@nongnu.org; Tue, 09 Feb 2010 18:36:36 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NezdD-0006kF-0N for qemu-devel@nongnu.org; Tue, 09 Feb 2010 18:36:36 -0500 Received: from fe02x03-cgp.akado.ru ([77.232.31.165]:59220 helo=akado.ru) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NezdC-0006k3-Ld for qemu-devel@nongnu.org; Tue, 09 Feb 2010 18:36:34 -0500 Date: Wed, 10 Feb 2010 02:36:33 +0300 (MSK) From: malc Subject: Re: [Qemu-devel] [PATCH 07/15] ac97: convert to new PCI API In-Reply-To: <4B71EB73.608@codemonkey.ws> Message-ID: References: <1265752899-26980-1-git-send-email-aliguori@us.ibm.com> <1265752899-26980-8-git-send-email-aliguori@us.ibm.com> <4B71E72C.8050702@codemonkey.ws> <4B71EB73.608@codemonkey.ws> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: Michael Tsirkin , qemu-devel@nongnu.org, Alex Graf On Tue, 9 Feb 2010, Anthony Liguori wrote: > On 02/09/2010 05:06 PM, malc wrote: > > > > > We already have this problem with the current interface. > > > > > Uh, i've meant the registration of one function to rule them all, instead > > of how it's done currently - separate accessors for b/w/l/whatever. > > > > How does that make any difference? Both the ioport and memory registrations > interface take the same function pointer regardless of access size. > > If you wanted to introduce a quad-word specific accessor, you would need to > introduce a different registration mechanism or you would have to change the > signature for all of the functions. Let's see: Currently we have this readb(...): dostuff return stuff readw(...): dostuff return stuff You are replacing it with read(size...): if (size == 1): do1 elif (size == 2): do2 else: # and here your code assumes that everything is handy dandy # and size is 4 do4 The interface being implicit rather than explicit about the sizes makes this possible, so i'm against it. The code was written the way it was written for a purpose. -- mailto:av1474@comtv.ru