From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=43795 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PAnet-0004Pr-Mr for qemu-devel@nongnu.org; Tue, 26 Oct 2010 13:50:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PAnQr-00042h-KF for qemu-devel@nongnu.org; Tue, 26 Oct 2010 13:35:34 -0400 Received: from mx1.redhat.com ([209.132.183.28]:28558) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PAnQr-00042V-5w for qemu-devel@nongnu.org; Tue, 26 Oct 2010 13:35:33 -0400 Message-ID: <4CC7115D.4050108@redhat.com> Date: Tue, 26 Oct 2010 19:35:25 +0200 From: Avi Kivity MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH 1/2] Type-safe ioport callbacks References: <1287934469-16624-1-git-send-email-avi@redhat.com> <1287934469-16624-2-git-send-email-avi@redhat.com> <4CC55554.4060103@redhat.com> <4CC68BE1.5010207@redhat.com> <4CC70D5D.4020109@redhat.com> <4CC70F65.7050506@codemonkey.ws> In-Reply-To: <4CC70F65.7050506@codemonkey.ws> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: Blue Swirl , qemu-devel@nongnu.org, kvm@vger.kernel.org On 10/26/2010 07:27 PM, Anthony Liguori wrote: >> Sorry, I don't follow your meaning. >> >> When I said "size is implied" I meant that the IOPort object has a >> separate function pointer for sizes 1, 2, and 4, so it >> ioport_register() doesn't need a size parameter. But I don't see how >> that relates to your comment. > > > Yeah, I don't think it makes sense to combine "this is how to dispatch > I/O" with "this is a region of I/O address space". Oh, so Blue meant the size of the region in ports, not the size of the individual ports. I think that putting the range length (but not base address) in the IOPort structure may make sense. > > I think an IORegion should contain an IOPort structure though. I > think the name needs rethinking. > > Maybe: > > struct PortIOHandler; > struct MemoryIOHandler; Why two types? I think some devices use PIO on a PC and MMIO on other architectures. Sharing the type would allow sharing code. -- error compiling committee.c: too many arguments to function