From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:50461) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RjVpJ-0000X0-3x for qemu-devel@nongnu.org; Sat, 07 Jan 2012 07:56:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RjVpH-00017k-09 for qemu-devel@nongnu.org; Sat, 07 Jan 2012 07:56:49 -0500 Received: from v220110690675601.yourvserver.net ([78.47.199.172]:34837) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RjVpG-00017O-PS for qemu-devel@nongnu.org; Sat, 07 Jan 2012 07:56:46 -0500 Message-ID: <4F055C9E.60401@weilnetz.de> Date: Thu, 05 Jan 2012 09:17:34 +0100 From: Stefan Weil MIME-Version: 1.0 References: <1325705558-24358-1-git-send-email-avi@redhat.com> <4F04CE13.3030005@codemonkey.ws> <4F04EBCB.6030501@codemonkey.ws> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] Rename target_phys_addr_t to Phys List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: Avi Kivity , qemu-devel@nongnu.org Am 05.01.2012 01:24, schrieb Peter Maydell: > On 5 January 2012 00:16, Anthony Liguori wrote: >> On 01/04/2012 05:33 PM, Peter Maydell wrote: >>> A lot of the usage of target_phys_addr_t in hw/ is actually not >>> handling addresses at all, but merely offsets into device IO regions >>> (ie as parameters to device read/write functions)... >> >> Exactly, which is why using target_phys_addr_t (and subsequently building >> the device twice) doesn't make a lot of sense. > > So should we have a hw_offset type for this? That would cut out a lot > of the noise and let us find out how much code in hw/ is actually > using physaddrs... > > -- PMM Hardware offsets are hardware: you can count the address lines or get the values from the vendor's manual (you cannot count when serial protocolsare used). A 32 bit PCI card will take 32 bit offsets (or smaller), even when itis used in a 64 bit host. It should be possible to model that in QEMU, too. uint8_t, uint16_t, uint32_t and uint64_t are good enough to describe the typical offset ranges of any hardware. Cheers, Stefan Weil